diff --git a/main/exercise/FillBlanksCombination.php b/main/exercise/FillBlanksCombination.php new file mode 100644 index 0000000000..6e643ad81e --- /dev/null +++ b/main/exercise/FillBlanksCombination.php @@ -0,0 +1,21 @@ +type = FILL_IN_BLANKS_COMBINATION; + $this->isContent = $this->getIsContent(); + } +} diff --git a/main/exercise/FillBlanksGlobal.php b/main/exercise/FillBlanksGlobal.php deleted file mode 100644 index 6a8e297ec7..0000000000 --- a/main/exercise/FillBlanksGlobal.php +++ /dev/null @@ -1,21 +0,0 @@ -type = FILL_IN_BLANKS_GLOBAL; - $this->isContent = $this->getIsContent(); - } -} diff --git a/main/exercise/HotSpotCombination.php b/main/exercise/HotSpotCombination.php new file mode 100644 index 0000000000..348adb32f9 --- /dev/null +++ b/main/exercise/HotSpotCombination.php @@ -0,0 +1,20 @@ +type = HOT_SPOT_COMBINATION; + } +} diff --git a/main/exercise/HotSpotGlobal.php b/main/exercise/HotSpotGlobal.php deleted file mode 100644 index c6dad26464..0000000000 --- a/main/exercise/HotSpotGlobal.php +++ /dev/null @@ -1,20 +0,0 @@ -type = HOT_SPOT_GLOBAL; - } -} diff --git a/main/exercise/MatchingGlobal.php b/main/exercise/MatchingCombination.php similarity index 51% rename from main/exercise/MatchingGlobal.php rename to main/exercise/MatchingCombination.php index 16768a7a0b..32e6aa7b0d 100644 --- a/main/exercise/MatchingGlobal.php +++ b/main/exercise/MatchingCombination.php @@ -2,12 +2,12 @@ /* For licensing terms, see /license.txt */ /** - * MatchingGlobal. + * MatchingCombination. */ -class MatchingGlobal extends Matching +class MatchingCombination extends Matching { - public $typePicture = 'matching_global.png'; - public $explanationLangVar = 'MatchingGlobal'; + public $typePicture = 'matching_co.png'; + public $explanationLangVar = 'MatchingCombination'; /** * Constructor. @@ -15,7 +15,7 @@ class MatchingGlobal extends Matching public function __construct() { parent::__construct(); - $this->type = MATCHING_GLOBAL; + $this->type = MATCHING_COMBINATION; $this->isContent = $this->getIsContent(); } } diff --git a/main/exercise/MatchingDraggable.php b/main/exercise/MatchingDraggable.php index f1c4321535..879bc97eec 100644 --- a/main/exercise/MatchingDraggable.php +++ b/main/exercise/MatchingDraggable.php @@ -206,7 +206,7 @@ class MatchingDraggable extends Question $form->addHtml(''); - if (MATCHING_DRAGGABLE_GLOBAL === $this->type) { + if (MATCHING_DRAGGABLE_COMBINATION === $this->type) { //only 1 answer the all deal ... $form->addText('questionWeighting', get_lang('Score'), true, ['value' => 10]); if (!empty($this->iid)) { @@ -273,7 +273,7 @@ class MatchingDraggable extends Question ); } - if (MATCHING_DRAGGABLE_GLOBAL == $this->type) { + if (MATCHING_DRAGGABLE_COMBINATION == $this->type) { $this->weighting = $form->getSubmitValue('questionWeighting'); } diff --git a/main/exercise/MatchingDraggableCombination.php b/main/exercise/MatchingDraggableCombination.php new file mode 100644 index 0000000000..225f7a76c4 --- /dev/null +++ b/main/exercise/MatchingDraggableCombination.php @@ -0,0 +1,21 @@ +type = MATCHING_DRAGGABLE_COMBINATION; + $this->isContent = $this->getIsContent(); + } +} diff --git a/main/exercise/MatchingDraggableGlobal.php b/main/exercise/MatchingDraggableGlobal.php deleted file mode 100644 index cec69a6622..0000000000 --- a/main/exercise/MatchingDraggableGlobal.php +++ /dev/null @@ -1,21 +0,0 @@ -type = MATCHING_DRAGGABLE_GLOBAL; - $this->isContent = $this->getIsContent(); - } -} diff --git a/main/exercise/MultipleAnswerDropdownCombination.php b/main/exercise/MultipleAnswerDropdownCombination.php new file mode 100644 index 0000000000..0e5d71b592 --- /dev/null +++ b/main/exercise/MultipleAnswerDropdownCombination.php @@ -0,0 +1,18 @@ +type = MULTIPLE_ANSWER_DROPDOWN_COMBINATION; + } +} diff --git a/main/exercise/MultipleAnswerDropdownGlobal.php b/main/exercise/MultipleAnswerDropdownGlobal.php deleted file mode 100644 index aa3de8ebc0..0000000000 --- a/main/exercise/MultipleAnswerDropdownGlobal.php +++ /dev/null @@ -1,16 +0,0 @@ -type = MULTIPLE_ANSWER_DROPDOWN_GLOBAL; - } -} diff --git a/main/exercise/answer.class.php b/main/exercise/answer.class.php index 2bdf3f9681..7133fcc354 100755 --- a/main/exercise/answer.class.php +++ b/main/exercise/answer.class.php @@ -770,7 +770,7 @@ class Answer $questionType = $this->getQuestionType(); if (in_array( $questionType, - [MATCHING, MATCHING_DRAGGABLE, MATCHING_GLOBAL, MATCHING_DRAGGABLE_GLOBAL] + [MATCHING, MATCHING_DRAGGABLE, MATCHING_COMBINATION, MATCHING_DRAGGABLE_COMBINATION] )) { $answer = new Answer($this->questionId, $courseId, $this->exercise, false); $answer->read(); diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index 5ac5316815..41ccda784e 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -3900,16 +3900,6 @@ class Exercise $answerMatching[$real_answer['iid']] = $real_answer['answer']; } - // Get correct answers for multiple answers. - $sql = "SELECT iid - FROM $table_ans - WHERE question_id = $questionId AND correct = 1"; - $resMAnswer = Database::query($sql); - $correctMultipleAnswers = []; - while ($rowMAanswer = Database::fetch_array($resMAnswer)) { - $correctMultipleAnswers[] = $rowMAanswer['iid']; - } - // Get first answer needed for global question, no matter the answer shuffle option; $firstAnswer = []; if ($answerType == MULTIPLE_ANSWER_COMBINATION || @@ -3931,7 +3921,7 @@ class Exercise $organs_at_risk_hit = 0; $questionScore = 0; $orderedHotSpots = []; - if (in_array($answerType, [HOT_SPOT_GLOBAL, HOT_SPOT, ANNOTATION])) { + if (in_array($answerType, [HOT_SPOT_COMBINATION, HOT_SPOT, ANNOTATION])) { $orderedHotSpots = $em->getRepository('ChamiloCoreBundle:TrackEHotspot')->findBy( [ 'hotspotQuestionId' => $questionId, @@ -3942,8 +3932,8 @@ class Exercise ); } - if (in_array($answerType, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) { - if (MULTIPLE_ANSWER_DROPDOWN_GLOBAL == $answerType) { + if (in_array($answerType, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_COMBINATION])) { + if (MULTIPLE_ANSWER_DROPDOWN_COMBINATION == $answerType) { $questionScore = $questionWeighting; } @@ -3971,7 +3961,7 @@ class Exercise $correctChoices = array_keys($correctChoices); - if (MULTIPLE_ANSWER_DROPDOWN_GLOBAL == $answerType + if (MULTIPLE_ANSWER_DROPDOWN_COMBINATION == $answerType && (array_diff($studentChoices, $correctChoices) || array_diff($correctChoices, $studentChoices)) ) { $questionScore = 0; @@ -4165,7 +4155,6 @@ class Exercise $totalScore += $answerWeighting; break; case GLOBAL_MULTIPLE_ANSWER: - $validAnswer = false; if ($from_database) { $choice = []; $sql = "SELECT answer FROM $TBL_TRACK_ATTEMPT @@ -4174,20 +4163,14 @@ class Exercise while ($row = Database::fetch_array($resultans)) { $choice[$row['answer']] = 1; } - if (!empty($choice) && count($choice) == count($correctMultipleAnswers)) { - $validAnswer = (0 == count(array_diff(array_keys($choice), $correctMultipleAnswers))); - } $studentChoice = isset($choice[$answerAutoId]) ? $choice[$answerAutoId] : null; $real_answers[$answerId] = (bool) $studentChoice; - if ($studentChoice && $validAnswer) { + if ($studentChoice) { $questionScore += $answerWeighting; } } else { - if (!empty($choice) && count($choice) == count($correctMultipleAnswers)) { - $validAnswer = (0 == count(array_diff(array_keys($choice), $correctMultipleAnswers))); - } $studentChoice = isset($choice[$answerAutoId]) ? $choice[$answerAutoId] : null; - if (isset($studentChoice) && $validAnswer) { + if (isset($studentChoice)) { $questionScore += $answerWeighting; } $real_answers[$answerId] = (bool) $studentChoice; @@ -4262,7 +4245,7 @@ class Exercise } break; case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: $str = ''; $answerFromDatabase = ''; if ($from_database) { @@ -4762,8 +4745,8 @@ class Exercise break; case DRAGGABLE: case MATCHING_DRAGGABLE: - case MATCHING_DRAGGABLE_GLOBAL: - case MATCHING_GLOBAL: + case MATCHING_DRAGGABLE_COMBINATION: + case MATCHING_COMBINATION: case MATCHING: if ($from_database) { $sql = "SELECT iid, answer, id_auto @@ -4910,8 +4893,8 @@ class Exercise } switch ($answerType) { case MATCHING: - case MATCHING_GLOBAL: - case MATCHING_DRAGGABLE_GLOBAL: + case MATCHING_COMBINATION: + case MATCHING_DRAGGABLE_COMBINATION: case MATCHING_DRAGGABLE: if (RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT_NO_FEEDBACK == $this->results_disabled) { if (false === $showTotalScoreAndUserChoicesInLastAttempt && empty($s_user_answer)) { @@ -4937,7 +4920,7 @@ class Exercise if ($this->showExpectedChoice()) { if ($this->showExpectedChoiceColumn()) { echo ''; - if (in_array($answerType, [MATCHING, MATCHING_GLOBAL, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_GLOBAL])) { + if (in_array($answerType, [MATCHING, MATCHING_COMBINATION, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_COMBINATION])) { if (isset($real_list[$i_answer_correct_answer]) && $showTotalScoreAndUserChoicesInLastAttempt == true ) { @@ -4950,7 +4933,7 @@ class Exercise } echo ''.$status.''; } else { - if (in_array($answerType, [MATCHING, MATCHING_GLOBAL, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_GLOBAL])) { + if (in_array($answerType, [MATCHING, MATCHING_COMBINATION, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_COMBINATION])) { if (isset($real_list[$i_answer_correct_answer]) && $showTotalScoreAndUserChoicesInLastAttempt === true ) { @@ -4996,7 +4979,7 @@ class Exercise echo ''.$counterAnswer.''; echo ''.$status.''; echo ''; - if (in_array($answerType, [MATCHING, MATCHING_GLOBAL, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_GLOBAL])) { + if (in_array($answerType, [MATCHING, MATCHING_COMBINATION, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_COMBINATION])) { if (isset($real_list[$i_answer_correct_answer]) && $showTotalScoreAndUserChoicesInLastAttempt === true ) { @@ -5040,7 +5023,7 @@ class Exercise } break; case HOT_SPOT: - case HOT_SPOT_GLOBAL: + case HOT_SPOT_COMBINATION: if ($from_database) { $TBL_TRACK_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); // Check auto id @@ -5233,7 +5216,7 @@ class Exercise if ($show_result) { if ('exercise_result' === $from) { // Display answers (if not matching type, or if the answer is correct) - if (!in_array($answerType, [MATCHING, MATCHING_GLOBAL, DRAGGABLE, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_GLOBAL]) || + if (!in_array($answerType, [MATCHING, MATCHING_COMBINATION, DRAGGABLE, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_COMBINATION]) || $answerCorrect ) { if (in_array( @@ -5305,7 +5288,7 @@ class Exercise $results_disabled, $showTotalScoreAndUserChoicesInLastAttempt ); - } elseif (in_array($answerType, [FILL_IN_BLANKS, FILL_IN_BLANKS_GLOBAL])) { + } elseif (in_array($answerType, [FILL_IN_BLANKS, FILL_IN_BLANKS_COMBINATION])) { ExerciseShowFunctions::display_fill_in_blanks_answer( $this, $feedback_type, @@ -5359,7 +5342,7 @@ class Exercise $results_disabled, $questionScore ); - } elseif (in_array($answerType, [HOT_SPOT, HOT_SPOT_GLOBAL])) { + } elseif (in_array($answerType, [HOT_SPOT, HOT_SPOT_COMBINATION])) { $correctAnswerId = 0; /** @var TrackEHotspot $hotspot */ foreach ($orderedHotSpots as $correctAnswerId => $hotspot) { @@ -5538,7 +5521,7 @@ class Exercise error_log(__LINE__.' first', 0); } } - } elseif (in_array($answerType, [MATCHING, MATCHING_GLOBAL, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_GLOBAL])) { + } elseif (in_array($answerType, [MATCHING, MATCHING_COMBINATION, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_COMBINATION])) { echo ''; echo Display::tag('td', $answerMatching[$answerId]); echo Display::tag( @@ -5701,7 +5684,7 @@ class Exercise } break; case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: ExerciseShowFunctions::display_fill_in_blanks_answer( $this, $feedback_type, @@ -5761,7 +5744,7 @@ class Exercise '; break; case HOT_SPOT: - case HOT_SPOT_GLOBAL: + case HOT_SPOT_COMBINATION: $correctAnswerId = 0; /** @var TrackEHotspot $hotspot */ foreach ($orderedHotSpots as $correctAnswerId => $hotspot) { @@ -5918,8 +5901,8 @@ class Exercise break; case DRAGGABLE: case MATCHING_DRAGGABLE: - case MATCHING_DRAGGABLE_GLOBAL: - case MATCHING_GLOBAL: + case MATCHING_DRAGGABLE_COMBINATION: + case MATCHING_COMBINATION: case MATCHING: echo ''; echo Display::tag('td', $answerMatching[$answerId]); @@ -5948,7 +5931,7 @@ class Exercise } // end for that loops over all answers of the current question // It validates unique score when all answers are correct for global questions - if (FILL_IN_BLANKS_GLOBAL === $answerType) { + if (FILL_IN_BLANKS_COMBINATION === $answerType) { $questionScore = ExerciseLib::getUserQuestionScoreGlobal( $answerType, $listCorrectAnswers, @@ -5957,7 +5940,7 @@ class Exercise $questionWeighting ); } - if (HOT_SPOT_GLOBAL === $answerType) { + if (HOT_SPOT_COMBINATION === $answerType) { $listCorrectAnswers = isset($exerciseResultCoordinates[$questionId]) ? $exerciseResultCoordinates[$questionId] : []; $questionScore = ExerciseLib::getUserQuestionScoreGlobal( $answerType, @@ -5969,7 +5952,7 @@ class Exercise $nbrAnswers ); } - if (in_array($answerType, [MATCHING_GLOBAL, MATCHING_DRAGGABLE_GLOBAL])) { + if (in_array($answerType, [MATCHING_COMBINATION, MATCHING_DRAGGABLE_COMBINATION])) { $questionScore = ExerciseLib::getUserQuestionScoreGlobal( $answerType, $matchingCorrectAnswers[$questionId], @@ -6022,7 +6005,7 @@ class Exercise // we use the results from the session (from_db=0) // TODO Change this, because it is wrong to show the user // some results that haven't been stored in the database yet - if (in_array($answerType, [HOT_SPOT, HOT_SPOT_ORDER, HOT_SPOT_DELINEATION, HOT_SPOT_GLOBAL])) { + if (in_array($answerType, [HOT_SPOT, HOT_SPOT_ORDER, HOT_SPOT_DELINEATION, HOT_SPOT_COMBINATION])) { if ($debug) { error_log('$from AND this is a hotspot kind of question '); } @@ -6157,7 +6140,7 @@ class Exercise $relPath = api_get_path(WEB_CODE_PATH); - if (in_array($answerType, [HOT_SPOT, HOT_SPOT_GLOBAL, HOT_SPOT_ORDER])) { + if (in_array($answerType, [HOT_SPOT, HOT_SPOT_COMBINATION, HOT_SPOT_ORDER])) { // We made an extra table for the answers if ($show_result) { echo ''; @@ -6284,12 +6267,12 @@ class Exercise MULTIPLE_ANSWER, GLOBAL_MULTIPLE_ANSWER, MULTIPLE_ANSWER_DROPDOWN, - MULTIPLE_ANSWER_DROPDOWN_GLOBAL, + MULTIPLE_ANSWER_DROPDOWN_COMBINATION, ] ) ) { if ($choice != 0) { - if (in_array($answerType, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) { + if (in_array($answerType, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_COMBINATION])) { $reply = array_values($choice); } else { $reply = array_keys($choice); @@ -6348,7 +6331,7 @@ class Exercise $questionDuration ); } - } elseif (in_array($answerType, [MATCHING, MATCHING_GLOBAL, DRAGGABLE, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_GLOBAL])) { + } elseif (in_array($answerType, [MATCHING, MATCHING_COMBINATION, DRAGGABLE, MATCHING_DRAGGABLE, MATCHING_DRAGGABLE_COMBINATION])) { if (isset($matching)) { foreach ($matching as $j => $val) { Event::saveQuestionAttempt( @@ -6413,7 +6396,7 @@ class Exercise ) { $answer = $choice; Event::saveQuestionAttempt($questionScore, $answer, $quesId, $exeId, 0, $this->iid, false, $questionDuration); - } elseif (in_array($answerType, [HOT_SPOT, HOT_SPOT_GLOBAL, ANNOTATION])) { + } elseif (in_array($answerType, [HOT_SPOT, HOT_SPOT_COMBINATION, ANNOTATION])) { $answer = []; if (isset($exerciseResultCoordinates[$questionId]) && !empty($exerciseResultCoordinates[$questionId])) { if ($debug) { @@ -8626,13 +8609,13 @@ class Exercise if ($onlyCorrect) { switch ($objAnswer->getQuestionType()) { case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: $isCorrect = FillBlanks::isCorrect($answer['answer']); break; case MATCHING: - case MATCHING_GLOBAL: + case MATCHING_COMBINATION: case DRAGGABLE: - case MATCHING_DRAGGABLE_GLOBAL: + case MATCHING_DRAGGABLE_COMBINATION: case MATCHING_DRAGGABLE: $isCorrect = Matching::isCorrect( $answer['position'], @@ -10832,7 +10815,7 @@ class Exercise if ($question) { switch ($question->type) { case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: $option['answer'] = $this->fill_in_blank_answer_to_string($option['answer']); break; } diff --git a/main/exercise/exercise_show.php b/main/exercise/exercise_show.php index 69ac1f5afd..0f33d28567 100755 --- a/main/exercise/exercise_show.php +++ b/main/exercise/exercise_show.php @@ -442,20 +442,20 @@ foreach ($questionList as $questionId) { case MULTIPLE_ANSWER: case MULTIPLE_ANSWER_TRUE_FALSE: case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: case CALCULATED_ANSWER: case GLOBAL_MULTIPLE_ANSWER: case FREE_ANSWER: case UPLOAD_ANSWER: case ORAL_EXPRESSION: case MATCHING: - case MATCHING_GLOBAL: + case MATCHING_COMBINATION: case DRAGGABLE: case READING_COMPREHENSION: case MATCHING_DRAGGABLE: - case MATCHING_DRAGGABLE_GLOBAL: + case MATCHING_DRAGGABLE_COMBINATION: case MULTIPLE_ANSWER_DROPDOWN: - case MULTIPLE_ANSWER_DROPDOWN_GLOBAL: + case MULTIPLE_ANSWER_DROPDOWN_COMBINATION: $question_result = $objExercise->manage_answer( $id, $questionId, @@ -492,7 +492,7 @@ foreach ($questionList as $questionId) { $totalScore += $questionResult['score']; break; case HOT_SPOT: - case HOT_SPOT_GLOBAL: + case HOT_SPOT_COMBINATION: if ($show_results || $showTotalScoreAndUserChoicesInLastAttempt) { // echo '
'; } @@ -596,7 +596,7 @@ foreach ($questionList as $questionId) { echo '
'; } - if ($show_results && !in_array($answerType, [HOT_SPOT_GLOBAL, HOT_SPOT])) { + if ($show_results && !in_array($answerType, [HOT_SPOT_COMBINATION, HOT_SPOT])) { echo ''; } diff --git a/main/exercise/exercise_submit.php b/main/exercise/exercise_submit.php index a7fa9cf8c1..d1968c0427 100755 --- a/main/exercise/exercise_submit.php +++ b/main/exercise/exercise_submit.php @@ -1243,13 +1243,13 @@ if (!empty($questionList)) { if ($current_question != $i) { continue; } else { - if (in_array($selectType, [HOT_SPOT, HOT_SPOT_GLOBAL, HOT_SPOT_DELINEATION])) { + if (in_array($selectType, [HOT_SPOT, HOT_SPOT_COMBINATION, HOT_SPOT_DELINEATION])) { $number_of_hotspot_questions++; } break; } } else { - if (in_array($selectType, [HOT_SPOT, HOT_SPOT_GLOBAL, HOT_SPOT_DELINEATION])) { + if (in_array($selectType, [HOT_SPOT, HOT_SPOT_COMBINATION, HOT_SPOT_DELINEATION])) { $number_of_hotspot_questions++; } } diff --git a/main/exercise/export/qti2/qti2_classes.php b/main/exercise/export/qti2/qti2_classes.php index c8ad63868f..0a2e0ea32c 100755 --- a/main/exercise/export/qti2/qti2_classes.php +++ b/main/exercise/export/qti2/qti2_classes.php @@ -45,7 +45,7 @@ class Ims2Question extends Question return $answer; case MCMA: case MULTIPLE_ANSWER_DROPDOWN: - case MULTIPLE_ANSWER_DROPDOWN_GLOBAL: + case MULTIPLE_ANSWER_DROPDOWN_COMBINATION: $answer = new ImsAnswerMultipleChoice($this->iid); return $answer; @@ -67,7 +67,7 @@ class Ims2Question extends Question return $answer; case HOT_SPOT: - case HOT_SPOT_GLOBAL: + case HOT_SPOT_COMBINATION: $answer = new ImsAnswerHotspot($this->iid); return $answer; @@ -135,7 +135,7 @@ class ImsAnswerMultipleChoice extends Answer implements ImsAnswerInterface { $this->answerList = $this->getAnswersList(true); $type = $this->getQuestionType(); - if (in_array($type, [MCMA, MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) { + if (in_array($type, [MCMA, MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_COMBINATION])) { $cardinality = 'multiple'; } else { $cardinality = 'single'; @@ -158,7 +158,7 @@ class ImsAnswerMultipleChoice extends Answer implements ImsAnswerInterface if (is_array($this->answerList)) { $out .= ' getQuestionType()) { + if (MULTIPLE_ANSWER_DROPDOWN_COMBINATION == $this->getQuestionType()) { $out .= ' defaultValue="'.$question->selectWeighting().'"'; } diff --git a/main/exercise/export/qti2/qti2_export.php b/main/exercise/export/qti2/qti2_export.php index 897e25441b..b455349a7e 100755 --- a/main/exercise/export/qti2/qti2_export.php +++ b/main/exercise/export/qti2/qti2_export.php @@ -462,7 +462,7 @@ function export_question_qti($questionId, $standalone = true) || $qst instanceof MultipleAnswer || $qst instanceof FreeAnswer || $qst instanceof MultipleAnswerDropdown - || $qst instanceof MultipleAnswerDropdownGlobal + || $qst instanceof MultipleAnswerDropdownCombination ; if (!$isValid) { diff --git a/main/exercise/export/scorm/ScormQuestion.php b/main/exercise/export/scorm/ScormQuestion.php index 9ee31547d7..98aad5c7a8 100644 --- a/main/exercise/export/scorm/ScormQuestion.php +++ b/main/exercise/export/scorm/ScormQuestion.php @@ -93,7 +93,7 @@ class ScormQuestion extends Question $this->answer->questionJSId = $this->js_id; break; case HOT_SPOT: - case HOT_SPOT_GLOBAL: + case HOT_SPOT_COMBINATION: $this->answer = new ScormAnswerHotspot($this->iid); $this->answer->questionJSId = $this->js_id; break; @@ -208,7 +208,7 @@ class ScormQuestion extends Question $js .= $script;*/ break; case HOT_SPOT: - case HOT_SPOT_GLOBAL: + case HOT_SPOT_COMBINATION: //put the max score to 0 to avoid discounting the points of //non-exported quiz types in the SCORM $weight = 0; diff --git a/main/exercise/fill_blanks.class.php b/main/exercise/fill_blanks.class.php index b737fc3ba2..6153ecb51e 100755 --- a/main/exercise/fill_blanks.class.php +++ b/main/exercise/fill_blanks.class.php @@ -63,7 +63,7 @@ class FillBlanks extends Question } } - $questionTypes = [FILL_IN_BLANKS => 'fillblanks', FILL_IN_BLANKS_GLOBAL => 'fillblanks_global']; + $questionTypes = [FILL_IN_BLANKS => 'fillblanks', FILL_IN_BLANKS_COMBINATION => 'fillblanks_combination']; echo ''; - } elseif (in_array($objQuestion->type, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_GLOBAL])) { + } elseif (in_array($objQuestion->type, [MULTIPLE_ANSWER_DROPDOWN, MULTIPLE_ANSWER_DROPDOWN_COMBINATION])) { $url = 'admin.php?' .api_get_cidreq().'&' .http_build_query(['exerciseId' => $exerciseId, 'page' => $page, 'mad_admin' => $objQuestion->iid]); diff --git a/main/exercise/stats.php b/main/exercise/stats.php index 3ef5ec9226..ee4cbf333e 100755 --- a/main/exercise/stats.php +++ b/main/exercise/stats.php @@ -157,7 +157,7 @@ if (!empty($questionList)) { // Overwriting values depending of the question switch ($questionObj->type) { case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: $answer_info_db = $answer_info; $answer_info = substr($answer_info, 0, strpos($answer_info, '::')); $correct_answer = $is_correct; @@ -240,7 +240,7 @@ if (!empty($questionList)) { } break; case HOT_SPOT: - case HOT_SPOT_GLOBAL: + case HOT_SPOT_COMBINATION: if ($answer_id == 1) { $data[$id]['name'] = cut($questionObj->question, 100); } else { diff --git a/main/exercise/upload_exercise.php b/main/exercise/upload_exercise.php index f7acad6bdd..d072e52c56 100755 --- a/main/exercise/upload_exercise.php +++ b/main/exercise/upload_exercise.php @@ -86,9 +86,9 @@ function lp_upload_quiz_main() UNIQUE_ANSWER => get_lang('UniqueSelect'), MULTIPLE_ANSWER => get_lang('MultipleSelect'), MULTIPLE_ANSWER_DROPDOWN => get_lang('MultipleAnswerDropdown'), - MULTIPLE_ANSWER_DROPDOWN_GLOBAL => get_lang('MultipleAnswerDropdownGlobal'), + MULTIPLE_ANSWER_DROPDOWN_COMBINATION => get_lang('MultipleAnswerDropdownCombination'), FILL_IN_BLANKS => get_lang('FillBlanks'), - FILL_IN_BLANKS_GLOBAL => get_lang('FillBlanksGlobal'), + FILL_IN_BLANKS_COMBINATION => get_lang('FillBlanksCombination'), MATCHING => get_lang('Matching'), FREE_ANSWER => get_lang('FreeAnswer'), GLOBAL_MULTIPLE_ANSWER => get_lang('GlobalMultipleAnswer'), @@ -334,11 +334,11 @@ function lp_upload_quiz_action_handling() case MULTIPLE_ANSWER_DROPDOWN: $answer = new MultipleAnswerDropdown(); break; - case MULTIPLE_ANSWER_DROPDOWN_GLOBAL: - $answer = new MultipleAnswerDropdownGlobal(); + case MULTIPLE_ANSWER_DROPDOWN_COMBINATION: + $answer = new MultipleAnswerDropdownCombination(); break; case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: $answer = new FillBlanks(); $question_description_text = ''; break; @@ -371,7 +371,7 @@ function lp_upload_quiz_action_handling() switch ($detectQuestionType) { case GLOBAL_MULTIPLE_ANSWER: case MULTIPLE_ANSWER_DROPDOWN: - case MULTIPLE_ANSWER_DROPDOWN_GLOBAL: + case MULTIPLE_ANSWER_DROPDOWN_COMBINATION: case MULTIPLE_ANSWER: case UNIQUE_ANSWER: $total = 0; @@ -434,7 +434,7 @@ function lp_upload_quiz_action_handling() //$total = $total - $score; } break; - case MULTIPLE_ANSWER_DROPDOWN_GLOBAL: + case MULTIPLE_ANSWER_DROPDOWN_COMBINATION: $score = 0; break; } @@ -463,7 +463,7 @@ function lp_upload_quiz_action_handling() if ($questionObj) { switch ($detectQuestionType) { case GLOBAL_MULTIPLE_ANSWER: - case MULTIPLE_ANSWER_DROPDOWN_GLOBAL: + case MULTIPLE_ANSWER_DROPDOWN_COMBINATION: $questionObj->updateWeighting($globalScore); break; case UNIQUE_ANSWER: @@ -485,7 +485,7 @@ function lp_upload_quiz_action_handling() } break; case FILL_IN_BLANKS: - case FILL_IN_BLANKS_GLOBAL: + case FILL_IN_BLANKS_COMBINATION: $fillInScoreList = []; $size = []; $globalScore = 0; diff --git a/main/img/icons/64/fill_in_blanks_co.png b/main/img/icons/64/fill_in_blanks_co.png new file mode 100644 index 0000000000..a2f157c832 Binary files /dev/null and b/main/img/icons/64/fill_in_blanks_co.png differ diff --git a/main/img/icons/64/fill_in_blanks_co_na.png b/main/img/icons/64/fill_in_blanks_co_na.png new file mode 100644 index 0000000000..10ef959404 Binary files /dev/null and b/main/img/icons/64/fill_in_blanks_co_na.png differ diff --git a/main/img/icons/64/hotspot_co.png b/main/img/icons/64/hotspot_co.png new file mode 100644 index 0000000000..9d23eb49b2 Binary files /dev/null and b/main/img/icons/64/hotspot_co.png differ diff --git a/main/img/icons/64/hotspot_co_na.png b/main/img/icons/64/hotspot_co_na.png new file mode 100644 index 0000000000..138f29b565 Binary files /dev/null and b/main/img/icons/64/hotspot_co_na.png differ diff --git a/main/img/icons/64/matching_co.png b/main/img/icons/64/matching_co.png new file mode 100644 index 0000000000..e2e5a6ac26 Binary files /dev/null and b/main/img/icons/64/matching_co.png differ diff --git a/main/img/icons/64/matching_co_na.png b/main/img/icons/64/matching_co_na.png new file mode 100644 index 0000000000..8d3a78c94d Binary files /dev/null and b/main/img/icons/64/matching_co_na.png differ diff --git a/main/img/icons/64/matchingdrag_co.png b/main/img/icons/64/matchingdrag_co.png new file mode 100644 index 0000000000..6e8cc795a5 Binary files /dev/null and b/main/img/icons/64/matchingdrag_co.png differ diff --git a/main/img/icons/64/matchingdrag_co_na.png b/main/img/icons/64/matchingdrag_co_na.png new file mode 100644 index 0000000000..284cbdfbcc Binary files /dev/null and b/main/img/icons/64/matchingdrag_co_na.png differ diff --git a/main/img/icons/64/mcma_dropdown_co.png b/main/img/icons/64/mcma_dropdown_co.png new file mode 100644 index 0000000000..045bd4bd96 Binary files /dev/null and b/main/img/icons/64/mcma_dropdown_co.png differ diff --git a/main/img/icons/64/mcma_dropdown_co_na.png b/main/img/icons/64/mcma_dropdown_co_na.png new file mode 100644 index 0000000000..5b3d3a1f08 Binary files /dev/null and b/main/img/icons/64/mcma_dropdown_co_na.png differ diff --git a/main/inc/ajax/exercise.ajax.php b/main/inc/ajax/exercise.ajax.php index 44e3c6dad9..1a0c1a2b03 100755 --- a/main/inc/ajax/exercise.ajax.php +++ b/main/inc/ajax/exercise.ajax.php @@ -751,7 +751,7 @@ switch ($action) { $session_id, $my_question_id ); - if (in_array($objQuestionTmp->type, [HOT_SPOT, HOT_SPOT_GLOBAL])) { + if (in_array($objQuestionTmp->type, [HOT_SPOT, HOT_SPOT_COMBINATION])) { Event::delete_attempt_hotspot( $exeId, api_get_user_id(), @@ -961,7 +961,7 @@ switch ($action) { } echo $id; echo '

'.$objQuestion->get_question_type_name().'

'; - if (in_array($objQuestion->type, [FILL_IN_BLANKS, FILL_IN_BLANKS_GLOBAL])) { + if (in_array($objQuestion->type, [FILL_IN_BLANKS, FILL_IN_BLANKS_COMBINATION])) { echo ''; } - if (in_array($objQuestion->type, [HOT_SPOT, HOT_SPOT_GLOBAL])) { + if (in_array($objQuestion->type, [HOT_SPOT, HOT_SPOT_COMBINATION])) { echo ''; } @@ -1021,7 +1021,7 @@ switch ($action) { } echo $id; echo '

'.$objQuestion->get_question_type_name().'

'; - if (in_array($objQuestion->type, [FILL_IN_BLANKS, FILL_IN_BLANKS_GLOBAL])) { + if (in_array($objQuestion->type, [FILL_IN_BLANKS, FILL_IN_BLANKS_COMBINATION])) { echo '