|
@@ -29,7 +29,7 @@ discard block |
|
|
block discarded – undo |
|
29
|
29
|
use ChamiloSession as Session; |
|
30
|
30
|
|
|
31
|
31
|
require_once '../inc/global.inc.php'; |
|
32
|
|
-$current_course_tool = TOOL_QUIZ; |
|
|
32
|
+$current_course_tool = TOOL_QUIZ; |
|
33
|
33
|
$this_section = SECTION_COURSES; |
|
34
|
34
|
$debug = false; |
|
35
|
35
|
|
|
@@ -38,7 +38,7 @@ discard block |
|
|
block discarded – undo |
|
38
|
38
|
|
|
39
|
39
|
$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : ''; |
|
40
|
40
|
|
|
41
|
|
-$is_allowedToEdit = api_is_allowed_to_edit(null,true); |
|
|
41
|
+$is_allowedToEdit = api_is_allowed_to_edit(null, true); |
|
42
|
42
|
$glossaryExtraTools = api_get_setting('show_glossary_in_extra_tools'); |
|
43
|
43
|
|
|
44
|
44
|
$showGlossary = in_array($glossaryExtraTools, array('true', 'exercise', 'exercise_and_lp')); |
|
@@ -60,8 +60,8 @@ discard block |
|
|
block discarded – undo |
|
60
|
60
|
$htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.dateformat.min.js'); |
|
61
|
61
|
$htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.epiclock.min.js'); |
|
62
|
62
|
$htmlHeadXtra[] = api_get_js('epiclock/renderers/minute/epiclock.minute.js'); |
|
63
|
|
-$htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">'; |
|
64
|
|
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/js/hotspot.js"></script>'; |
|
|
63
|
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/css/hotspot.css">'; |
|
|
64
|
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/js/hotspot.js"></script>'; |
|
65
|
65
|
|
|
66
|
66
|
$template = new Template(); |
|
67
|
67
|
|
|
@@ -69,7 +69,7 @@ discard block |
|
|
block discarded – undo |
|
69
|
69
|
|
|
70
|
70
|
$learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpath_id']) : 0; |
|
71
|
71
|
$learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : 0; |
|
72
|
|
-$learnpath_item_view_id = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : 0; |
|
|
72
|
+$learnpath_item_view_id = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : 0; |
|
73
|
73
|
|
|
74
|
74
|
$reminder = isset($_REQUEST['reminder']) ? intval($_REQUEST['reminder']) : 0; |
|
75
|
75
|
$remind_question_id = isset($_REQUEST['remind_question_id']) ? intval($_REQUEST['remind_question_id']) : 0; |
|
@@ -95,7 +95,7 @@ discard block |
|
|
block discarded – undo |
|
95
|
95
|
/* Teacher takes an exam and want to see a preview, |
|
96
|
96
|
we delete the objExercise from the session in order to get the latest |
|
97
|
97
|
changes in the exercise */ |
|
98
|
|
-if (api_is_allowed_to_edit(null, true) && isset($_GET['preview']) && $_GET['preview'] == 1 ) { |
|
|
98
|
+if (api_is_allowed_to_edit(null, true) && isset($_GET['preview']) && $_GET['preview'] == 1) { |
|
99
|
99
|
Session::erase('objExercise'); |
|
100
|
100
|
} |
|
101
|
101
|
|
|
@@ -164,7 +164,7 @@ discard block |
|
|
block discarded – undo |
|
164
|
164
|
|
|
165
|
165
|
if ($time_control) { |
|
166
|
166
|
// Get the expired time of the current exercise in track_e_exercises |
|
167
|
|
- $total_seconds = $objExercise->expired_time*60; |
|
|
167
|
+ $total_seconds = $objExercise->expired_time * 60; |
|
168
|
168
|
} |
|
169
|
169
|
|
|
170
|
170
|
$show_clock = true; |
|
@@ -181,7 +181,7 @@ discard block |
|
|
block discarded – undo |
|
181
|
181
|
|
|
182
|
182
|
if ($attempt_count >= $objExercise->selectAttempts()) { |
|
183
|
183
|
$show_clock = false; |
|
184
|
|
- if (!api_is_allowed_to_edit(null,true)) { |
|
|
184
|
+ if (!api_is_allowed_to_edit(null, true)) { |
|
185
|
185
|
if ($objExercise->results_disabled == 0 && $origin != 'learnpath') { |
|
186
|
186
|
|
|
187
|
187
|
// Showing latest attempt according with task BT#1628 |
|
@@ -211,7 +211,7 @@ discard block |
|
|
block discarded – undo |
|
211
|
211
|
); |
|
212
|
212
|
|
|
213
|
213
|
if (!empty($last_attempt_info['question_list'])) { |
|
214
|
|
- foreach($last_attempt_info['question_list'] as $question_data) { |
|
|
214
|
+ foreach ($last_attempt_info['question_list'] as $question_data) { |
|
215
|
215
|
$question_id = $question_data['question_id']; |
|
216
|
216
|
$marks = $question_data['marks']; |
|
217
|
217
|
|
|
@@ -220,7 +220,7 @@ discard block |
|
|
block discarded – undo |
|
220
|
220
|
$attempt_html .= Display::div(get_lang('Score').' '.$marks, array('id'=>'question_question_titlescore')); |
|
221
|
221
|
} |
|
222
|
222
|
} |
|
223
|
|
- $score = ExerciseLib::show_score($last_attempt_info['exe_result'], $last_attempt_info['exe_weighting']); |
|
|
223
|
+ $score = ExerciseLib::show_score($last_attempt_info['exe_result'], $last_attempt_info['exe_weighting']); |
|
224
|
224
|
$attempt_html .= Display::div(get_lang('YourTotalScore').' '.$score, array('id'=>'question_score')); |
|
225
|
225
|
} else { |
|
226
|
226
|
$attempt_html .= Display::return_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), 'warning', false); |
|
@@ -235,7 +235,7 @@ discard block |
|
|
block discarded – undo |
|
235
|
235
|
if ($origin == 'learnpath') { |
|
236
|
236
|
Display :: display_reduced_header(); |
|
237
|
237
|
} else { |
|
238
|
|
- Display :: display_header($nameTools,'Exercises'); |
|
|
238
|
+ Display :: display_header($nameTools, 'Exercises'); |
|
239
|
239
|
} |
|
240
|
240
|
|
|
241
|
241
|
echo $attempt_html; |
|
@@ -274,12 +274,12 @@ discard block |
|
|
block discarded – undo |
|
274
|
274
|
if ($debug) error_log('5.1. $current_timestamp '.$current_timestamp); |
|
275
|
275
|
if ($debug) error_log('5.2. $expected_time '.$expected_time); |
|
276
|
276
|
|
|
277
|
|
- $clock_expired_time = api_get_utc_datetime($expected_time); |
|
|
277
|
+ $clock_expired_time = api_get_utc_datetime($expected_time); |
|
278
|
278
|
if ($debug) error_log('5.3. $expected_time '.$clock_expired_time); |
|
279
|
279
|
|
|
280
|
280
|
//Sessions that contain the expired time |
|
281
|
|
- $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
|
282
|
|
- if ($debug) { error_log('5.4. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); }; |
|
|
281
|
+ $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
|
|
282
|
+ if ($debug) { error_log('5.4. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key]); }; |
|
283
|
283
|
} |
|
284
|
284
|
|
|
285
|
285
|
$exe_id = $objExercise->save_stat_track_exercise_info( |
|
@@ -364,22 +364,22 @@ discard block |
|
|
block discarded – undo |
|
364
|
364
|
the track_et_attempt see #2069 */ |
|
365
|
365
|
if (empty($last_attempt_date)) { |
|
366
|
366
|
$diff = $current_timestamp - api_strtotime($exercise_stat_info['start_date'], 'UTC'); |
|
367
|
|
- $last_attempt_date = api_get_utc_datetime(api_strtotime($exercise_stat_info['start_date'],'UTC') + $diff); |
|
|
367
|
+ $last_attempt_date = api_get_utc_datetime(api_strtotime($exercise_stat_info['start_date'], 'UTC') + $diff); |
|
368
|
368
|
} else { |
|
369
|
369
|
//Recalculate the time control due #2069 |
|
370
|
|
- $diff = $current_timestamp - api_strtotime($last_attempt_date,'UTC'); |
|
371
|
|
- $last_attempt_date = api_get_utc_datetime(api_strtotime($last_attempt_date,'UTC') + $diff); |
|
|
370
|
+ $diff = $current_timestamp - api_strtotime($last_attempt_date, 'UTC'); |
|
|
371
|
+ $last_attempt_date = api_get_utc_datetime(api_strtotime($last_attempt_date, 'UTC') + $diff); |
|
372
|
372
|
} |
|
373
|
373
|
if ($debug) {error_log('7.6. $last_attempt_date: '.$last_attempt_date); } |
|
374
|
374
|
|
|
375
|
375
|
//New expired time - it is due to the possible closure of session |
|
376
|
|
- $new_expired_time_in_seconds = api_strtotime($expired_time_of_this_attempt, 'UTC') - api_strtotime($last_attempt_date,'UTC'); |
|
|
376
|
+ $new_expired_time_in_seconds = api_strtotime($expired_time_of_this_attempt, 'UTC') - api_strtotime($last_attempt_date, 'UTC'); |
|
377
|
377
|
if ($debug) {error_log('7.7. $new_expired_time_in_seconds: '.$new_expired_time_in_seconds); } |
|
378
|
378
|
|
|
379
|
|
- $expected_time = $current_timestamp + $new_expired_time_in_seconds; |
|
|
379
|
+ $expected_time = $current_timestamp + $new_expired_time_in_seconds; |
|
380
|
380
|
if ($debug) {error_log('7.8. $expected_time1: '.$expected_time); } |
|
381
|
381
|
|
|
382
|
|
- $clock_expired_time = api_get_utc_datetime($expected_time); |
|
|
382
|
+ $clock_expired_time = api_get_utc_datetime($expected_time); |
|
383
|
383
|
if ($debug) {error_log('7.9. $clock_expired_time: '.$clock_expired_time); } |
|
384
|
384
|
|
|
385
|
385
|
// First we update the attempt to today |
|
@@ -395,17 +395,17 @@ discard block |
|
|
block discarded – undo |
|
395
|
395
|
|
|
396
|
396
|
//Sessions that contain the expired time |
|
397
|
397
|
$_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
|
398
|
|
- if ($debug) {error_log('7.11. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); }; |
|
|
398
|
+ if ($debug) {error_log('7.11. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key]); }; |
|
399
|
399
|
} |
|
400
|
400
|
} else { |
|
401
|
|
- $clock_expired_time = $_SESSION['expired_time'][$current_expired_time_key]; |
|
|
401
|
+ $clock_expired_time = $_SESSION['expired_time'][$current_expired_time_key]; |
|
402
|
402
|
} |
|
403
|
403
|
} else { |
|
404
|
404
|
if ($debug) { error_log("7 No time control"); }; |
|
405
|
405
|
} |
|
406
|
406
|
|
|
407
|
407
|
// Get time left for expiring time |
|
408
|
|
-$time_left = api_strtotime($clock_expired_time,'UTC') - time(); |
|
|
408
|
+$time_left = api_strtotime($clock_expired_time, 'UTC') - time(); |
|
409
|
409
|
|
|
410
|
410
|
/* |
|
411
|
411
|
* The time control feature is enable here - this feature is enable for a jquery plugin called epiclock |
|
@@ -455,7 +455,7 @@ discard block |
|
|
block discarded – undo |
|
455
|
455
|
|
|
456
|
456
|
//Only for hotspot |
|
457
|
457
|
if (!isset($choice) && isset($_REQUEST['hidden_hotspot_id'])) { |
|
458
|
|
- $hotspot_id = (int)($_REQUEST['hidden_hotspot_id']); |
|
|
458
|
+ $hotspot_id = (int) ($_REQUEST['hidden_hotspot_id']); |
|
459
|
459
|
$choice = array($hotspot_id => ''); |
|
460
|
460
|
} |
|
461
|
461
|
|
|
@@ -483,12 +483,12 @@ discard block |
|
|
block discarded – undo |
|
483
|
483
|
//saving each question |
|
484
|
484
|
if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) { |
|
485
|
485
|
$nro_question = $current_question; // - 1; |
|
486
|
|
- $questionId = $key; |
|
|
486
|
+ $questionId = $key; |
|
487
|
487
|
// gets the student choice for this question |
|
488
|
488
|
$choice = $exerciseResult[$questionId]; |
|
489
|
489
|
if (isset($exe_id)) { |
|
490
|
490
|
// Manage the question and answer attempts |
|
491
|
|
- if ($debug) { error_log('8.3. manage_answer exe_id: '.$exe_id.' - $questionId: '.$questionId.' Choice'.print_r($choice,1)); } |
|
|
491
|
+ if ($debug) { error_log('8.3. manage_answer exe_id: '.$exe_id.' - $questionId: '.$questionId.' Choice'.print_r($choice, 1)); } |
|
492
|
492
|
$objExercise->manage_answer( |
|
493
|
493
|
$exe_id, |
|
494
|
494
|
$questionId, |
|
@@ -507,13 +507,13 @@ discard block |
|
|
block discarded – undo |
|
507
|
507
|
} |
|
508
|
508
|
} |
|
509
|
509
|
if ($debug) { error_log('9.3. $choice is an array - end'); } |
|
510
|
|
- if ($debug) { error_log('9.4. $exerciseResult '.print_r($exerciseResult,1)); } |
|
|
510
|
+ if ($debug) { error_log('9.4. $exerciseResult '.print_r($exerciseResult, 1)); } |
|
511
|
511
|
} |
|
512
|
512
|
|
|
513
|
513
|
// the script "exercise_result.php" will take the variable $exerciseResult from the session |
|
514
|
514
|
Session::write('exerciseResult', $exerciseResult); |
|
515
|
515
|
Session::write('remind_list', $remind_list); |
|
516
|
|
- Session::write('exerciseResultCoordinates',$exerciseResultCoordinates); |
|
|
516
|
+ Session::write('exerciseResultCoordinates', $exerciseResultCoordinates); |
|
517
|
517
|
|
|
518
|
518
|
// if all questions on one page OR if it is the last question (only for an exercise with one question per page) |
|
519
|
519
|
if ($objExercise->type == ALL_ON_ONE_PAGE || $current_question >= $question_count) { |
|
@@ -636,15 +636,15 @@ discard block |
|
|
block discarded – undo |
|
636
|
636
|
} |
|
637
|
637
|
|
|
638
|
638
|
if (!empty ($gradebook) && $gradebook == 'view') { |
|
639
|
|
- $interbreadcrumb[] = array ('url' => '../gradebook/' . Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook')); |
|
|
639
|
+ $interbreadcrumb[] = array('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('ToolGradebook')); |
|
640
|
640
|
} |
|
641
|
641
|
|
|
642
|
|
-$interbreadcrumb[] = array ("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')); |
|
643
|
|
-$interbreadcrumb[] = array ("url" => "#", "name" => $objExercise->name); |
|
|
642
|
+$interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')); |
|
|
643
|
+$interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name); |
|
644
|
644
|
|
|
645
|
645
|
if ($origin != 'learnpath') { //so we are not in learnpath tool |
|
646
|
|
- Display :: display_header(null,'Exercises'); |
|
647
|
|
- if (!api_is_allowed_to_session_edit() ) { |
|
|
646
|
+ Display :: display_header(null, 'Exercises'); |
|
|
647
|
+ if (!api_is_allowed_to_session_edit()) { |
|
648
|
648
|
Display :: display_warning_message(get_lang('SessionIsReadOnly')); |
|
649
|
649
|
} |
|
650
|
650
|
} else { |
|
@@ -658,9 +658,9 @@ discard block |
|
|
block discarded – undo |
|
658
|
658
|
if (api_is_course_admin() && $origin != 'learnpath') { |
|
659
|
659
|
echo '<div class="actions">'; |
|
660
|
660
|
if ($show_quiz_edition == false) { |
|
661
|
|
- echo '<a href="exercise_admin.php?' . api_get_cidreq() . '&modifyExercise=yes&exerciseId=' . $objExercise->id . '">'.Display :: return_icon('settings.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
|
661
|
+ echo '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'.Display :: return_icon('settings.png', get_lang('ModifyExercise'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
662
|
662
|
} else { |
|
663
|
|
- echo '<a href="#">'.Display::return_icon('settings_na.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
|
663
|
+ echo '<a href="#">'.Display::return_icon('settings_na.png', get_lang('ModifyExercise'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
664
|
664
|
} |
|
665
|
665
|
echo '</div>'; |
|
666
|
666
|
} |
|
@@ -699,7 +699,7 @@ discard block |
|
|
block discarded – undo |
|
699
|
699
|
} |
|
700
|
700
|
|
|
701
|
701
|
if (!$permission_to_start || $exercise_timeover) { |
|
702
|
|
- if (!api_is_allowed_to_edit(null,true)) { |
|
|
702
|
+ if (!api_is_allowed_to_edit(null, true)) { |
|
703
|
703
|
$message_warning = $permission_to_start ? get_lang('ReachedTimeLimit') : get_lang('ExerciseNoStartedYet'); |
|
704
|
704
|
Display :: display_warning_message(sprintf($message_warning, $exercise_title, $objExercise->selectAttempts())); |
|
705
|
705
|
if ($origin != 'learnpath') { |
|
@@ -742,7 +742,7 @@ discard block |
|
|
block discarded – undo |
|
742
|
742
|
echo '<div id="highlight-plugin" class="glossary-content">'; |
|
743
|
743
|
} |
|
744
|
744
|
|
|
745
|
|
-if ($reminder == 2) { |
|
|
745
|
+if ($reminder == 2) { |
|
746
|
746
|
if ($debug) { error_log(' $reminder == 2'); } |
|
747
|
747
|
|
|
748
|
748
|
$data_tracking = $exercise_stat_info['data_tracking']; |
|
@@ -753,14 +753,14 @@ discard block |
|
|
block discarded – undo |
|
753
|
753
|
if (!empty($my_remind_list)) { |
|
754
|
754
|
//Checking which questions we are going to call from the remind list |
|
755
|
755
|
for ($i = 0; $i < count($data_tracking); $i++) { |
|
756
|
|
- for($j = 0; $j < count($my_remind_list); $j++) { |
|
|
756
|
+ for ($j = 0; $j < count($my_remind_list); $j++) { |
|
757
|
757
|
|
|
758
|
758
|
if (!empty($remind_question_id)) { |
|
759
|
759
|
if ($remind_question_id == $my_remind_list[$j]) { |
|
760
|
760
|
|
|
761
|
761
|
if ($remind_question_id == $data_tracking[$i]) { |
|
762
|
|
- if (isset($my_remind_list[$j+1])) { |
|
763
|
|
- $remind_question_id = $my_remind_list[$j+1]; |
|
|
762
|
+ if (isset($my_remind_list[$j + 1])) { |
|
|
763
|
+ $remind_question_id = $my_remind_list[$j + 1]; |
|
764
|
764
|
$current_question = $i + 1; |
|
765
|
765
|
} else { |
|
766
|
766
|
// We end the remind list we go to the exercise_reminder.php please |
|
@@ -772,8 +772,8 @@ discard block |
|
|
block discarded – undo |
|
772
|
772
|
} |
|
773
|
773
|
} else { |
|
774
|
774
|
if ($my_remind_list[$j] == $data_tracking[$i]) { |
|
775
|
|
- if (isset($my_remind_list[$j+1])) { |
|
776
|
|
- $remind_question_id = $my_remind_list[$j+1]; |
|
|
775
|
+ if (isset($my_remind_list[$j + 1])) { |
|
|
776
|
+ $remind_question_id = $my_remind_list[$j + 1]; |
|
777
|
777
|
$current_question = $i + 1; // last question |
|
778
|
778
|
} else { |
|
779
|
779
|
// We end the remind list we go to the exercise_reminder.php please |
|
@@ -804,7 +804,7 @@ discard block |
|
|
block discarded – undo |
|
804
|
804
|
Display :: display_error_message($error, false); |
|
805
|
805
|
} else { |
|
806
|
806
|
if (!empty ($exercise_sound)) { |
|
807
|
|
- echo "<a href=\"../document/download.php?doc_url=%2Faudio%2F" . Security::remove_XSS($exercise_sound) . "\" target=\"_blank\">", "<img src=\"../img/sound.gif\" border=\"0\" align=\"absmiddle\" alt=", get_lang('Sound') . "\" /></a>"; |
|
|
807
|
+ echo "<a href=\"../document/download.php?doc_url=%2Faudio%2F".Security::remove_XSS($exercise_sound)."\" target=\"_blank\">", "<img src=\"../img/sound.gif\" border=\"0\" align=\"absmiddle\" alt=", get_lang('Sound')."\" /></a>"; |
|
808
|
808
|
} |
|
809
|
809
|
// Get number of hotspot questions for javascript validation |
|
810
|
810
|
$number_of_hotspot_questions = 0; |
|
@@ -835,7 +835,7 @@ discard block |
|
|
block discarded – undo |
|
835
|
835
|
} |
|
836
|
836
|
|
|
837
|
837
|
if ($number_of_hotspot_questions > 0) { |
|
838
|
|
- $onsubmit = "onsubmit=\"return validateFlashVar('" . $number_of_hotspot_questions . "', '" . get_lang('HotspotValidateError1') . "', '" . get_lang('HotspotValidateError2') . "');\""; |
|
|
838
|
+ $onsubmit = "onsubmit=\"return validateFlashVar('".$number_of_hotspot_questions."', '".get_lang('HotspotValidateError1')."', '".get_lang('HotspotValidateError2')."');\""; |
|
839
|
839
|
} |
|
840
|
840
|
|
|
841
|
841
|
echo '<script> |
|
@@ -849,7 +849,7 @@ discard block |
|
|
block discarded – undo |
|
849
|
849
|
ICON_SIZE_SMALL, |
|
850
|
850
|
false, |
|
851
|
851
|
true |
|
852
|
|
- ) . '\'; |
|
|
852
|
+ ).'\'; |
|
853
|
853
|
|
|
854
|
854
|
// Block form submition on enter |
|
855
|
855
|
$(".block_on_enter").keypress(function(event) { |
|
@@ -901,7 +901,7 @@ discard block |
|
|
block discarded – undo |
|
901
|
901
|
} else { |
|
902
|
902
|
url = "exercise_submit.php?'.$params.'&num='.$current_question.'&remind_question_id='.$remind_question_id.'"; |
|
903
|
903
|
} |
|
904
|
|
- //$("#save_for_now_"+question_id).html(\'' . Display::return_icon('save.png', get_lang('Saved'), array(), ICON_SIZE_SMALL) . '\'); |
|
|
904
|
+ //$("#save_for_now_"+question_id).html(\'' . Display::return_icon('save.png', get_lang('Saved'), array(), ICON_SIZE_SMALL).'\'); |
|
905
|
905
|
window.location = url; |
|
906
|
906
|
} |
|
907
|
907
|
|
|
@@ -933,7 +933,7 @@ discard block |
|
|
block discarded – undo |
|
933
|
933
|
|
|
934
|
934
|
// Only for the first time |
|
935
|
935
|
|
|
936
|
|
- $("#save_for_now_"+question_id).html(\'' . Display::returnFontAwesomeIcon('spinner', true, null, 'fa-spin') . '\'); |
|
|
936
|
+ $("#save_for_now_"+question_id).html(\'' . Display::returnFontAwesomeIcon('spinner', true, null, 'fa-spin').'\'); |
|
937
|
937
|
$.ajax({ |
|
938
|
938
|
type:"post", |
|
939
|
939
|
async: false, |
|
@@ -941,9 +941,9 @@ discard block |
|
|
block discarded – undo |
|
941
|
941
|
data: "'.$params.'&type=simple&question_id="+question_id+"&"+my_choice+"&"+hotspot+"&"+remind_list, |
|
942
|
942
|
success: function(return_value) { |
|
943
|
943
|
if (return_value == "ok") { |
|
944
|
|
- $("#save_for_now_"+question_id).html(\'' . Display::return_icon('save.png', get_lang('Saved'), array(), ICON_SIZE_SMALL) . '\'); |
|
|
944
|
+ $("#save_for_now_"+question_id).html(\'' . Display::return_icon('save.png', get_lang('Saved'), array(), ICON_SIZE_SMALL).'\'); |
|
945
|
945
|
} else if (return_value == "error") { |
|
946
|
|
- $("#save_for_now_"+question_id).html(\'' . Display::return_icon('error.png', get_lang('Error'), array(), ICON_SIZE_SMALL) . '\'); |
|
|
946
|
+ $("#save_for_now_"+question_id).html(\'' . Display::return_icon('error.png', get_lang('Error'), array(), ICON_SIZE_SMALL).'\'); |
|
947
|
947
|
} else if (return_value == "one_per_page") { |
|
948
|
948
|
var url = ""; |
|
949
|
949
|
if ('.$reminder.' == 1 ) { |
|
@@ -958,13 +958,13 @@ discard block |
|
|
block discarded – undo |
|
958
|
958
|
url = url_extra; |
|
959
|
959
|
} |
|
960
|
960
|
|
|
961
|
|
- $("#save_for_now_"+question_id).html(\'' . Display::return_icon('save.png', get_lang('Saved'), array(), ICON_SIZE_SMALL) . '\'); |
|
|
961
|
+ $("#save_for_now_"+question_id).html(\'' . Display::return_icon('save.png', get_lang('Saved'), array(), ICON_SIZE_SMALL).'\'); |
|
962
|
962
|
|
|
963
|
963
|
window.location = url; |
|
964
|
964
|
} |
|
965
|
965
|
}, |
|
966
|
966
|
error: function() { |
|
967
|
|
- $("#save_for_now_"+question_id).html(\'' . Display::return_icon('error.png', get_lang('Error'), array(), ICON_SIZE_SMALL) . '\'); |
|
|
967
|
+ $("#save_for_now_"+question_id).html(\'' . Display::return_icon('error.png', get_lang('Error'), array(), ICON_SIZE_SMALL).'\'); |
|
968
|
968
|
} |
|
969
|
969
|
}); |
|
970
|
970
|
return false; |
|
@@ -997,7 +997,7 @@ discard block |
|
|
block discarded – undo |
|
997
|
997
|
|
|
998
|
998
|
free_answers = $.param(free_answers); |
|
999
|
999
|
|
|
1000
|
|
- $("#save_all_reponse").html(\'' . Display::returnFontAwesomeIcon('spinner', true, null, 'fa-spin') . '\'); |
|
|
1000
|
+ $("#save_all_reponse").html(\'' . Display::returnFontAwesomeIcon('spinner', true, null, 'fa-spin').'\'); |
|
1001
|
1001
|
|
|
1002
|
1002
|
$.ajax({ |
|
1003
|
1003
|
type:"post", |
|
@@ -1006,14 +1006,14 @@ discard block |
|
|
block discarded – undo |
|
1006
|
1006
|
data: "'.$params.'&type=all&"+my_choice+"&"+hotspot+"&"+free_answers+"&"+remind_list, |
|
1007
|
1007
|
success: function(return_value) { |
|
1008
|
1008
|
if (return_value == "ok") { |
|
1009
|
|
- //$("#save_all_reponse").html(\'' . Display::return_icon('accept.png') . '\'); |
|
|
1009
|
+ //$("#save_all_reponse").html(\'' . Display::return_icon('accept.png').'\'); |
|
1010
|
1010
|
if (validate == "validate") { |
|
1011
|
1011
|
window.location = "'.$script_php.'?'.$params.'"; |
|
1012
|
1012
|
} else { |
|
1013
|
|
- $("#save_all_reponse").html(\'' . Display::return_icon('accept.png') . '\'); |
|
|
1013
|
+ $("#save_all_reponse").html(\'' . Display::return_icon('accept.png').'\'); |
|
1014
|
1014
|
} |
|
1015
|
1015
|
} else { |
|
1016
|
|
- $("#save_all_reponse").html(\'' . Display::return_icon('wrong.gif') . '\'); |
|
|
1016
|
+ $("#save_all_reponse").html(\'' . Display::return_icon('wrong.gif').'\'); |
|
1017
|
1017
|
} |
|
1018
|
1018
|
} |
|
1019
|
1019
|
}); |
|
@@ -1026,16 +1026,16 @@ discard block |
|
|
block discarded – undo |
|
1026
|
1026
|
} |
|
1027
|
1027
|
</script>'; |
|
1028
|
1028
|
|
|
1029
|
|
- echo '<form id="exercise_form" method="post" action="'.api_get_self().'?'.api_get_cidreq().'&autocomplete=off&&exerciseId='.$exerciseId .'" name="frm_exercise" '.$onsubmit.'> |
|
|
1029
|
+ echo '<form id="exercise_form" method="post" action="'.api_get_self().'?'.api_get_cidreq().'&autocomplete=off&&exerciseId='.$exerciseId.'" name="frm_exercise" '.$onsubmit.'> |
|
1030
|
1030
|
<input type="hidden" name="formSent" value="1" /> |
|
1031
|
|
- <input type="hidden" name="exerciseId" value="'.$exerciseId . '" /> |
|
|
1031
|
+ <input type="hidden" name="exerciseId" value="'.$exerciseId.'" /> |
|
1032
|
1032
|
<input type="hidden" name="num" value="'.$current_question.'" id="num_current_id" /> |
|
1033
|
1033
|
<input type="hidden" name="num_answer" value="'.$currentAnswer.'" id="num_current_answer_id" /> |
|
1034
|
|
- <input type="hidden" name="exe_id" value="'.$exe_id . '" /> |
|
1035
|
|
- <input type="hidden" name="origin" value="'.$origin . '" /> |
|
1036
|
|
- <input type="hidden" name="learnpath_id" value="'.$learnpath_id . '" /> |
|
1037
|
|
- <input type="hidden" name="learnpath_item_id" value="'.$learnpath_item_id . '" /> |
|
1038
|
|
- <input type="hidden" name="learnpath_item_view_id" value="'.$learnpath_item_view_id . '" />'; |
|
|
1034
|
+ <input type="hidden" name="exe_id" value="'.$exe_id.'" /> |
|
|
1035
|
+ <input type="hidden" name="origin" value="'.$origin.'" /> |
|
|
1036
|
+ <input type="hidden" name="learnpath_id" value="'.$learnpath_id.'" /> |
|
|
1037
|
+ <input type="hidden" name="learnpath_item_id" value="'.$learnpath_item_id.'" /> |
|
|
1038
|
+ <input type="hidden" name="learnpath_item_view_id" value="'.$learnpath_item_view_id.'" />'; |
|
1039
|
1039
|
|
|
1040
|
1040
|
// Show list of questions |
|
1041
|
1041
|
$i = 1; |
|
@@ -1046,7 +1046,7 @@ discard block |
|
|
block discarded – undo |
|
1046
|
1046
|
$attempt_list = Event::getAllExerciseEventByExeId($exe_id); |
|
1047
|
1047
|
} |
|
1048
|
1048
|
|
|
1049
|
|
- $remind_list = array(); |
|
|
1049
|
+ $remind_list = array(); |
|
1050
|
1050
|
if (isset($exercise_stat_info['questions_to_check']) && !empty($exercise_stat_info['questions_to_check'])) { |
|
1051
|
1051
|
$remind_list = explode(',', $exercise_stat_info['questions_to_check']); |
|
1052
|
1052
|
} |
|
@@ -1084,7 +1084,7 @@ discard block |
|
|
block discarded – undo |
|
1084
|
1084
|
$remind_highlight = 'no_remind_highlight'; |
|
1085
|
1085
|
} |
|
1086
|
1086
|
|
|
1087
|
|
- $exercise_actions = ''; |
|
|
1087
|
+ $exercise_actions = ''; |
|
1088
|
1088
|
$is_remind_on = false; |
|
1089
|
1089
|
|
|
1090
|
1090
|
$attributes = array('id' =>'remind_list['.$questionId.']'); |
|
@@ -1096,11 +1096,11 @@ discard block |
|
|
block discarded – undo |
|
1096
|
1096
|
} |
|
1097
|
1097
|
|
|
1098
|
1098
|
// Showing the exercise description |
|
1099
|
|
- if (!empty($objExercise->description)){ |
|
1100
|
|
- if ($objExercise->type == ONE_PER_PAGE || ($objExercise->type != ONE_PER_PAGE && $i==1)) { |
|
|
1099
|
+ if (!empty($objExercise->description)) { |
|
|
1100
|
+ if ($objExercise->type == ONE_PER_PAGE || ($objExercise->type != ONE_PER_PAGE && $i == 1)) { |
|
1101
|
1101
|
//echo Display::panel($objExercise->description, get_lang('ExerciseDescriptionLabel')); |
|
1102
|
|
- echo Display::panelCollapse('<span>' . |
|
1103
|
|
- get_lang('ExerciseDescriptionLabel') . '</span>', |
|
|
1102
|
+ echo Display::panelCollapse('<span>'. |
|
|
1103
|
+ get_lang('ExerciseDescriptionLabel').'</span>', |
|
1104
|
1104
|
$objExercise->description, |
|
1105
|
1105
|
'exercise-description', |
|
1106
|
1106
|
[], |
|
@@ -1134,7 +1134,7 @@ discard block |
|
|
block discarded – undo |
|
1134
|
1134
|
case ALL_ON_ONE_PAGE : |
|
1135
|
1135
|
$button = '<a href="javascript://" class="btn btn-info" onclick="save_now(\''.$questionId.'\'); ">'.get_lang('SaveForNow').'</a>'; |
|
1136
|
1136
|
$button .= '<span id="save_for_now_'.$questionId.'"></span> '; |
|
1137
|
|
- $exercise_actions .= Display::div($button, array('class'=>'exercise_save_now_button')); |
|
|
1137
|
+ $exercise_actions .= Display::div($button, array('class'=>'exercise_save_now_button')); |
|
1138
|
1138
|
break; |
|
1139
|
1139
|
} |
|
1140
|
1140
|
|
|
@@ -1144,13 +1144,13 @@ discard block |
|
|
block discarded – undo |
|
1144
|
1144
|
'label', |
|
1145
|
1145
|
Display::input( |
|
1146
|
1146
|
'checkbox', |
|
1147
|
|
- 'remind_list[' . $questionId . ']', |
|
|
1147
|
+ 'remind_list['.$questionId.']', |
|
1148
|
1148
|
'', |
|
1149
|
1149
|
$attributes |
|
1150
|
|
- ) . get_lang('ReviewQuestionLater'), |
|
|
1150
|
+ ).get_lang('ReviewQuestionLater'), |
|
1151
|
1151
|
array( |
|
1152
|
1152
|
'class' => 'checkbox', |
|
1153
|
|
- 'for' => 'remind_list[' . $questionId . ']' |
|
|
1153
|
+ 'for' => 'remind_list['.$questionId.']' |
|
1154
|
1154
|
) |
|
1155
|
1155
|
); |
|
1156
|
1156
|
$exercise_actions .= Display::div($remind_question_div, array('class'=>'exercise_save_now_button')); |
|
@@ -1167,7 +1167,7 @@ discard block |
|
|
block discarded – undo |
|
1167
|
1167
|
} |
|
1168
|
1168
|
// end foreach() |
|
1169
|
1169
|
if ($objExercise->type == ALL_ON_ONE_PAGE) { |
|
1170
|
|
- $exercise_actions = $objExercise->show_button($questionId, $current_question); |
|
|
1170
|
+ $exercise_actions = $objExercise->show_button($questionId, $current_question); |
|
1171
|
1171
|
echo Display::div($exercise_actions, array('class'=>'exercise_actions')); |
|
1172
|
1172
|
echo '<br>'; |
|
1173
|
1173
|
} |