Exemplo n.º 1
0
 * Users (types) allowed to access this module.
 */
$allowedUsersAr = array(AMA_TYPE_TUTOR);
/**
 * Get needed objects
 */
$neededObjAr = array(AMA_TYPE_TUTOR => array('layout', 'course', 'course_instance'));
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = 'default';
include_once 'include/tutor_functions.inc.php';
include_once 'include/tutor.inc.php';
/*
 * YOUR CODE HERE
 */
$id_course = $courseInstanceObj->id_corso;
$start_date = AMA_DataHandler::ts_to_date($courseInstanceObj->data_inizio, "%d/%m/%Y");
$history = '';
if ($id_course) {
    // get object course
    $courseObj = read_course_from_DB($id_course);
    if (is_object($courseObj) && !AMA_dataHandler::isError($courseObj)) {
        $course_title = $courseObj->titolo;
        //title
        $id_toc = $courseObj->id_nodo_toc;
        //id_toc_node
    } else {
        $errObj = new ADA_error(translateFN("Corso non trovato"), translateFN("Impossibile proseguire."));
    }
}
$studentObj = read_user_from_DB($id_student);
if (is_object($studentObj) && !AMA_dataHandler::isError($studentObj)) {
 // check that txn_id has not been previously processed
 // check that receiver_email is your Primary PayPal email
 // check that payment_amount/payment_currency are correct
 // process payment
 // $first_name = $keyarray['first_name'];
 // $last_name = $keyarray['last_name'];
 $item_name = $keyarray['item_name'];
 $payment_amount = $keyarray['mc_gross'];
 $payment_currency = $keyarray['mc_currency'];
 $item_number = $keyarray['item_number'];
 $txn_id = $keyarray['txn_id'];
 $receiver_email = $keyarray['business'];
 $payer_email = $keyarray['payer_email'];
 $payment_status = $keyarray['payment_status'];
 if ($receiver_email == $paypal_email_address && $payment_amount == $product_price && $payment_currency == $price_currency && $payment_status == 'Completed') {
     $date = AMA_DataHandler::ts_to_date(time(), "%d/%m/%Y - %H:%M:%S");
     $ipn_log .= "Paypal PDT DATA OK\n";
     if ($debug == 1) {
         fwrite($fpx, "Paypal PDT DATA OK - {$date}\n");
     }
     $first_name = $userObj->getFirstName();
     $last_name = $userObj->getLastName();
     //                $body = translateFN("Hai effettuato il pagamento di") . " ". $payment_amount ." EUR ". translateFN('tramite Paypal' . "\n\r").
     //                $body .= translateFN('Questo addebito verrà visualizzato sull\'estratto conto della carta di credito o prepagata come pagamento a PAYPAL *Lynx s.r.l.');
     $message_ha["testo"] = translateFN('Gentile') . " " . $first_name . ",\r\n" . translateFN("grazie per aver eseguito l'iscrizione al") . " " . $course_name . "\n\r\n\r";
     //                $message_ha["testo"] .=  $body_mail;
     //$message_ha["testo"] .= "\n\r\n\r". translateFN("I tuoi dati di accesso sono. username: "******"\n\r" . translateFN("password:"******" " . $password );
     //$message_ha["testo"] .= "\n\r". translateFN("Buono studio.");
     $message = nl2br($message_ha["testo"]);
     $message .= "<br />" . translateFN('Ti abbiamo inviato una mail di conferma dell\'iscrizione. Cliccando sul link inserito nella mail potrai accedere al corso');
     $message .= "<br />--------<br />" . translateFN('Dettagli di pagamento.');
Exemplo n.º 3
0
function get_student_dataFN($id_student, $id_instance)
{
    $dh = $GLOBALS['dh'];
    $http_root_dir = $GLOBALS['http_root_dir'];
    $student_info_ha = $dh->_get_user_info($id_student);
    // Get info of each student
    if (AMA_DataHandler::isError($student_info_ha)) {
        $msg = $student_info_ha->getMessage();
        return $msg;
        break;
    }
    $instance_course_ha = $dh->course_instance_get($id_instance);
    // Get the instance courses data
    if (AMA_DataHandler::isError($instance_course_ha)) {
        $msg = $instance_course_ha->getMessage();
        return $msg;
        break;
    }
    $id_course = $instance_course_ha['id_corso'];
    $start_date = AMA_DataHandler::ts_to_date($instance_course_ha['data_inizio'], ADA_DATE_FORMAT);
    $info_course = $dh->get_course($id_course);
    // Get title course
    if (AMA_DataHandler::isError($info_course)) {
        $msg = $info_course->getMessage();
        return $msg;
        break;
    }
    $course_title = $info_course['titolo'];
    /*
        global $debug;$debug=1;
        mydebug(__LINE__,__FILE__,$student_info_ha);
        $debug = 0;
    */
    $name = $student_info_ha['nome'];
    $name_desc = "<B>" . translateFN("Nome") . "</B>";
    $surname = $student_info_ha['cognome'];
    $surname_desc = "<B>" . translateFN("Cognome") . "</B>";
    $email = $student_info_ha['email'];
    $email_desc = "<B>" . translateFN("Email") . "</B>";
    $phone_n = $student_info_ha['telefono'];
    $phone_desc = "<B>" . translateFN("Telefono") . "</B>";
    $user = $student_info_ha['username'];
    $user_desc = "<B>" . translateFN("User Name") . "</B>";
    $course_desc = "<B>" . translateFN("Titolo del Corso") . "</B>";
    $start_desc = "<B>" . translateFN("Data di inizio") . "</B>";
    $dati_stude[0]['name_desc'] = $name_desc;
    $dati_stude[0]['name'] = $name;
    $dati_stude[1]['surname_desc'] = $surname_desc;
    $dati_stude[1]['surname'] = $surname;
    $dati_stude[2]['email_desc'] = $email_desc;
    $dati_stude[2]['email'] = $email;
    $dati_stude[3]['phone_desc'] = $phone_desc;
    $dati_stude[3]['phone'] = $phone_n;
    $dati_stude[4]['user_desc'] = $user_desc;
    $dati_stude[4]['user'] = $user;
    $dati_stude[5]['course_desc'] = $course_desc;
    $dati_stude[5]['course'] = $course_title;
    $dati_stude[6]['start_desc'] = $start_desc;
    $dati_stude[6]['start'] = $start_date;
    $tObj = new Table();
    // $tObj->initTable('0','center','0','1','100%','black','white','black','white');
    $tObj->initTable('1', 'center', '0', '1', '', '', '', '', '', '1');
    // Syntax: $border,$align,$cellspacing,$cellpadding,$width,$col1, $bcol1,$col2, $bcol2
    $caption = translateFN("Studente selezionato: <B>") . $id_student . "</B> ";
    // $summary = translateFN("Elenco dei corsi monitorati");
    $summary = "";
    // $tObj->setTable($dati_stude,$caption,$summary);
    $tObj->setTable($dati_stude, $caption, $summary);
    $student_info = $tObj->getTable();
    return $student_info;
}
Exemplo n.º 4
0
    $event_time = $ora_evento;
}
if (!isset($data_evento)) {
    $event_date = today_dateFN();
} else {
    $event_date = $data_evento;
}
/*
$event_time = today_timeFN();
$event_date = today_dateFN();
*/
$ada_address_book = EventsAddressBook::create($userObj);
$tester_TimeZone = MultiPort::getTesterTimeZone($sess_selected_tester);
$time = time() + get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
/*
* Last access link
*/
if (isset($_SESSION['sess_id_course_instance'])) {
    $last_access = $userObj->get_last_accessFN($_SESSION['sess_id_course_instance'], "UT", null);
    $last_access = AMA_DataHandler::ts_to_date($last_access);
} else {
    $last_access = $userObj->get_last_accessFN(null, "UT", null);
    $last_access = AMA_DataHandler::ts_to_date($last_access);
}
if ($last_access == '' || is_null($last_access)) {
    $last_access = '-';
}
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'user_level' => $user_level, 'titolo' => $titolo, 'testo' => isset($testo) ? trim($testo) : '', 'destinatari' => isset($destinatari) ? trim($destinatari) : '', 'course_title' => '<a href="../browsing/main_index.php">' . $course_title . '</a>', 'status' => $err_msg, 'timezone' => $tester_TimeZone, 'event_time' => $event_time, 'event_date' => $event_date, 'last_visit' => $last_access, 'rubrica' => $ada_address_book->getHtml(), 'status' => $err_msg);
$options_Ar = array('onload_func' => "load_addressbook();updateClock({$time});");
//$options_Ar .= array('onload_func' => "updateClock($time);");
ARE::render($layout_dataAr, $content_dataAr, NULL, $options_Ar);
Exemplo n.º 5
0
 function get_class_reportFN($id_course, $order = "", $index_att = "", $type = 'HTML')
 {
     $dh = $GLOBALS['dh'];
     $http_root_dir = $GLOBALS['http_root_dir'];
     $debug = isset($GLOBALS['debug']) ? $GLOBALS['debug'] : null;
     $npar = isset($GLOBALS['npar']) ? $GLOBALS['npar'] : null;
     $hpar = isset($GLOBALS['hpar']) ? $GLOBALS['hpar'] : null;
     $mpar = isset($GLOBALS['mpar']) ? $GLOBALS['mpar'] : null;
     $epar = isset($GLOBALS['epar']) ? $GLOBALS['epar'] : null;
     $bpar = isset($GLOBALS['mpar']) ? $GLOBALS['mpar'] : null;
     $cpar = isset($GLOBALS['epar']) ? $GLOBALS['epar'] : null;
     // default parameters for activity index are in configuration file
     if (empty($npar)) {
         $npar = NOTE_PAR;
     }
     // notes
     if (!isset($hpar)) {
         $hpar = HIST_PAR;
     }
     // history
     if (!isset($mpar)) {
         $mpar = MSG_PAR;
     }
     //messages
     if (!isset($epar)) {
         $epar = EXE_PAR;
     }
     // exercises
     if (!isset($bpar)) {
         $bpar = defined('BKM_PAR') ? BKM_PAR : null;
     }
     //bookmarks
     if (!isset($cpar)) {
         $cpar = defined('CHA_PAR') ? CHA_PAR : null;
     }
     // chat
     $student_list_ar = $this->student_list;
     $id_instance = $this->id;
     if ($student_list_ar != 0) {
         $info_course = $dh->get_course($id_course);
         // Get title course
         if (AMA_DataHandler::isError($info_course)) {
             $msg = $info_course->getMessage();
             return $msg;
         }
         $course_title = $info_course['titolo'];
         $instance_course_ha = $dh->course_instance_get($id_instance);
         // Get the instance courses data
         if (AMA_DataHandler::isError($instance_course_ha)) {
             $msg = $instance_course_ha->getMessage();
             return $msg;
         }
         $start_date = AMA_DataHandler::ts_to_date($instance_course_ha['data_inizio'], ADA_DATE_FORMAT);
         $num_student = -1;
         $tot_history_count = 0;
         $tot_exercises_score = 0;
         $tot_exercises_number = 0;
         $tot_added_notes = 0;
         $tot_read_notes = 0;
         $tot_message_count = 0;
         $tot_message_count_in = 0;
         $tot_message_count_out = 0;
         $tot_bookmarks_count = 0;
         $tot_chatlines_count_out = 0;
         $tot_index = 0;
         $tot_level = 0;
         /**
          * @author giorgio 27/ott/2014
          * 
          * change to:
          * $report_generation_TS = time();
          * 
          * to have full date & time generation of report
          * but be warned that table log_classi may grow A LOT!
          */
         $report_generation_TS = dt2tsFN(today_dateFN());
         if (MODULES_TEST) {
             $tot_exercises_score_test = 0;
             $tot_exercises_number_test = 0;
             $tot_exercises_score_survey = 0;
             $tot_exercises_number_survey = 0;
             $test_db = AMATestDataHandler::instance(MultiPort::getDSN($_SESSION['sess_selected_tester']));
             $test_score = $test_db->getStudentsScores($id_course, $id_instance);
         }
         foreach ($student_list_ar as $one_student) {
             $num_student++;
             //starts with 0
             $id_student = $one_student['id_utente_studente'];
             $student_level = $one_student['livello'];
             $status_student = $one_student['status'];
             $dati['id'] = $id_student;
             $dati['level'] = $student_level;
             $ymdhms = today_dateFN();
             $utime = dt2tsFN($ymdhms);
             $dati['date'] = $report_generation_TS;
             if (!empty($id_student) and ($status_student == ADA_STATUS_SUBSCRIBED or $status_student == ADA_SERVICE_SUBSCRIPTION_STATUS_COMPLETED)) {
                 $studentObj = MultiPort::findUser($id_student);
                 //new Student($id_student,$id_instance);
                 if ($studentObj->full != 0) {
                     //==0) {
                     $err_msg = $studentObj->error_msg;
                 } else {
                     if ($studentObj instanceof ADAPractitioner) {
                         /**
                          * @author giorgio 14/apr/2015
                          * 
                          * If student is actually a tutor, build a new student
                          * object for history and evaluation purposes
                          */
                         $studentObj = $studentObj->toStudent();
                     }
                     $student_name = $studentObj->getFullname();
                     //$studentObj->nome." ".$studentObj->cognome;
                     // vito
                     $studentObj->set_course_instance_for_history($id_instance);
                     //$studentObj->history->setCourseInstance($id_instance);
                     $studentObj->history->setCourse($id_course);
                     $studentObj->get_exercise_dataFN($id_instance, $id_student);
                     $st_exercise_dataAr = $studentObj->user_ex_historyAr;
                     $st_score = 0;
                     $st_exer_number = 0;
                     if (is_array($st_exercise_dataAr)) {
                         foreach ($st_exercise_dataAr as $exercise) {
                             $st_score += $exercise[7];
                             $st_exer_number++;
                         }
                     }
                     $dati['exercises'] = $st_exer_number;
                     $dati['score'] = $st_score;
                     if (MODULES_TEST) {
                         $st_score_test = isset($test_score[$id_student]['score_test']) ? $test_score[$id_student]['score_test'] : 0;
                         $st_exer_number_test = isset($test_score[$id_student]['max_score_test']) ? $test_score[$id_student]['max_score_test'] : 0;
                         $dati['exercises_test'] = $st_exer_number_test;
                         $dati['score_test'] = $st_score_test;
                         $st_score_survey = isset($test_score[$id_student]['score_survey']) ? $test_score[$id_student]['score_survey'] : 0;
                         $st_exer_number_survey = isset($test_score[$id_student]['max_score_survey']) ? $test_score[$id_student]['max_score_survey'] : 0;
                         $dati['exercises_survey'] = $st_exer_number_survey;
                         $dati['score_survey'] = $st_score_survey;
                     }
                     $sub_courses = $dh->get_subscription($id_student, $id_instance);
                     if ($sub_courses['tipo'] == ADA_STATUS_SUBSCRIBED) {
                         $out_fields_ar = array('nome', 'titolo', 'id_istanza', 'data_creazione');
                         $clause = "tipo = '" . ADA_NOTE_TYPE . "' AND id_utente = '{$id_student}'";
                         $nodes = $dh->find_course_nodes_list($out_fields_ar, $clause, $id_course);
                         $added_nodes_count = count($nodes);
                         $added_nodes_count_norm = str_pad($added_nodes_count, 5, "0", STR_PAD_LEFT);
                         $added_notes = "<!-- {$added_nodes_count_norm} --><a href={$http_root_dir}/tutor/tutor.php?op=student_notes&id_instance={$id_instance}&id_student={$id_student}>" . $added_nodes_count . "</a>";
                         //$added_notes = $added_nodes_count;
                     } else {
                         $added_notes = "<!-- 0 -->-";
                     }
                     $read_notes_count = $studentObj->total_visited_notesFN($id_student, $id_course);
                     if ($read_notes_count > 0) {
                         $read_nodes_count_norm = str_pad($read_notes_count, 5, "0", STR_PAD_LEFT);
                         $read_notes = "<!-- {$read_nodes_count_norm} -->{$read_notes_count}";
                     } else {
                         $read_notes = "<!-- 0 -->-";
                     }
                     $st_history_count = "0";
                     $debug = 0;
                     $st_history_count = $studentObj->total_visited_nodesFN($id_student, ADA_LEAF_TYPE);
                     // vito, 11 mar 2009. Ottiene solo il numero di visite a nodi di tipo foglia.
                     // vogliamo anche il numero di visite a nodi di tipo gruppo.
                     $st_history_count += $studentObj->total_visited_nodesFN($id_student, ADA_GROUP_TYPE);
                     $dati['visits'] = $st_history_count;
                     $st_name = "<!-- {$student_name} --><a href=" . $http_root_dir . "/tutor/tutor.php?op=zoom_student&id_student=" . $id_student;
                     $st_name .= "&id_course=" . $id_course . "&id_instance=" . $id_instance . ">";
                     $st_name .= $student_name . "</a>";
                     $st_history_count_norm = str_pad($st_history_count, 5, "0", STR_PAD_LEFT);
                     $st_history = "<!-- {$st_history_count_norm} --><a href=" . $http_root_dir . "/tutor/tutor_history.php?id_student=" . $id_student;
                     $st_history .= "&id_course=" . $id_course . "&id_course_instance=" . $id_instance . ">";
                     $st_history .= $st_history_count . "</a>";
                     $st_history_last_access = $studentObj->get_last_accessFN($id_instance, "T");
                     //$dati['date'] = $st_history_last_access;
                     $st_score_norm = str_pad($st_score, 5, "0", STR_PAD_LEFT);
                     $st_exercises = "<!-- {$st_score_norm} --><a href=" . $http_root_dir . "/tutor/tutor_exercise.php?id_student=" . $id_student;
                     $st_exercises .= "&id_course_instance=" . $id_instance . " class='dontwrap'>";
                     $st_exercises .= $st_score . " " . translateFN("su") . " " . $st_exer_number * ADA_MAX_SCORE . "</a>";
                     if (MODULES_TEST) {
                         $st_score_norm_test = str_pad($st_score_test, 5, "0", STR_PAD_LEFT);
                         $st_exercises_test = '<!-- ' . $st_score_norm_test . ' --><a href="' . MODULES_TEST_HTTP . '/tutor.php?op=test&id_course_instance=' . $id_instance . '&id_course=' . $id_course . '&id_student=' . $id_student . '" class="dontwrap">' . $st_score_test . ' ' . translateFN('su') . ' ' . $st_exer_number_test . '</a>';
                         $st_score_norm_survey = str_pad($st_score_survey, 5, "0", STR_PAD_LEFT);
                         $st_exercises_survey = '<!-- ' . $st_score_norm_survey . ' --><a href="' . MODULES_TEST_HTTP . '/tutor.php?op=survey&id_course_instance=' . $id_instance . '&id_course=' . $id_course . '&id_student=' . $id_student . '" class="dontwrap">' . $st_score_survey . ' ' . translateFN('su') . ' ' . $st_exer_number_survey . '</a>';
                     }
                     // user data
                     $dati_stude[$num_student]['id'] = $id_student;
                     $dati_stude[$num_student]['student'] = $st_name;
                     // history
                     $dati_stude[$num_student]['history'] = $st_history;
                     $tot_history_count += $st_history_count;
                     if ($st_history_last_access != "-") {
                         $dati_stude[$num_student]['last_access'] = "<a href=\"{$http_root_dir}/tutor/tutor_history_details.php?period=1&id_student={$id_student}&id_course_instance={$id_instance}&id_course={$id_course}\">" . $st_history_last_access . "</a>";
                         $dati['last_access'] = $studentObj->get_last_accessFN($id_instance, 'UT');
                     } else {
                         $dati_stude[$num_student]['last_access'] = $st_history_last_access;
                         $dati['last_access'] = null;
                     }
                     // exercises
                     $tot_exercises_score += $st_score;
                     $tot_exercises_number += $st_exer_number;
                     $dati_stude[$num_student]['exercises'] = $st_exercises;
                     $dati['exercises'] = $st_exer_number;
                     if (MODULES_TEST) {
                         $tot_exercises_score_test += $st_score_test;
                         $tot_exercises_number_test += $st_exer_number_test;
                         $dati_stude[$num_student]['exercises_test'] = $st_exercises_test;
                         $dati['exercises_test'] = $st_exer_number_test;
                         $tot_exercises_score_survey += $st_score_survey;
                         $tot_exercises_number_survey += $st_exer_number_survey;
                         $dati_stude[$num_student]['exercises_survey'] = $st_exercises_survey;
                         $dati['exercises_survey'] = $st_exer_number_survey;
                     }
                     // forum notes written
                     $dati_stude[$num_student]['added_notes'] = $added_notes;
                     $tot_added_notes += $added_nodes_count;
                     $dati['added_notes'] = $added_nodes_count;
                     // forum notes read
                     $dati_stude[$num_student]['read_notes'] = $read_notes;
                     $tot_read_notes += $read_notes_count;
                     $dati['read_notes'] = $read_notes_count;
                     // messages
                     //$mh = new MessageHandler("%d/%m/%Y - %H:%M:%S");
                     $mh = MessageHandler::instance(MultiPort::getDSN($_SESSION['sess_selected_tester']));
                     $sort_field = "data_ora desc";
                     // messages received
                     $msgs_ha = $mh->get_messages($id_student, ADA_MSG_SIMPLE, array("id_mittente", "data_ora"), $sort_field);
                     if (AMA_DataHandler::isError($msgs_ha)) {
                         $err_code = $msgs_ha->code;
                         $dati_stude[$num_student]['message_count_in'] = "-";
                     } else {
                         $user_message_count = count($msgs_ha);
                         $dati_stude[$num_student]['message_count_in'] = $user_message_count;
                         $tot_message_count += $user_message_count;
                     }
                     $tot_message_count_in += $user_message_count;
                     $dati['msg_in'] = $user_message_count;
                     // messages sent
                     $msgs_ha = $mh->get_sent_messages($id_student, ADA_MSG_SIMPLE, array("id_mittente", "data_ora"), $sort_field);
                     if (AMA_DataHandler::isError($msgs_ha)) {
                         $err_code = $msgs_ha->code;
                         $dati_stude[$num_student]['message_count_out'] = "-";
                     } else {
                         $user_message_count = count($msgs_ha);
                         $dati_stude[$num_student]['message_count_out'] = $user_message_count;
                         $tot_message_count += $user_message_count;
                     }
                     $tot_message_count_out += $user_message_count;
                     $dati['msg_out'] = $user_message_count;
                     //chat..
                     $msgs_ha = $mh->get_sent_messages($id_student, ADA_MSG_CHAT, array("id_mittente", "data_ora"), $sort_field);
                     if (AMA_DataHandler::isError($msgs_ha)) {
                         $err_code = $msgs_ha->code;
                         $dati_stude[$num_student]['chat'] = "-";
                     } else {
                         $chatlines_count_out = count($msgs_ha);
                         $dati_stude[$num_student]['chat'] = $chatlines_count_out;
                         $tot_chatlines_count_out += $chatlines_count_out;
                     }
                     $tot_chatlines_count_out += $chatlines_count_out;
                     $dati['chat'] = $chatlines_count_out;
                     //bookmarks..
                     include_once 'bookmark_class.inc.php';
                     $bookmarks_count = count(Bookmark::get_bookmarks($id_student));
                     $dati_stude[$num_student]['bookmarks'] = $bookmarks_count;
                     $tot_bookmarks_count += $bookmarks_count;
                     $dati['bookmarks'] = $bookmarks_count;
                     // activity index
                     if (empty($index_att)) {
                         // parametro passato alla funzione
                         if (empty($GLOBALS['index_activity_expression'])) {
                             //
                             if (!isset($bcount)) {
                                 $bcount = 1;
                             }
                             $index = $added_nodes_count * $npar + $st_history_count * $hpar + $user_message_count * $mpar + $st_exer_number * $epar + $bookmarks_count * $bcount + $chatlines_count_out * $cpar;
                         } else {
                             $index = eval($GLOBALS['index_activity_expression']);
                         }
                     } else {
                         $index = eval($index_att);
                     }
                     $dati_stude[$num_student]['index'] = $index;
                     //echo $index;
                     $tot_index += $index;
                     $dati['index'] = $index;
                     // level
                     $tot_level += $student_level;
                     $dati_stude[$num_student]['level'] = '<span id="studentLevel_' . $id_student . '">' . $student_level . '</span>';
                     $forceUpdate = false;
                     $linksHtml = $this->generateLevelButtons($id_student, $forceUpdate);
                     $dati_stude[$num_student]['level_plus'] = !is_null($linksHtml) ? $linksHtml : '-';
                     // inserting a row in table log_classi
                     $this->log_class_data($id_course, $id_instance, $dati);
                 }
             }
         }
         // average data
         $tot_students = $num_student + 1;
         $av_history = $tot_history_count / $tot_students;
         $av_exercises = $tot_exercises_score / $tot_students . " " . translateFN("su") . " " . floor($tot_exercises_number * ADA_MAX_SCORE / $tot_students);
         if (MODULES_TEST) {
             $av_exercises_test = round($tot_exercises_score_test / $tot_students, 2) . ' ' . translateFN('su') . ' ' . floor($tot_exercises_number_test / $tot_students);
             $av_exercises_survey = round($tot_exercises_score_survey / $tot_students, 2) . ' ' . translateFN('su') . ' ' . floor($tot_exercises_number_survey / $tot_students);
         }
         $av_added_notes = $tot_added_notes / $tot_students;
         $av_read_notes = $tot_read_notes / $tot_students;
         $av_message_count_in = $tot_message_count_in / $tot_students;
         $av_message_count_out = $tot_message_count_out / $tot_students;
         $av_chat_count_out = $tot_chatlines_count_out / $tot_students;
         $av_bookmarks_count = $tot_bookmarks_count / $tot_students;
         $av_index = $tot_index / $tot_students;
         $av_level = $tot_level / $tot_students;
         $av_student = $tot_students;
         $dati_stude[$av_student]['id'] = "-";
         $dati_stude[$av_student]['student'] = translateFN("Media");
         $dati_stude[$av_student]['history'] = round($av_history, 2);
         $dati_stude[$av_student]['last_access'] = "-";
         $dati_stude[$av_student]['exercises'] = '<span class="dontwrap">' . $av_exercises . '</span>';
         if (MODULES_TEST) {
             $dati_stude[$av_student]['exercises_test'] = '<span class="dontwrap">' . $av_exercises_test . '</span>';
             $dati_stude[$av_student]['exercises_survey'] = '<span class="dontwrap">' . $av_exercises_survey . '</span>';
         }
         $dati_stude[$av_student]['added_notes'] = round($av_added_notes, 2);
         $dati_stude[$av_student]['read_notes'] = round($av_read_notes, 2);
         $dati_stude[$av_student]['message_count_in'] = round($av_message_count_in, 2);
         $dati_stude[$av_student]['message_count_out'] = round($av_message_count_out, 2);
         $dati_stude[$av_student]['chat'] = round($av_chat_count_out, 2);
         $dati_stude[$av_student]['bookmarks'] = round($av_bookmarks_count, 2);
         $dati_stude[$av_student]['index'] = round($av_index, 2);
         $dati_stude[$av_student]['level'] = '<span id="averageLevel">' . round($av_level, 2) . '</span>';
         $dati_stude[$av_student]['level_plus'] = "-";
         // @author giorgio 16/mag/2013
         // was $dati_stude[$av_student]['level_minus'] = "-";
         // $dati_stude[$av_student]['level_less'] = "-";
         if (!empty($order)) {
             //var_dump($dati_stude);
             $dati_stude = masort($dati_stude, $order, 1, SORT_NUMERIC);
         }
         // TABLE LABELS
         $table_labels[0] = $this->generate_class_report_header();
         /**
          * @author giorgio 16/mag/2013
          * 
          * unset the unwanted columns data and labels. unwanted cols are defined in config/config_class_report.inc.php
          */
         $arrayToUse = 'report' . $type . 'ColArray';
         $this->clean_class_reportFN($arrayToUse, $table_labels, $dati_stude);
         return array('report_generation_date' => $report_generation_TS) + array_merge($table_labels, $dati_stude);
     } else {
         return null;
     }
 }
