|
200 | 200 | } |
201 | 201 |
|
202 | 202 | // if the user has submitted the form. |
203 | | -$exercise_title = $objExercise->selectTitle(); |
| 203 | +$exercise_title = Security::remove_XSS($objExercise->selectTitle()); |
204 | 204 | $exercise_sound = $objExercise->selectSound(); |
205 | 205 |
|
206 | 206 | // If reminder ends we jump to the exercise_reminder |
|
659 | 659 | } |
660 | 660 | $count++; |
661 | 661 | } |
662 | | - //var_dump($questionCheck);exit; |
663 | | - // Use reminder list to get the current question. |
664 | | - /*if (2 === $reminder && !empty($myRemindList)) { |
665 | | - $remindQuestionId = current($myRemindList); |
666 | | - $questionCheck = Question::read($remindQuestionId); |
667 | | - }*/ |
668 | 662 |
|
669 | 663 | $categoryId = 0; |
670 | 664 | if (null !== $questionCheck) { |
|
674 | 668 | if ($objExercise->review_answers && isset($_GET['category_id'])) { |
675 | 669 | $categoryId = $_GET['category_id'] ?? 0; |
676 | 670 | } |
677 | | - //var_dump($categoryId, $categoryList); |
| 671 | + |
678 | 672 | if (!empty($categoryId)) { |
679 | 673 | $categoryInfo = $categoryList[$categoryId]; |
680 | 674 | $count = 1; |
681 | 675 | $total = count($categoryList[$categoryId]); |
682 | | - //var_dump($questionCheck); |
| 676 | + |
683 | 677 | foreach ($categoryList[$categoryId] as $checkQuestionId) { |
684 | 678 | if ((int) $checkQuestionId === (int) $questionCheck->iid) { |
685 | 679 | break; |
686 | 680 | } |
687 | 681 | $count++; |
688 | 682 | } |
689 | 683 |
|
690 | | - //var_dump($count , $total); |
691 | 684 | if ($count === $total) { |
692 | 685 | $isLastQuestionInCategory = $categoryId; |
693 | 686 | if ($isLastQuestionInCategory) { |
|
717 | 710 | api_location($url); |
718 | 711 | } |
719 | 712 | } |
720 | | -//exit; |
721 | | -//var_dump($isLastQuestionInCategory); |
| 713 | + |
722 | 714 | if ($debug) { |
723 | 715 | error_log('8. Question list loaded '.print_r($questionList, 1)); |
724 | 716 | } |
|
728 | 720 | if (!empty($questionList)) { |
729 | 721 | $question_count = count($questionList); |
730 | 722 | } |
731 | | -//var_dump($current_question); |
| 723 | + |
732 | 724 | if ($current_question > $question_count) { |
733 | 725 | // If time control then don't change the current question, otherwise there will be a loop. |
734 | 726 | // @todo |
|
738 | 730 | } |
739 | 731 |
|
740 | 732 | if ($formSent && isset($_POST)) { |
741 | | - if ($debug) { |
742 | | - error_log('9. $formSent was set'); |
743 | | - } |
744 | | - |
745 | 733 | if (!is_array($exerciseResult)) { |
746 | 734 | $exerciseResult = []; |
747 | 735 | $exerciseResultCoordinates = []; |
@@ -1701,7 +1689,7 @@ function validate_all() { |
1701 | 1689 | if ($objExercise->type == ONE_PER_PAGE || ($objExercise->type != ONE_PER_PAGE && $i == 1)) { |
1702 | 1690 | echo Display::panelCollapse( |
1703 | 1691 | '<span>'.get_lang('ExerciseDescriptionLabel').'</span>', |
1704 | | - $objExercise->description, |
| 1692 | + Security::remove_XSS($objExercise->description), |
1705 | 1693 | 'exercise-description', |
1706 | 1694 | [], |
1707 | 1695 | 'description', |
|
0 commit comments