Exercises: Add new tags link_to_test_result_page_* see BT#17788

((link_to_test_result_page_student))
((link_to_test_result_page_teacher))
pull/3766/head^2
Julio Montoya 5 years ago
parent e004f7eb2e
commit d4666a01b7
  1. 11
      main/inc/lib/exercise.lib.php

@ -5984,10 +5984,15 @@ EOT;
return $total; return $total;
} }
public static function parseContent($content, $stats, $exercise, $trackInfo, $currentUserId = 0) public static function parseContent($content, $stats, Exercise $exercise, $trackInfo, $currentUserId = 0)
{ {
$wrongAnswersCount = $stats['failed_answers_count']; $wrongAnswersCount = $stats['failed_answers_count'];
$attemptDate = substr($trackInfo['exe_date'], 0, 10); $attemptDate = substr($trackInfo['exe_date'], 0, 10);
$exerciseId = $exercise->iId;
$resultsStudentUrl = api_get_path(WEB_CODE_PATH).
'exercise/result.php?id='.$exerciseId.'&'.api_get_cidreq();
$resultsTeacherUrl = api_get_path(WEB_CODE_PATH).
'exercise/exercise_show.php?action=edit&id='.$exerciseId.'&'.api_get_cidreq();
$content = str_replace( $content = str_replace(
[ [
@ -5996,6 +6001,8 @@ EOT;
'((all_answers_teacher_html))', '((all_answers_teacher_html))',
'((exercise_title))', '((exercise_title))',
'((exercise_attempt_date))', '((exercise_attempt_date))',
'((link_to_test_result_page_student))',
'((link_to_test_result_page_teacher))',
], ],
[ [
$wrongAnswersCount, $wrongAnswersCount,
@ -6003,6 +6010,8 @@ EOT;
$stats['all_answers_teacher_html'], $stats['all_answers_teacher_html'],
$exercise->get_formated_title(), $exercise->get_formated_title(),
$attemptDate, $attemptDate,
$resultsStudentUrl,
$resultsTeacherUrl,
], ],
$content $content
); );

Loading…
Cancel
Save