Exemplo n.º 6
0
/*
 * Find the appointment
 */
$msg_ha = MultiPort::getUserAppointment($userObj, $msg_id);
if (AMA_DataHandler::isError($msg_ha)) {
    $errObj = new ADA_Error($msg_ha, translateFN('Errore durante la lettura di un evento'), NULL, NULL, NULL, 'comunica/list_events.php?status=' . urlencode(translateFN('Errore durante la lettura')));
}
/**
 * Conversione Time Zone
 */
$tester_TimeZone = MultiPort::getTesterTimeZone($tester);
$offset = get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
$date_time = $msg_ha['data_ora'];
$date_time_zone = $date_time + $offset;
$zone = translateFN("Time zone:") . " " . $tester_TimeZone;
$Data_messaggio = AMA_DataHandler::ts_to_date($date_time_zone, "%d/%m/%Y - %H:%M:%S") . " " . $zone;
//$Data_messaggio = AMA_DataHandler::ts_to_date($msg_ha['data_ora'], "%d/%m/%Y - %H:%M:%S");
/*
 * Check if the subject has an internal identifier and remove it
 */
$oggetto = ADAEventProposal::removeEventToken($msg_ha['titolo']);
$mittente = $msg_ha['mittente'];
$destinatario = str_replace(",", ", ", $msg_ha['destinatari']);
// $destinatario = $msg_ha['destinatari'];
$dest_encode = urlencode($mittente);
if (isset($message_text) && strlen($message_text) > 0) {
    $testo = urlencode(trim($message_text));
} else {
    $message_text = '';
    $testo = '';
}
Exemplo n.º 7
0
                }
            } else {
                $tutorFullName = translateFN('Nessun tutor');
            }
            $edit_link = BaseHtmlLib::link("edit_instance.php?id_course={$courseId}&id_course_instance={$instanceId}", $edit_img->getHtml());
            //  $view_link = BaseHtmlLib::link("view_instance.php?id=$instanceId", $view_img->getHtml());
            $delete_link = BaseHtmlLib::link("delete_instance.php?id_course={$courseId}&id_course_instance={$instanceId}", translateFN('Delete instance'));
            $actions = BaseHtmlLib::plainListElement('class:inline_menu', array($edit_link, $delete_link));
            if ($instance[1] > 0) {
                $start_date = AMA_DataHandler::ts_to_date($instance[1]);
            } else {
                $start_date = translateFN('Non iniziato');
            }
            $duration = sprintf("%d giorni", $instance[3]);
            $scheduled = AMA_DataHandler::ts_to_date($instance[2]);
            $end_date = AMA_DataHandler::ts_to_date($instance[4]);
            $title = $instance[5];
            $assign_tutor_link = BaseHtmlLib::link("assign_tutor.php?id_course={$courseId}&id_course_instance={$instanceId}", $tutorFullName);
            $subscriptions_link = BaseHtmlLib::link("course_instance.php?id_course={$courseId}&id_course_instance={$instanceId}", translateFN('Lista studenti'));
            $tbody_data[] = array($instanceId, $title, $scheduled, $duration, $start_date, $end_date, $assign_tutor_link, $subscriptions_link, $actions);
        }
        $data = BaseHtmlLib::tableElement('', $thead_data, $tbody_data);
    } else {
        $data = new CText(translateFN('Non sono state trovate istanze per il corso selezionato'));
    }
} else {
    $data = new CText(translateFN('Non sono state trovate istanze per il corso selezionato'));
}
$label = translateFN('Lista istanze del corso') . ' ' . $course_title;
$help = translateFN('Da qui il provider admin può vedere la lista delle istanze del corso selezionato');
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'status' => $status, 'label' => $label, 'help' => $help, 'edit_profile' => $userObj->getEditProfilePage(), 'data' => $data->getHtml(), 'module' => isset($module) ? $module : '', 'messages' => $user_messages->getHtml());
Exemplo n.º 8
0
	'Classe' => 'Classe',
	'Pubblica'=>'Pubblica');
