|
|
|
@ -57,11 +57,6 @@ $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION); |
|
|
|
|
$TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); |
|
|
|
|
$TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); |
|
|
|
|
|
|
|
|
|
// General parameters passed via POST/GET |
|
|
|
|
if ($debug) { |
|
|
|
|
error_log('Entered exercise_result.php: '.print_r($_POST, 1)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (empty($formSent)) { |
|
|
|
|
$formSent = isset($_REQUEST['formSent']) ? $_REQUEST['formSent'] : null; |
|
|
|
|
} |
|
|
|
@ -171,15 +166,24 @@ if ($allowRecordAudio && $allowTeacherCommentAudio) { |
|
|
|
|
|
|
|
|
|
$scoreJsCode = ExerciseLib::getJsCode(); |
|
|
|
|
|
|
|
|
|
if ($origin != 'learnpath') { |
|
|
|
|
Display::display_header(''); |
|
|
|
|
} else { |
|
|
|
|
$htmlHeadXtra[] = " |
|
|
|
|
if ($action != 'export') { |
|
|
|
|
if ($origin != 'learnpath') { |
|
|
|
|
Display::display_header(''); |
|
|
|
|
} else { |
|
|
|
|
$htmlHeadXtra[] = " |
|
|
|
|
<style> |
|
|
|
|
body { background: none;} |
|
|
|
|
</style> |
|
|
|
|
"; |
|
|
|
|
Display::display_reduced_header(); |
|
|
|
|
Display::display_reduced_header(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo Display::toolbarAction('toolbar', [ |
|
|
|
|
Display::url( |
|
|
|
|
Display::return_icon('pdf.png', get_lang('Export')), |
|
|
|
|
api_get_self().'?'.api_get_cidreq().'&id='.$id.'&action=export&' |
|
|
|
|
) |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
?> |
|
|
|
|
<script> |
|
|
|
@ -285,9 +289,13 @@ if ($is_allowedToEdit && in_array($action, ['qualify', 'edit'])) { |
|
|
|
|
$show_results = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($action == 'export') { |
|
|
|
|
ob_start(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$user_info = api_get_user_info($student_id); |
|
|
|
|
if ($show_results || $show_only_total_score || $showTotalScoreAndUserChoicesInLastAttempt) { |
|
|
|
|
$user_info = api_get_user_info($student_id); |
|
|
|
|
//Shows exercise header |
|
|
|
|
// Shows exercise header |
|
|
|
|
echo $objExercise->show_exercise_result_header( |
|
|
|
|
$user_info, |
|
|
|
|
api_convert_and_format_date($exercise_date), |
|
|
|
@ -702,7 +710,7 @@ foreach ($questionList as $questionId) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$marksname = ''; |
|
|
|
|
if ($isFeedbackAllowed) { |
|
|
|
|
if ($isFeedbackAllowed && $action != 'export') { |
|
|
|
|
$name = "fckdiv".$questionId; |
|
|
|
|
$marksname = "marksName".$questionId; |
|
|
|
|
if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION, ANNOTATION))) { |
|
|
|
@ -763,6 +771,7 @@ foreach ($questionList as $questionId) { |
|
|
|
|
$feedback_form->setDefaults($default); |
|
|
|
|
$feedback_form->display(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
|
|
if ($allowRecordAudio && $allowTeacherCommentAudio) { |
|
|
|
@ -783,7 +792,7 @@ foreach ($questionList as $questionId) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($is_allowedToEdit && $isFeedbackAllowed) { |
|
|
|
|
if ($is_allowedToEdit && $isFeedbackAllowed && $action != 'export') { |
|
|
|
|
if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION, ANNOTATION))) { |
|
|
|
|
$marksname = "marksName".$questionId; |
|
|
|
|
$arrmarks[] = $questionId; |
|
|
|
@ -926,7 +935,7 @@ foreach ($questionList as $questionId) { |
|
|
|
|
$exercise_content .= Display::panel($question_content); |
|
|
|
|
} // end of large foreach on questions |
|
|
|
|
|
|
|
|
|
$total_score_text = null; |
|
|
|
|
$total_score_text = ''; |
|
|
|
|
|
|
|
|
|
//Total score |
|
|
|
|
if ($origin != 'learnpath' || ($origin == 'learnpath' && isset($_GET['fb_type']))) { |
|
|
|
@ -963,6 +972,27 @@ echo $total_score_text; |
|
|
|
|
echo $exercise_content; |
|
|
|
|
echo $total_score_text; |
|
|
|
|
|
|
|
|
|
if ($action == 'export') { |
|
|
|
|
$content = ob_get_clean(); |
|
|
|
|
$params = array( |
|
|
|
|
'filename' => api_replace_dangerous_char( |
|
|
|
|
$objExercise->name.' '. |
|
|
|
|
$user_info['complete_name'].' '. |
|
|
|
|
api_get_local_time() |
|
|
|
|
), |
|
|
|
|
'course_code' => api_get_course_id(), |
|
|
|
|
'session_info' => api_get_session_info(api_get_session_id()), |
|
|
|
|
'course_info' => '', |
|
|
|
|
'pdf_date' => '', |
|
|
|
|
'show_real_course_teachers' => false, |
|
|
|
|
'show_teacher_as_myself' => false, |
|
|
|
|
'orientation' => 'P' |
|
|
|
|
); |
|
|
|
|
$pdf = new PDF('A4', $params['orientation'], $params); |
|
|
|
|
$pdf->html_to_pdf_with_template($content, false, false, true); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($isFeedbackAllowed) { |
|
|
|
|
if (is_array($arrid) && is_array($arrmarks)) { |
|
|
|
|
$strids = implode(",", $arrid); |
|
|
|
|