@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if (!$objExercise->read($exerciseId) || |
125 | 125 | (!$objExercise->selectStatus() && !$is_allowedToEdit && $origin != 'learnpath') |
126 | 126 | ) { |
127 | - if ($debug) {error_log('1.1. Error while reading the exercise'); }; |
|
127 | + if ($debug) {error_log('1.1. Error while reading the exercise'); }; |
|
128 | 128 | unset ($objExercise); |
129 | 129 | $error = get_lang('ExerciseNotFound'); |
130 | 130 | } else { |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | } |
138 | 138 | //2. Checking if $objExercise is set |
139 | 139 | if (!isset($objExercise) && isset($exerciseInSession)) { |
140 | - if ($debug) { error_log('2. Loading $objExercise from session'); }; |
|
140 | + if ($debug) { error_log('2. Loading $objExercise from session'); }; |
|
141 | 141 | $objExercise = $exerciseInSession; |
142 | 142 | } |
143 | 143 | |
144 | 144 | //3. $objExercise is not set, then return to the exercise list |
145 | 145 | if (!is_object($objExercise)) { |
146 | - if ($debug) {error_log('3. $objExercise was not set, kill the script'); }; |
|
146 | + if ($debug) {error_log('3. $objExercise was not set, kill the script'); }; |
|
147 | 147 | header('Location: exercise.php'); |
148 | 148 | exit; |
149 | 149 | } |
@@ -322,19 +322,19 @@ discard block |
||
322 | 322 | $total_weight += floatval($objQuestionTmp->weighting); |
323 | 323 | } |
324 | 324 | |
325 | - if ($time_control) { |
|
326 | - $expected_time = $current_timestamp + $total_seconds; |
|
325 | + if ($time_control) { |
|
326 | + $expected_time = $current_timestamp + $total_seconds; |
|
327 | 327 | |
328 | - if ($debug) error_log('5.1. $current_timestamp '.$current_timestamp); |
|
329 | - if ($debug) error_log('5.2. $expected_time '.$expected_time); |
|
328 | + if ($debug) error_log('5.1. $current_timestamp '.$current_timestamp); |
|
329 | + if ($debug) error_log('5.2. $expected_time '.$expected_time); |
|
330 | 330 | |
331 | - $clock_expired_time = api_get_utc_datetime($expected_time); |
|
332 | - if ($debug) error_log('5.3. $expected_time '.$clock_expired_time); |
|
331 | + $clock_expired_time = api_get_utc_datetime($expected_time); |
|
332 | + if ($debug) error_log('5.3. $expected_time '.$clock_expired_time); |
|
333 | 333 | |
334 | - //Sessions that contain the expired time |
|
335 | - $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
|
336 | - if ($debug) { error_log('5.4. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); }; |
|
337 | - } |
|
334 | + //Sessions that contain the expired time |
|
335 | + $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
|
336 | + if ($debug) { error_log('5.4. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); }; |
|
337 | + } |
|
338 | 338 | |
339 | 339 | $exe_id = $objExercise->save_stat_track_exercise_info( |
340 | 340 | $clock_expired_time, |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | ); |
352 | 352 | if ($debug) error_log("5.5 exercise_stat_info[] exists getting exe_id $exe_id"); |
353 | 353 | } else { |
354 | - $exe_id = $exercise_stat_info['exe_id']; |
|
354 | + $exe_id = $exercise_stat_info['exe_id']; |
|
355 | 355 | // Remember last question id position. |
356 | 356 | $isFirstTime = Session::read('firstTime'); |
357 | 357 | |
@@ -411,9 +411,9 @@ discard block |
||
411 | 411 | if ($debug) { error_log('6. $objExercise->get_stat_track_exercise_info function called:: '.print_r($exercise_stat_info, 1)); }; |
412 | 412 | |
413 | 413 | if (!empty($exercise_stat_info['questions_to_check'])) { |
414 | - $my_remind_list = $exercise_stat_info['questions_to_check']; |
|
415 | - $my_remind_list = explode(',', $my_remind_list); |
|
416 | - $my_remind_list = array_filter($my_remind_list); |
|
414 | + $my_remind_list = $exercise_stat_info['questions_to_check']; |
|
415 | + $my_remind_list = explode(',', $my_remind_list); |
|
416 | + $my_remind_list = array_filter($my_remind_list); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | $params = "exe_id=$exe_id&exerciseId=$exerciseId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id&".api_get_cidreq(); |
@@ -421,8 +421,8 @@ discard block |
||
421 | 421 | |
422 | 422 | if ($reminder == 2 && empty($my_remind_list)) { |
423 | 423 | if ($debug) { error_log("6.2 calling the exercise_reminder.php "); }; |
424 | - header('Location: exercise_reminder.php?'.$params); |
|
425 | - exit; |
|
424 | + header('Location: exercise_reminder.php?'.$params); |
|
425 | + exit; |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | /* |
@@ -430,56 +430,56 @@ discard block |
||
430 | 430 | * If the expired time is major that zero(0) then the expired time is compute on this time. |
431 | 431 | */ |
432 | 432 | if ($time_control) { |
433 | - if ($debug) error_log('7.1. Time control is enabled'); |
|
434 | - if ($debug) error_log('7.2. $current_expired_time_key '.$current_expired_time_key); |
|
435 | - if ($debug) error_log('7.3. $_SESSION[expired_time][$current_expired_time_key] '.$_SESSION['expired_time'][$current_expired_time_key]); |
|
433 | + if ($debug) error_log('7.1. Time control is enabled'); |
|
434 | + if ($debug) error_log('7.2. $current_expired_time_key '.$current_expired_time_key); |
|
435 | + if ($debug) error_log('7.3. $_SESSION[expired_time][$current_expired_time_key] '.$_SESSION['expired_time'][$current_expired_time_key]); |
|
436 | 436 | |
437 | 437 | if (!isset($_SESSION['expired_time'][$current_expired_time_key])) { |
438 | 438 | //Timer - Get expired_time for a student |
439 | 439 | if (!empty($exercise_stat_info)) { |
440 | - if ($debug) {error_log('7.4 Seems that the session ends and the user want to retake the exam'); }; |
|
441 | - $expired_time_of_this_attempt = $exercise_stat_info['expired_time_control']; |
|
442 | - if ($debug) {error_log('7.5 $expired_time_of_this_attempt: '.$expired_time_of_this_attempt); } |
|
443 | - // Get the last attempt of an exercise |
|
444 | - $last_attempt_date = Event::getLastAttemptDateOfExercise($exercise_stat_info['exe_id']); |
|
440 | + if ($debug) {error_log('7.4 Seems that the session ends and the user want to retake the exam'); }; |
|
441 | + $expired_time_of_this_attempt = $exercise_stat_info['expired_time_control']; |
|
442 | + if ($debug) {error_log('7.5 $expired_time_of_this_attempt: '.$expired_time_of_this_attempt); } |
|
443 | + // Get the last attempt of an exercise |
|
444 | + $last_attempt_date = Event::getLastAttemptDateOfExercise($exercise_stat_info['exe_id']); |
|
445 | 445 | |
446 | - /* This means that the user enters the exam but do not answer the |
|
446 | + /* This means that the user enters the exam but do not answer the |
|
447 | 447 | first question we get the date from the track_e_exercises not from |
448 | 448 | the track_et_attempt see #2069 */ |
449 | - if (empty($last_attempt_date)) { |
|
450 | - $diff = $current_timestamp - api_strtotime($exercise_stat_info['start_date'], 'UTC'); |
|
451 | - $last_attempt_date = api_get_utc_datetime(api_strtotime($exercise_stat_info['start_date'],'UTC') + $diff); |
|
452 | - } else { |
|
453 | - //Recalculate the time control due #2069 |
|
454 | - $diff = $current_timestamp - api_strtotime($last_attempt_date,'UTC'); |
|
455 | - $last_attempt_date = api_get_utc_datetime(api_strtotime($last_attempt_date,'UTC') + $diff); |
|
456 | - } |
|
457 | - if ($debug) {error_log('7.6. $last_attempt_date: '.$last_attempt_date); } |
|
458 | - |
|
459 | - //New expired time - it is due to the possible closure of session |
|
460 | - $new_expired_time_in_seconds = api_strtotime($expired_time_of_this_attempt, 'UTC') - api_strtotime($last_attempt_date,'UTC'); |
|
461 | - if ($debug) {error_log('7.7. $new_expired_time_in_seconds: '.$new_expired_time_in_seconds); } |
|
462 | - |
|
463 | - $expected_time = $current_timestamp + $new_expired_time_in_seconds; |
|
464 | - if ($debug) {error_log('7.8. $expected_time1: '.$expected_time); } |
|
465 | - |
|
466 | - $clock_expired_time = api_get_utc_datetime($expected_time); |
|
467 | - if ($debug) {error_log('7.9. $clock_expired_time: '.$clock_expired_time); } |
|
468 | - |
|
469 | - // First we update the attempt to today |
|
470 | - /* How the expired time is changed into "track_e_exercises" table, |
|
449 | + if (empty($last_attempt_date)) { |
|
450 | + $diff = $current_timestamp - api_strtotime($exercise_stat_info['start_date'], 'UTC'); |
|
451 | + $last_attempt_date = api_get_utc_datetime(api_strtotime($exercise_stat_info['start_date'],'UTC') + $diff); |
|
452 | + } else { |
|
453 | + //Recalculate the time control due #2069 |
|
454 | + $diff = $current_timestamp - api_strtotime($last_attempt_date,'UTC'); |
|
455 | + $last_attempt_date = api_get_utc_datetime(api_strtotime($last_attempt_date,'UTC') + $diff); |
|
456 | + } |
|
457 | + if ($debug) {error_log('7.6. $last_attempt_date: '.$last_attempt_date); } |
|
458 | + |
|
459 | + //New expired time - it is due to the possible closure of session |
|
460 | + $new_expired_time_in_seconds = api_strtotime($expired_time_of_this_attempt, 'UTC') - api_strtotime($last_attempt_date,'UTC'); |
|
461 | + if ($debug) {error_log('7.7. $new_expired_time_in_seconds: '.$new_expired_time_in_seconds); } |
|
462 | + |
|
463 | + $expected_time = $current_timestamp + $new_expired_time_in_seconds; |
|
464 | + if ($debug) {error_log('7.8. $expected_time1: '.$expected_time); } |
|
465 | + |
|
466 | + $clock_expired_time = api_get_utc_datetime($expected_time); |
|
467 | + if ($debug) {error_log('7.9. $clock_expired_time: '.$clock_expired_time); } |
|
468 | + |
|
469 | + // First we update the attempt to today |
|
470 | + /* How the expired time is changed into "track_e_exercises" table, |
|
471 | 471 | then the last attempt for this student should be changed too */ |
472 | - $sql = "UPDATE $exercise_attempt_table SET |
|
472 | + $sql = "UPDATE $exercise_attempt_table SET |
|
473 | 473 | tms = '".api_get_utc_datetime()."' |
474 | 474 | WHERE |
475 | 475 | exe_id = '".$exercise_stat_info['exe_id']."' AND |
476 | 476 | tms = '".$last_attempt_date."' "; |
477 | - if ($debug) {error_log('7.10. $sql: '.$sql); } |
|
478 | - Database::query($sql); |
|
477 | + if ($debug) {error_log('7.10. $sql: '.$sql); } |
|
478 | + Database::query($sql); |
|
479 | 479 | |
480 | - //Sessions that contain the expired time |
|
481 | - $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
|
482 | - if ($debug) {error_log('7.11. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); }; |
|
480 | + //Sessions that contain the expired time |
|
481 | + $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
|
482 | + if ($debug) {error_log('7.11. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); }; |
|
483 | 483 | } |
484 | 484 | } else { |
485 | 485 | $clock_expired_time = $_SESSION['expired_time'][$current_expired_time_key]; |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | * for more details of how it works see this link : http://eric.garside.name/docs.html?p=epiclock |
497 | 497 | */ |
498 | 498 | if ($time_control) { //Sends the exercise form when the expired time is finished |
499 | - $htmlHeadXtra[] = $objExercise->show_time_control_js($time_left); |
|
499 | + $htmlHeadXtra[] = $objExercise->show_time_control_js($time_left); |
|
500 | 500 | } |
501 | 501 | |
502 | 502 | //in LP's is enabled the "remember question" feature? |
@@ -504,14 +504,14 @@ discard block |
||
504 | 504 | // selects the list of question ID |
505 | 505 | $questionList = $objExercise->get_validated_question_list(); |
506 | 506 | if ($objExercise->isRandom() && !empty($exercise_stat_info['data_tracking'])) { |
507 | - $questionList = explode(',', $exercise_stat_info['data_tracking']); |
|
507 | + $questionList = explode(',', $exercise_stat_info['data_tracking']); |
|
508 | 508 | } |
509 | 509 | Session::write('questionList', $questionList); |
510 | 510 | if ($debug > 0) { error_log('$_SESSION[questionList] was set'); } |
511 | 511 | } else { |
512 | - if (isset($objExercise) && isset($_SESSION['objExercise'])) { |
|
513 | - $questionList = $_SESSION['questionList']; |
|
514 | - } |
|
512 | + if (isset($objExercise) && isset($_SESSION['objExercise'])) { |
|
513 | + $questionList = $_SESSION['questionList']; |
|
514 | + } |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | if ($debug) error_log('8. Question list loaded '.print_r($questionList, 1)); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | //Real question count |
520 | 520 | $question_count = 0; |
521 | 521 | if (!empty($questionList)) { |
522 | - $question_count = count($questionList); |
|
522 | + $question_count = count($questionList); |
|
523 | 523 | } |
524 | 524 | |
525 | 525 | if ($current_question > $question_count) { |
@@ -569,11 +569,11 @@ discard block |
||
569 | 569 | //saving each question |
570 | 570 | if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) { |
571 | 571 | $nro_question = $current_question; // - 1; |
572 | - $questionId = $key; |
|
572 | + $questionId = $key; |
|
573 | 573 | // gets the student choice for this question |
574 | 574 | $choice = $exerciseResult[$questionId]; |
575 | 575 | if (isset($exe_id)) { |
576 | - // Manage the question and answer attempts |
|
576 | + // Manage the question and answer attempts |
|
577 | 577 | if ($debug) { |
578 | 578 | error_log('8.3. manage_answer exe_id: '.$exe_id.' - $questionId: '.$questionId.' Choice'.print_r($choice,1)); |
579 | 579 | } |
@@ -665,58 +665,58 @@ discard block |
||
665 | 665 | |
666 | 666 | |
667 | 667 | if ($question_count != 0) { |
668 | - if (($objExercise->type == ALL_ON_ONE_PAGE || |
|
668 | + if (($objExercise->type == ALL_ON_ONE_PAGE || |
|
669 | 669 | $current_question > $question_count) |
670 | 670 | ) { |
671 | - if (api_is_allowed_to_session_edit()) { |
|
672 | - // goes to the script that will show the result of the exercise |
|
673 | - if ($objExercise->type == ALL_ON_ONE_PAGE) { |
|
674 | - if ($debug) { error_log('12. Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); } |
|
675 | - |
|
676 | - //We check if the user attempts before sending to the exercise_result.php |
|
677 | - if ($objExercise->selectAttempts() > 0) { |
|
678 | - $attempt_count = Event::get_attempt_count( |
|
671 | + if (api_is_allowed_to_session_edit()) { |
|
672 | + // goes to the script that will show the result of the exercise |
|
673 | + if ($objExercise->type == ALL_ON_ONE_PAGE) { |
|
674 | + if ($debug) { error_log('12. Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); } |
|
675 | + |
|
676 | + //We check if the user attempts before sending to the exercise_result.php |
|
677 | + if ($objExercise->selectAttempts() > 0) { |
|
678 | + $attempt_count = Event::get_attempt_count( |
|
679 | 679 | api_get_user_id(), |
680 | 680 | $exerciseId, |
681 | 681 | $learnpath_id, |
682 | 682 | $learnpath_item_id, |
683 | 683 | $learnpath_item_view_id |
684 | 684 | ); |
685 | - if ($attempt_count >= $objExercise->selectAttempts()) { |
|
686 | - Display :: display_warning_message( |
|
685 | + if ($attempt_count >= $objExercise->selectAttempts()) { |
|
686 | + Display :: display_warning_message( |
|
687 | 687 | sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), |
688 | 688 | false |
689 | 689 | ); |
690 | - if ($origin != 'learnpath') { |
|
691 | - //so we are not in learnpath tool |
|
692 | - echo '</div>'; //End glossary div |
|
693 | - Display :: display_footer(); |
|
694 | - } else { |
|
695 | - echo '</body></html>'; |
|
696 | - } |
|
697 | - exit; |
|
698 | - } |
|
699 | - } |
|
700 | - } else { |
|
701 | - if ($objExercise->review_answers) { |
|
702 | - header('Location: exercise_reminder.php?'.$params); |
|
703 | - exit; |
|
704 | - } else { |
|
690 | + if ($origin != 'learnpath') { |
|
691 | + //so we are not in learnpath tool |
|
692 | + echo '</div>'; //End glossary div |
|
693 | + Display :: display_footer(); |
|
694 | + } else { |
|
695 | + echo '</body></html>'; |
|
696 | + } |
|
697 | + exit; |
|
698 | + } |
|
699 | + } |
|
700 | + } else { |
|
701 | + if ($objExercise->review_answers) { |
|
702 | + header('Location: exercise_reminder.php?'.$params); |
|
703 | + exit; |
|
704 | + } else { |
|
705 | 705 | header("Location: exercise_result.php?".api_get_cidreq()."&exe_id=$exe_id&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id"); |
706 | 706 | exit; |
707 | - } |
|
708 | - } |
|
709 | - } else { |
|
710 | - if ($debug) { error_log('Redirecting to exercise_submit.php'); } |
|
711 | - exit; |
|
712 | - } |
|
713 | - } |
|
707 | + } |
|
708 | + } |
|
709 | + } else { |
|
710 | + if ($debug) { error_log('Redirecting to exercise_submit.php'); } |
|
711 | + exit; |
|
712 | + } |
|
713 | + } |
|
714 | 714 | } else { |
715 | - $error = get_lang('ThereAreNoQuestionsForThisExercise'); |
|
716 | - // if we are in the case where user select random by category, but didn't choose the number of random question |
|
717 | - if ($objExercise->selectRandomByCat() > 0 && $objExercise->random <= 0) { |
|
718 | - $error .= "<br/>".get_lang('PleaseSelectSomeRandomQuestion'); |
|
719 | - } |
|
715 | + $error = get_lang('ThereAreNoQuestionsForThisExercise'); |
|
716 | + // if we are in the case where user select random by category, but didn't choose the number of random question |
|
717 | + if ($objExercise->selectRandomByCat() > 0 && $objExercise->random <= 0) { |
|
718 | + $error .= "<br/>".get_lang('PleaseSelectSomeRandomQuestion'); |
|
719 | + } |
|
720 | 720 | } |
721 | 721 | |
722 | 722 | if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') { |
@@ -755,9 +755,9 @@ discard block |
||
755 | 755 | if (api_is_course_admin() && $origin != 'learnpath') { |
756 | 756 | echo '<div class="actions">'; |
757 | 757 | if ($show_quiz_edition == false) { |
758 | - 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>'; |
|
758 | + 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>'; |
|
759 | 759 | } else { |
760 | - echo '<a href="#">'.Display::return_icon('settings_na.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
760 | + echo '<a href="#">'.Display::return_icon('settings_na.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
761 | 761 | } |
762 | 762 | echo '</div>'; |
763 | 763 | } |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $message_warning = $permission_to_start ? get_lang('ReachedTimeLimit') : get_lang('ExerciseNoStartedYet'); |
801 | 801 | Display :: display_warning_message(sprintf($message_warning, $exercise_title, $objExercise->selectAttempts())); |
802 | 802 | if ($origin != 'learnpath') { |
803 | - Display :: display_footer(); |
|
803 | + Display :: display_footer(); |
|
804 | 804 | } |
805 | 805 | exit; |
806 | 806 | } else { |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | if (isset($_custom['exercises_hidden_when_no_start_date']) && |
816 | 816 | $_custom['exercises_hidden_when_no_start_date'] |
817 | 817 | ) { |
818 | - if (empty($objExercise->start_time)) { |
|
818 | + if (empty($objExercise->start_time)) { |
|
819 | 819 | Display:: display_warning_message( |
820 | 820 | sprintf( |
821 | 821 | get_lang('ExerciseNoStartedYet'), |
@@ -823,20 +823,20 @@ discard block |
||
823 | 823 | $objExercise->selectAttempts() |
824 | 824 | ) |
825 | 825 | ); |
826 | - if ($origin != 'learnpath') { |
|
827 | - Display :: display_footer(); |
|
828 | - } |
|
829 | - } |
|
826 | + if ($origin != 'learnpath') { |
|
827 | + Display :: display_footer(); |
|
828 | + } |
|
829 | + } |
|
830 | 830 | } |
831 | 831 | |
832 | 832 | //Timer control |
833 | 833 | if ($time_control) { |
834 | 834 | echo $objExercise->return_time_left_div(); |
835 | - echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciseExpiredTimeMessage').'</div>'; |
|
835 | + echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciseExpiredTimeMessage').'</div>'; |
|
836 | 836 | } |
837 | 837 | |
838 | 838 | if ($origin != 'learnpath') { |
839 | - echo '<div id="highlight-plugin" class="glossary-content">'; |
|
839 | + echo '<div id="highlight-plugin" class="glossary-content">'; |
|
840 | 840 | } |
841 | 841 | |
842 | 842 | if ($reminder == 2) { |
@@ -847,53 +847,53 @@ discard block |
||
847 | 847 | $current_question = 1; //set by default the 1st question |
848 | 848 | |
849 | 849 | if (!empty($my_remind_list)) { |
850 | - //Checking which questions we are going to call from the remind list |
|
851 | - for ($i = 0; $i < count($data_tracking); $i++) { |
|
852 | - for($j = 0; $j < count($my_remind_list); $j++) { |
|
853 | - |
|
854 | - if (!empty($remind_question_id)) { |
|
855 | - if ($remind_question_id == $my_remind_list[$j]) { |
|
856 | - |
|
857 | - if ($remind_question_id == $data_tracking[$i]) { |
|
858 | - if (isset($my_remind_list[$j+1])) { |
|
859 | - $remind_question_id = $my_remind_list[$j+1]; |
|
860 | - $current_question = $i + 1; |
|
861 | - } else { |
|
850 | + //Checking which questions we are going to call from the remind list |
|
851 | + for ($i = 0; $i < count($data_tracking); $i++) { |
|
852 | + for($j = 0; $j < count($my_remind_list); $j++) { |
|
853 | + |
|
854 | + if (!empty($remind_question_id)) { |
|
855 | + if ($remind_question_id == $my_remind_list[$j]) { |
|
856 | + |
|
857 | + if ($remind_question_id == $data_tracking[$i]) { |
|
858 | + if (isset($my_remind_list[$j+1])) { |
|
859 | + $remind_question_id = $my_remind_list[$j+1]; |
|
860 | + $current_question = $i + 1; |
|
861 | + } else { |
|
862 | 862 | // We end the remind list we go to the exercise_reminder.php please |
863 | - $remind_question_id = -1; |
|
864 | - $current_question = $i + 1; // last question |
|
865 | - } |
|
866 | - break 2; |
|
867 | - } |
|
868 | - } |
|
869 | - } else { |
|
870 | - if ($my_remind_list[$j] == $data_tracking[$i]) { |
|
871 | - if (isset($my_remind_list[$j+1])) { |
|
872 | - $remind_question_id = $my_remind_list[$j+1]; |
|
873 | - $current_question = $i + 1; // last question |
|
874 | - } else { |
|
863 | + $remind_question_id = -1; |
|
864 | + $current_question = $i + 1; // last question |
|
865 | + } |
|
866 | + break 2; |
|
867 | + } |
|
868 | + } |
|
869 | + } else { |
|
870 | + if ($my_remind_list[$j] == $data_tracking[$i]) { |
|
871 | + if (isset($my_remind_list[$j+1])) { |
|
872 | + $remind_question_id = $my_remind_list[$j+1]; |
|
873 | + $current_question = $i + 1; // last question |
|
874 | + } else { |
|
875 | 875 | // We end the remind list we go to the exercise_reminder.php please |
876 | - $remind_question_id = -1; |
|
877 | - $current_question = $i + 1; // last question |
|
878 | - } |
|
879 | - break 2; |
|
880 | - } |
|
881 | - } |
|
882 | - } |
|
876 | + $remind_question_id = -1; |
|
877 | + $current_question = $i + 1; // last question |
|
878 | + } |
|
879 | + break 2; |
|
880 | + } |
|
881 | + } |
|
882 | + } |
|
883 | 883 | } |
884 | 884 | } else { |
885 | - if ($objExercise->review_answers) { |
|
885 | + if ($objExercise->review_answers) { |
|
886 | 886 | if ($debug) { error_log('. redirecting to exercise_reminder.php '); } |
887 | - header("Location: exercise_reminder.php?$params"); |
|
888 | - exit; |
|
889 | - } |
|
887 | + header("Location: exercise_reminder.php?$params"); |
|
888 | + exit; |
|
889 | + } |
|
890 | 890 | } |
891 | 891 | } |
892 | 892 | |
893 | 893 | if ($objExercise->review_answers) { |
894 | - $script_php = 'exercise_reminder.php'; |
|
894 | + $script_php = 'exercise_reminder.php'; |
|
895 | 895 | } else { |
896 | - $script_php = 'exercise_result.php'; |
|
896 | + $script_php = 'exercise_result.php'; |
|
897 | 897 | } |
898 | 898 | |
899 | 899 | if (!empty($error)) { |
@@ -1133,7 +1133,7 @@ discard block |
||
1133 | 1133 | <input type="hidden" name="learnpath_item_id" value="'.$learnpath_item_id . '" /> |
1134 | 1134 | <input type="hidden" name="learnpath_item_view_id" value="'.$learnpath_item_view_id . '" />'; |
1135 | 1135 | |
1136 | - // Show list of questions |
|
1136 | + // Show list of questions |
|
1137 | 1137 | $i = 1; |
1138 | 1138 | $attempt_list = []; |
1139 | 1139 | if (isset($exe_id)) { |
@@ -1193,10 +1193,10 @@ discard block |
||
1193 | 1193 | |
1194 | 1194 | $attributes = array('id' =>'remind_list['.$questionId.']'); |
1195 | 1195 | if (in_array($questionId, $remind_list)) { |
1196 | - $is_remind_on = true; |
|
1197 | - $attributes['checked'] = 1; |
|
1198 | - $remind_question = true; |
|
1199 | - $remind_highlight = ' remind_highlight '; |
|
1196 | + $is_remind_on = true; |
|
1197 | + $attributes['checked'] = 1; |
|
1198 | + $remind_question = true; |
|
1199 | + $remind_highlight = ' remind_highlight '; |
|
1200 | 1200 | } |
1201 | 1201 | |
1202 | 1202 | // Showing the exercise description |
@@ -1270,8 +1270,8 @@ discard block |
||
1270 | 1270 | } |
1271 | 1271 | // end foreach() |
1272 | 1272 | if ($objExercise->type == ALL_ON_ONE_PAGE) { |
1273 | - $exercise_actions = $objExercise->show_button($questionId, $current_question); |
|
1274 | - echo Display::div($exercise_actions, array('class'=>'exercise_actions')); |
|
1273 | + $exercise_actions = $objExercise->show_button($questionId, $current_question); |
|
1274 | + echo Display::div($exercise_actions, array('class'=>'exercise_actions')); |
|
1275 | 1275 | echo '<br>'; |
1276 | 1276 | } |
1277 | 1277 | echo '</form>'; |
@@ -126,7 +126,7 @@ |
||
126 | 126 | while ($j < $number_friends) { |
127 | 127 | if (isset($friends[$j])) { |
128 | 128 | $friend = $friends[$j]; |
129 | - $toolBar = '<button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '> |
|
129 | + $toolBar = '<button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '> |
|
130 | 130 | ' . get_lang('Delete') . ' |
131 | 131 | </button>'; |
132 | 132 | $friend_html .= Display::getUserCard($friend['user_info'], '', $toolBar); |