//  $options_of_chat_types = array('Privata' => 'Privata');
}
*
*/
//get time and date and transform it to sting format
/*
 * @todo: inserire controllo timezone
 */
$actual_date = time();
$actual_start_time = AMA_DataHandler::ts_to_date($actual_date, "%H:%M:%S");
$actual_start_day = AMA_DataHandler::ts_to_date($actual_date, "%d/%m/%y");
$default_end_date = time() + SHUTDOWN_CHAT_TIME;
$default_end_time = AMA_DataHandler::ts_to_date($default_end_date, "%H:%M:%S");
$default_end_day = AMA_DataHandler::ts_to_date($default_end_date, "%d/%m/%y");
// default max users numebr
$default_max_users = DEFAULT_MAX_USERS;
// default course instance value
if (!empty($sess_id_course_instance)) {
    $id_course_instance = $sess_id_course_instance;
} else {
    $id_course_instance = 0;
}
// array with data to build the form
$form_data = array(array('label' => 'Titolo *', 'type' => 'text', 'name' => 'chat_title', 'size' => '85', 'maxlenght' => '120'), array('label' => 'Argomento *', 'type' => 'text', 'name' => 'chat_topic', 'size' => '85', 'maxlength' => '120'), array('label' => 'Messaggio di benvenuto', 'type' => 'textarea', 'rows' => '1', 'cols' => '63', 'wrap' => 'physical', 'name' => 'welcome_msg'), array('label' => 'Proprietario *', 'type' => 'text', 'name' => 'chat_owner', 'value' => $user_uname, 'size' => '20', 'maxlength' => '20'), array('label' => 'Tipo *', 'type' => 'select', 'name' => 'chat_type', 'value' => $options_of_chat_types), array('label' => 'Numero utenti', 'type' => 'text', 'name' => 'max_users', 'size' => '3', 'maxlength' => '3', 'value' => $default_max_users), array('label' => 'Giorno di apertura<br>(gg/mm/aa)', 'type' => 'text', 'name' => 'start_day', 'size' => '8', 'maxlength' => '8', 'value' => $actual_start_day), array('label' => 'Ora di avvio<br>(oo:mm:ss)', 'type' => 'text', 'name' => 'start_time', 'size' => '8', 'maxlength' => '8', 'value' => $actual_start_time), array('label' => 'Giorno di chiusura<br>(gg/mm/aa)', 'type' => 'text', 'name' => 'end_day', 'size' => '8', 'maxlength' => '8', 'value' => $default_end_day), array('label' => 'Ora di termine<br>(oo:mm:ss)', 'type' => 'text', 'name' => 'end_time', 'size' => '8', 'maxlength' => '8', 'value' => $default_end_time), array('label' => 'Classe ID', 'type' => 'text', 'value' => $id_course_instance, 'name' => 'id_course_instance', 'size' => '11', 'maxlength' => '11'), array('label' => '', 'type' => 'submit', 'name' => 'invia', 'value' => 'Invia'), array('type' => 'reset', 'name' => 'reset', 'value' => 'Reset'));
//vito 14 gennaio 2009, eliminato ../comunica/
$f->initForm("create_chat.php", "POST", "", "create_chat_form");
$f->setForm($form_data);
$form = $f->getForm();
// ******************************************************
Exemplo n.º 9
0
 /**
  *
  * @param  $id_course_instance
  * @return array
  */
 private function _get_last_accessFN($id_course_instance = "", $provider_dh, $return_dateonly = true)
 {
     // if used by student before entering a course, we must pass the DataHandler
     if ($provider_dh == NULL) {
         $provider_dh = $GLOBALS['dh'];
     }
     //$error = $GLOBALS['error'];
     // $debug = $GLOBALS['debug'];
     $sess_id_user = $_SESSION['sess_id_user'];
     if (!isset($this->id_user)) {
         $id_user = $sess_id_user;
     } else {
         $id_user = $this->id_user;
     }
     if ($id_course_instance) {
         $last_visited_node = $provider_dh->get_last_visited_nodes($id_user, $id_course_instance, 10);
         /*
          * vito, 10 ottobre 2008: $last_visited_node è Array([0]=>Array([id_nodo], ...))
          */
         if (!AMA_DB::isError($last_visited_node) && is_array($last_visited_node) && isset($last_visited_node[0])) {
             $last_visited_time = $return_dateonly ? AMA_DataHandler::ts_to_date($last_visited_node[0]['data_uscita']) : $last_visited_node[0]['data_uscita'];
             return array($last_visited_node[0]['id_nodo'], $last_visited_time);
         } else {
             return "-";
         }
     } else {
         /*
          * Sara, 2/07/2014
          * return the last access between all instances course 
          */
         $serviceProviders = $this->getTesters();
         if (!empty($serviceProviders) && is_array($serviceProviders)) {
             $i = 0;
             foreach ($serviceProviders as $Provider) {
                 $provider_dh = AMA_DataHandler::instance(MultiPort::getDSN($Provider));
                 $courseInstances_provider = $provider_dh->get_course_instances_for_this_student($this->getId());
                 if (AMA_DataHandler::isError($courseInstances_provider)) {
                     $courseInstances_provider = new ADA_Error($courseInstances_provider);
                 } else {
                     $istance_testerAr[$i] = array('istances' => $courseInstances_provider, 'provider' => $Provider);
                 }
                 $i++;
             }
         }
         if (!empty($istance_testerAr)) {
             $Max = 0;
             $id_nodo = null;
             foreach ($istance_testerAr as $istanceTs) {
                 $courseInstancesAr = $istanceTs['istances'];
                 $pointer = $istanceTs['provider'];
                 $tester = AMA_DataHandler::instance(MultiPort::getDSN($pointer));
                 foreach ($courseInstancesAr as $courseInstance) {
                     $id_instance = $courseInstance['id_istanza_corso'];
                     $last_access = $tester->get_last_visited_nodes($id_user, $id_instance, 10);
                     if (!AMA_DB::isError($last_access) && is_array($last_access) && count($last_access)) {
                         $last_accessAr = array($last_access[0]['id_nodo'], $last_access[0]['data_uscita']);
                         if ($last_accessAr[1] > $Max) {
                             $id_nodo = $last_accessAr[0];
                             $Max = $last_accessAr[1];
                         }
                     }
                 }
             }
             $Last_accessAr = array(0 => $id_nodo, 1 => $Max);
             return $Last_accessAr;
         } else {
             return "-";
         }
     }
 }
