Exemplo n.º 1
0
 function prepare($course_id, $user_id = 0, $quiz_id)
 {
     require_once _JOOMLMS_FRONT_HOME . "/includes/libraries/lms.lib.reporting.php";
     $attempts = JLMS_quiz_reporting::attempts($course_id, $user_id, $quiz_id);
     for ($i = 0; $i < count($attempts); $i++) {
         $attempts[$i]->questions = JLMS_quiz_reporting::questions($course_id, $attempts[$i]->c_id);
         for ($j = 0; $j < count($attempts[$i]->questions); $j++) {
             $attempts[$i]->questions[$j]->question_information = array();
             if (isset($attempts[$i]->questions[$j]->c_id)) {
                 $question = $attempts[$i]->questions[$j];
                 if ($question->c_id) {
                     $attempts[$i]->questions[$j]->question_information = JLMS_quiz_reporting::question($course_id, $question->c_id);
                 }
             }
         }
     }
     $title_report = 'quiz_reports';
     $title_report = str_replace('_', ' ', $title_report);
     $title_report = ucwords($title_report);
     $html = JLMS_quiz_reporting::generate_html($attempts, $title_report);
     if ($html) {
         JLMS_reporting::outputXLS($html, $title_report);
     }
 }
Exemplo n.º 2
0
 function exportXLS($results, $reporting_header, $tmpl_name, $prefix_title)
 {
     global $JLMS_DB, $JLMS_CONFIG, $JLMS_CONFIG;
     $text_to_xls = JLMS_reporting::generationHTML($results, $reporting_header, $tmpl_name, $prefix_title);
     $prefix_title = str_replace(' ', '_', $prefix_title);
     if (strlen($text_to_xls)) {
         JLMS_reporting::outputXLS($text_to_xls, $prefix_title);
     }
 }