|
|
|
|
@ -15,28 +15,26 @@ require_once __DIR__.'/../inc/global.inc.php'; |
|
|
|
|
|
|
|
|
|
$this_section = SECTION_COURSES; |
|
|
|
|
|
|
|
|
|
/* ACCESS RIGHTS */ |
|
|
|
|
// notice for unauthorized people. |
|
|
|
|
api_protect_course_script(true); |
|
|
|
|
$origin = api_get_origin(); |
|
|
|
|
|
|
|
|
|
if (empty($learnpath_id)) { |
|
|
|
|
if (!empty($_REQUEST['learnpath_id'])) { |
|
|
|
|
$learnpath_id = intval($_REQUEST['learnpath_id']); |
|
|
|
|
$learnpath_id = (int) $_REQUEST['learnpath_id']; |
|
|
|
|
} else { |
|
|
|
|
$learnpath_id = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (empty($learnpath_item_id)) { |
|
|
|
|
if (!empty($_REQUEST['learnpath_item_id'])) { |
|
|
|
|
$learnpath_item_id = intval($_REQUEST['learnpath_item_id']); |
|
|
|
|
$learnpath_item_id = (int) $_REQUEST['learnpath_item_id']; |
|
|
|
|
} else { |
|
|
|
|
$learnpath_item_id = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (empty($learnpath_item_view_id)) { |
|
|
|
|
if (!empty($_REQUEST['learnpath_item_view_id'])) { |
|
|
|
|
$learnpath_item_view_id = intval($_REQUEST['learnpath_item_view_id']); |
|
|
|
|
$learnpath_item_view_id = (int) $_REQUEST['learnpath_item_view_id']; |
|
|
|
|
} else { |
|
|
|
|
$learnpath_item_view_id = 0; |
|
|
|
|
} |
|
|
|
|
@ -44,7 +42,7 @@ if (empty($learnpath_item_view_id)) { |
|
|
|
|
|
|
|
|
|
if (empty($exerciseId)) { |
|
|
|
|
if (!empty($_REQUEST['exerciseId'])) { |
|
|
|
|
$exerciseId = intval($_REQUEST['exerciseId']); |
|
|
|
|
$exerciseId = (int) $_REQUEST['exerciseId']; |
|
|
|
|
} else { |
|
|
|
|
$exerciseId = 0; |
|
|
|
|
} |
|
|
|
|
@ -60,9 +58,9 @@ if (empty($objExercise)) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!$objExercise) { |
|
|
|
|
//Redirect to the exercise overview |
|
|
|
|
//Check if the exe_id exists |
|
|
|
|
header("Location: overview.php?exerciseId=".$exerciseId.'&'.api_get_cidreq()); |
|
|
|
|
// Redirect to the exercise overview |
|
|
|
|
// Check if the exe_id exists |
|
|
|
|
header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/overview.php?exerciseId='.$exerciseId.'&'.api_get_cidreq()); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -106,7 +104,7 @@ if (empty($exercise_stat_info) || empty($question_list)) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$nameTools = get_lang('Exercises'); |
|
|
|
|
$interbreadcrumb[] = ["url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')]; |
|
|
|
|
$interbreadcrumb[] = ['url' => 'exercise.php?'.api_get_cidreq(), 'name' => get_lang('Exercises')]; |
|
|
|
|
|
|
|
|
|
$hideHeaderAndFooter = in_array($origin, ['learnpath', 'embeddable']); |
|
|
|
|
|
|
|
|
|
@ -140,7 +138,7 @@ echo '<script> |
|
|
|
|
|
|
|
|
|
function final_submit() { |
|
|
|
|
//Normal inputs |
|
|
|
|
window.location = "exercise_result.php?'.api_get_cidreq().'&exe_id='.$exe_id.'&" + lp_data; |
|
|
|
|
window.location = "'.api_get_path(WEB_CODE_PATH).'exercise/exercise_result.php?'.api_get_cidreq().'&exe_id='.$exe_id.'&" + lp_data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function changeOptionStatus(status) |
|
|
|
|
@ -222,8 +220,8 @@ echo '<div class="clear"></div><br />'; |
|
|
|
|
|
|
|
|
|
$table = ''; |
|
|
|
|
$counter = 0; |
|
|
|
|
// Loop over all question to show results for each of them, one by one |
|
|
|
|
|
|
|
|
|
// Loop over all question to show results for each of them, one by one |
|
|
|
|
foreach ($question_list as $questionId) { |
|
|
|
|
// destruction of the Question object |
|
|
|
|
unset($objQuestionTmp); |
|
|
|
|
@ -242,13 +240,13 @@ foreach ($question_list as $questionId) { |
|
|
|
|
$url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1&'.api_get_cidreq(); |
|
|
|
|
|
|
|
|
|
$counter++; |
|
|
|
|
$question_title = $counter.'. '.strip_tags($objQuestionTmp->selectTitle()); |
|
|
|
|
//Check if the question doesn't have an answer |
|
|
|
|
$questionTitle = $counter.'. '.strip_tags($objQuestionTmp->selectTitle()); |
|
|
|
|
// Check if the question doesn't have an answer |
|
|
|
|
if (!in_array($questionId, $exercise_result)) { |
|
|
|
|
$question_title = Display::label($question_title, 'warning'); |
|
|
|
|
$questionTitle = Display::label($questionTitle, 'warning'); |
|
|
|
|
} |
|
|
|
|
$question_title = Display::tag('label', $checkbox.$question_title, $label_attributes); |
|
|
|
|
$table .= Display::div($question_title, ['class' => 'exercise_reminder_item checkbox']); |
|
|
|
|
$questionTitle = Display::tag('label', $checkbox.$questionTitle, $label_attributes); |
|
|
|
|
$table .= Display::div($questionTitle, ['class' => 'exercise_reminder_item checkbox']); |
|
|
|
|
} // end foreach() block that loops over all questions |
|
|
|
|
|
|
|
|
|
echo Display::div($table, ['class' => 'question-check-test']); |
|
|
|
|
|