Exemplo n.º 10
0
    }
    header("Location: list_messages.php?status={$status}");
    exit;
}
// get message content
//$msg_ha = $mh->get_message($sess_id_user, $msg_id);
$msg_ha = MultiPort::getUserMessage($userObj, $msg_id);
if (AMA_DataHandler::isError($msg_ha)) {
    $errObj = new ADA_Error($msg_ha, translateFN('Errore in lettura messaggio'), NULL, NULL, NULL, 'comunica/list_messages.php?status=' . urlencode(translateFN('Errore in lettura messaggio')));
}
$mittente = $msg_ha['mittente'];
/*
 * usare $msg_ha['id_mittente'] e $sess_id_user per ottenere corso e istanza corso comuni.
 * cosa fare se entrambe gli utenti sono iscritti a due classi?
 */
$Data_messaggio = AMA_DataHandler::ts_to_date($msg_ha['data_ora'], "%d/%m/%Y - %H:%M:%S");
$oggetto = $msg_ha['titolo'];
$destinatario = str_replace(",", ", ", $msg_ha['destinatari']);
$message_text = $msg_ha['testo'];
$node_title = "";
// empty
$dest_encode = urlencode($mittente);
$testo = urlencode(trim($message_text));
$oggetto_url = urlencode(trim($oggetto));
// Registrazione variabili per replay
$destinatari_replay = $mittente;
//
$_SESSION['destinatari_replay'] = $destinatari_replay;
$testo_replay = trim($message_text);
$_SESSION['testo_replay'] = $testo_replay;
$titolo_replay = trim($oggetto);
Exemplo n.º 11
0
     case CLASS_CHAT:
         $old_chat_type = translateFN("classe");
         break;
     case INVITATION_CHAT:
         $old_chat_type = translateFN("privata");
         break;
     default:
 }
 // switch
 $chat_room_HA['actual_chat_type'] = $old_chat_type;
 //get time and date and transform it to sting format
 //ts2dFN()
 $old_start_time = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_avvio'], "%H:%M:%S");
 $old_start_day = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_avvio']);
 $old_end_time = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_fine'], "%H:%M:%S");
 $old_end_day = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_fine']);
 // different chat type options are available for admins and for tutors
 // admin case
 $chat_room_HA['start_day'] = $old_start_day;
 $chat_room_HA['start_time'] = $old_start_time;
 $chat_room_HA['end_day'] = $old_end_day;
 $chat_room_HA['end_time'] = $old_end_time;
 if ($id_profile == AMA_TYPE_SWITCHER) {
     $options_of_chat_types = array('-- select --' => '-- select --', 'Privata' => 'Privata', 'Classe' => 'Classe', 'Pubblica' => 'Pubblica');
 }
 // tutor case
 if ($id_profile == AMA_TYPE_TUTOR) {
     $options_of_chat_types = array('-- select --' => '-- select --', 'Classe' => 'Classe');
 }
 $chat_room_HA['new_chat_type'] = $options_of_chat_types;
 $chat_room_HA['chat_title'] = $chatroom_old_ha['titolo_chat'];
 private static function display_messages_as_form($data_Ar = array(), $message_type = ADA_MSG_SIMPLE, $testers_dataAr = array())
 {
     $common_dh = $GLOBALS['common_dh'];
     $javascript_ok = check_javascriptFN($_SERVER['HTTP_USER_AGENT']);
     $appointments_Ar = array();
     if ($message_type == ADA_MSG_SIMPLE) {
         $list_module = 'list_messages.php';
         $read_module = 'read_message.php';
         $del_img = CDOMElement::create('img', 'src:img/delete.png, name:del_icon');
         $del_img->setAttribute('alt', translateFN('Rimuovi il messaggio'));
         $del_text = translateFN('Cancella');
     } else {
         $list_module = 'list_events.php';
         $read_module = 'read_event.php';
         $del_text = '';
     }
     $order_by_author_link = CDOMElement::create('a', "href:{$list_module}?sort_field=id_mittente");
     $order_by_author_link->addChild(new CText(translateFN('Autore')));
     $order_by_time_link = CDOMElement::create('a', "href:{$list_module}?sort_field=data_ora");
     $order_by_time_link->addChild(new CText(translateFN('Data ed ora')));
     $order_by_subject_link = CDOMElement::create('a', "href:{$list_module}?sort_field=titolo");
     $order_by_subject_link->addChild(new CText(translateFN('Oggetto')));
     $order_by_priority_link = CDOMElement::create('a', "href:{$list_module}?sort_field=priorita");
     $order_by_priority_link->addChild(new CText(translateFN('Priorit&agrave;')));
     $thead_data = array($order_by_author_link, $order_by_time_link, $order_by_subject_link, $order_by_priority_link, $del_text, translateFN('Letto'), '');
     foreach ($data_Ar as $tester => $appointment_data_Ar) {
         //$udh = UserDataHandler::instance(self::getDSN($tester));
         //$tester_info_Ar = $common_dh->get_tester_info_from_pointer($tester);
         $tester_id = $testers_dataAr[$tester];
         //      if (AMA_Common_DataHandler::isError($tester_info_Ar)) {
         //        /*
         //         * Return a ADA_Error with delayed error handling.
         //         */
         //        return new ADA_Error($tester_info_Ar,translateFN('Errore in ottenimento informazioni tester'),
         //                              NULL,NULL,NULL,NULL,TRUE);
         //      }
         $tester_TimeZone = MultiPort::getTesterTimeZone($tester);
         $offset = get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
         foreach ($appointment_data_Ar as $appointment_id => $appointment_Ar) {
             // trasform message content into variable names
             $sender_id = $appointment_Ar[0];
             $date_time = $appointment_Ar[1];
             //$subject        = $appointment_Ar[2];
             /*
              * Check if the subject has an internal identifier and remove it.
              */
             //$subject        = preg_replace('/[0-9]+#/','',$appointment_Ar[2],1);
             $subject = ADAEventProposal::removeEventToken($appointment_Ar[2]);
             $priority = $appointment_Ar[3];
             $read_timestamp = $appointment_Ar[4];
             $date_time_zone = $date_time + $offset;
             $zone = translateFN("Time zone:") . " " . $tester_TimeZone;
             $data_msg = AMA_DataHandler::ts_to_date($date_time_zone, "%d/%m/%Y - %H:%M:%S") . " " . $zone;
             //        $data_msg        = AMA_DataHandler::ts_to_date($date_time, "%d/%m/%Y - %H:%M:%S");
             // transform sender's id into sender's name
             //        $res_ar = $udh->find_users_list(array("username"), "id_utente=$sender_id");
             //        if (AMA_DataHandler::isError($res_ar)) {
             //          $sender_username = '';
             //        }
             //        else {
             //          $sender_username = $res_ar[0][1];
             //        }
             $sender_username = $appointment_Ar[6];
             //$msg_id = $tester_info_Ar[0].'_'.$appointment_id;
             $msg_id = $tester_id . '_' . $appointment_id;
             $url = HTTP_ROOT_DIR . '/comunica/' . $read_module . '?msg_id=' . $msg_id;
             $subject_link = CDOMElement::create('a', "href:{$url}");
             $subject_link->addChild(new CText($subject));
             /*
              * If this is a list of simple messages, then deleting is allowed.
              * Otherwise it is disabled.
              */
             if ($message_type == ADA_MSG_SIMPLE) {
                 $delete = CDOMElement::create('checkbox', "name:form[del][{$msg_id}],value:{$msg_id}");
                 $action_link = CDOMElement::create('a', "href:{$list_module}?del_msg_id={$msg_id}");
                 $action_link->addChild($del_img);
             } else {
                 $delete = '';
                 $delete_link = '';
                 // PROVA, POI RIMETTERE A POSTO
                 $userObj = $_SESSION['sess_userObj'];
                 /*
                           if($userObj instanceof ADAPractitioner) {
                  $event_token = ADAEventProposal::extractEventToken($appointment_Ar[2]);
                  $href = HTTP_ROOT_DIR . '/tutor/eguidance_tutor_form.php?event_token=' . $event_token;
                  $action_link = CDOMElement::create('a', "href:$href");
                  $action_link->addChild(new CText(translateFN('View eguidance session data')));
                           }
                 *
                 */
             }
             $read = CDOMElement::create('checkbox', "name:form[read][{$msg_id}],value:{$msg_id}");
             if ($read_timestamp != 0) {
                 $read->setAttribute('checked', 'checked');
             }
             if (!isset($action_link)) {
                 $action_link = null;
             }
             $appointments_Ar[] = array($sender_username, $data_msg, $subject_link, $priority, $delete, $read, $action_link);
         }
     }
     if (count($appointments_Ar) > 0) {
         $table = BaseHtmlLib::tableElement('', $thead_data, $appointments_Ar);
         if (!isset($module)) {
             $module = null;
         }
         $form = CDOMElement::create('form', "name:form, method:post, action:{$module}");
         $form->addChild($table);
         $div = CDOMElement::create('div', 'id:buttons');
         $submit = CDOMElement::create('submit', 'name:btn_commit value:' . translateFN('Salva'));
         $reset = CDOMElement::create('reset', 'name:btn_reset value:' . translateFN('Ripristina'));
         $div->addChild($submit);
         $div->addChild($reset);
         $form->addChild($div);
         return $form;
     } else {
         if ($message_type == ADA_MSG_SIMPLE) {
             return new CText(translateFN('Non ci sono nuovi messaggi'));
         }
         return new CText(translateFN('Non ci sono nuovi appuntamenti'));
     }
 }
Exemplo n.º 13
0
    case 'summary':
        $field_list_ar = array('id_nodo', 'data_visita');
        $clause = "";
        $dataHa = $dh->_find_ex_history_list($field_list_ar, $clause);
        if (AMA_DataHandler::isError($dataHa)) {
            $msg = $dataHa->getMessage();
            print $msg;
            //header("Location: $error?err_msg=$msg");
            //exit;
        }
        $total_visits = 0;
        $exercise_dataHa = array();
        foreach ($dataHa as $exercise) {
            $id_node = $exercise[1];
            $data = $exercise[2];
            $row = array(translateFN('Nodo') => "<a href=\"tutor_report.php?mode=zoom&id_node={$id_node}\">{$id_node} : {$nome} </a>", translateFN('Data') => AMA_DataHandler::ts_to_date($data));
            array_push($exercise_dataHa, $row);
        }
        $tObj = new Table();
        $tObj->initTable('0', 'right', '1', '0', '90%', '', '', '', '', '1', '0');
        // Syntax: $border,$align,$cellspacing,$cellpadding,$width,$col1, $bcol1,$col2, $bcol2
        $caption = translateFN("Esercizi eseguiti fino al {$ymdhms}");
        $summary = translateFN("Elenco degli esercizi eseguiti");
        $tObj->setTable($exercise_dataHa, $caption, $summary);
        $tabled_exercise_dataHa = $tObj->getTable();
}
$banner = (include ROOT_DIR . '/include/banner.inc.php');
$help = translateFN('Da qui il Tutor può visualizzare il report.');
$status = translateFN('Visualizzazione del report');
$title = translateFN('ADA - Report del tutor');
$content_dataAr = array('banner' => $banner, 'data' => $tabled_exercise_dataHa, 'help' => $help, 'status' => $status, 'user_name' => $user_name, 'user_type' => $user_type, 'messages' => $user_messages->getHtml(), 'agenda' => $user_agenda->getHtml());
Exemplo n.º 14
0
 $courses_student = get_student_coursesFN($id_instance, $id_course, '', $type == 'xls' ? 'HTML' : 'FILE');
 // build the caption
 // 0. Get title course
 $info_course = $dh->get_course($id_course);
 if (AMA_DB::isError($info_course)) {
     $course_title = '';
 } else {
     $course_title = $info_course['titolo'];
 }
 // 1. Get the instance courses data
 $instance_course_ha = $dh->course_instance_get($id_instance);
 if (AMA_DB::isError($instance_course_ha)) {
     $start_date = '';
     $instance_title = '';
 } else {
     $start_date = AMA_DataHandler::ts_to_date($instance_course_ha['data_inizio'], ADA_DATE_FORMAT);
     $instance_title = $instance_course_ha['title'];
 }
 $caption = translateFN("Studenti del corso") . " <strong>{$course_title}</strong>  - " . translateFN("Classe") . " " . $instance_title . " (" . $id_instance . ") - " . translateFN("Iniziato il ") . "&nbsp;<strong>{$start_date}</strong>";
 // build up filename to be streamed out
 $filename = 'course_' . $id_course . '_class_' . $id_instance . '.' . $type;
 if ($type === 'pdf') {
     require_once ROOT_DIR . '/include/PdfClass.inc.php';
     $pdf = new PdfClass('landscape', strip_tags(html_entity_decode($courses_student['caption'])));
     $pdf->addHeader(strip_tags(html_entity_decode($caption)), ROOT_DIR . '/layout/' . $userObj->template_family . '/img/header-logo.png', 14)->addFooter(translateFN("Report") . " " . translateFN("generato") . " " . translateFN("il") . " " . date("d/m/Y") . " " . translateFN("alle") . " " . date("H:i:s"));
     // prepare header row
     foreach ($courses_student[0] as $key => $val) {
         // skip level up and down images, cannot be done in config file
         // because it would remove cols from html too, and this is not good
         if (preg_match('/img/', $val) !== 0) {
             continue;
Exemplo n.º 15
0
 /**
  * function that return list of history test sent test or survey by student
  *
  * @global db $dh
  *
  * @param boolean $student if true switch scope from tutor to student
  *
  * @return array an array composed of 'html', 'path' and 'title' keys
  */
 protected function list_history_tests($student = false)
 {
     $dh = $GLOBALS['dh'];
     $historyTest = $dh->test_getHistoryTestJoined(array('id_nodo' => $this->test['id_nodo'], 'id_corso' => $this->courseObj->id, 'id_istanza_corso' => $this->course_instanceObj->id), $this->tipo);
     if ($dh->isError($historyTest)) {
         $this->returnError = true;
         return;
     }
     $thead = array(sprintf(translateFN('%s Id'), $this->singolare), translateFN('Titolo'), translateFN('Punteggio'), translateFN('Punteggio Barriera'), translateFN('Consegnato'), translateFN('Tempo scaduto'), translateFN('Ripetibile'), translateFN('Data inizio'), translateFN('Data fine'), translateFN('Visualizza'));
     $tbody = array();
     if (!empty($historyTest)) {
         foreach ($historyTest as $k => $r) {
             $id_student = $r['id_utente'];
             $tbody[$k][] = $k + 1;
             $tbody[$k][] = $r['titolo'];
             $tbody[$k][] = $r['punteggio_realizzato'];
             $tbody[$k][] = $r['punteggio_minimo_barriera'];
             $tbody[$k][] = $r['consegnato'] ? translateFN('Si') : translateFN('No');
             $tbody[$k][] = $r['tempo_scaduto'] ? translateFN('Si') : translateFN('No');
             $tbody[$k][] = $r['ripetibile'] ? translateFN('Si') : translateFN('No');
             $tbody[$k][] = AMA_DataHandler::ts_to_date($r['data_inizio'], "%d/%m/%Y %H:%M:%S");
             $tbody[$k][] = $r['data_fine'] > 0 ? AMA_DataHandler::ts_to_date($r['data_fine'], "%d/%m/%Y %H:%M:%S") : '---';
             $tbody[$k][] = '<a href="' . $this->filepath . '?op=' . $this->what . '&id_course=' . $r['id_corso'] . '&id_course_instance=' . $r['id_istanza_corso'] . '&id_student=' . $r['id_utente'] . '&id_test=' . $r['id_nodo'] . '&id_history_test=' . $r['id_history_test'] . '"><img src="img/magnify.png" /></a>';
         }
         $caption = sprintf(translateFN('Tentativi effettuati dallo studente %s %s per il %s "%s"'), $this->student['cognome'], $this->student['nome'], $this->singolare, $this->test['titolo']);
         $table = BaseHtmlLib::tableElement('', $thead, $tbody, $thead, $caption);
         $html = $table->getHtml();
     } else {
         if ($student) {
             $html = sprintf(translateFN('Non hai effettuato nessun %s'), $this->singolare);
         } else {
             $html = sprintf(translateFN('Lo studente selezionato non ha effettuato nessun %s'), $this->singolare);
         }
     }
     $path = '<a href="' . $this->filepath . '?op=' . $this->what . '&id_course_instance=' . $this->course_instanceObj->id . '&id_course=' . $this->courseObj->id . '">' . translateFN('Valutazione') . ' ' . ucfirst($this->plurale) . '</a> &gt; <a href="' . $this->filepath . '?op=' . $this->what . '&id_course_instance=' . $this->course_instanceObj->id . '&id_course=' . $this->courseObj->id . '&id_student=' . $id_student . '">' . $this->student['cognome'] . ' ' . $this->student['nome'] . '</a> &gt; ' . $this->test['titolo'];
     return array('html' => $html, 'path' => $path, 'title' => translateFN('Valutazione') . ' ' . ucfirst($this->plurale));
 }