|
@@ -2137,6 +2137,8 @@ class Exercise
|
|
global $learnpath_id, $learnpath_item_id;
|
|
global $learnpath_id, $learnpath_item_id;
|
|
require_once api_get_path(LIBRARY_PATH).'geometry.lib.php';
|
|
require_once api_get_path(LIBRARY_PATH).'geometry.lib.php';
|
|
|
|
|
|
|
|
+ $em = Database::getManager();
|
|
|
|
+
|
|
$feedback_type = $this->selectFeedbackType();
|
|
$feedback_type = $this->selectFeedbackType();
|
|
$results_disabled = $this->selectResultsDisabled();
|
|
$results_disabled = $this->selectResultsDisabled();
|
|
|
|
|
|
@@ -2272,6 +2274,20 @@ class Exercise
|
|
|
|
|
|
$answer_correct_array = array();
|
|
$answer_correct_array = array();
|
|
|
|
|
|
|
|
+ $orderedHotspots = [];
|
|
|
|
+
|
|
|
|
+ if ($answerType == HOT_SPOT) {
|
|
|
|
+ $orderedHotspots = $em
|
|
|
|
+ ->getRepository('ChamiloCoreBundle:TrackEHotspot')
|
|
|
|
+ ->findBy([
|
|
|
|
+ 'hotspotQuestionId' => $questionId,
|
|
|
|
+ 'cId' => $course_id,
|
|
|
|
+ 'hotspotExeId' => $exeId
|
|
|
|
+ ],
|
|
|
|
+ ['hotspotId' => 'ASC']
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
|
|
for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
|
|
$answer = $objAnswerTmp->selectAnswer($answerId);
|
|
$answer = $objAnswerTmp->selectAnswer($answerId);
|
|
$answerComment = $objAnswerTmp->selectComment($answerId);
|
|
$answerComment = $objAnswerTmp->selectComment($answerId);
|
|
@@ -3223,13 +3239,20 @@ class Exercise
|
|
//}
|
|
//}
|
|
} elseif ($answerType == HOT_SPOT) {
|
|
} elseif ($answerType == HOT_SPOT) {
|
|
//if ($origin != 'learnpath') {
|
|
//if ($origin != 'learnpath') {
|
|
|
|
+ foreach ($orderedHotspots as $correctAnswerId => $hotspot) {
|
|
|
|
+ if ($hotspot->getHotspotAnswerId() == $answerAutoId) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
ExerciseShowFunctions::display_hotspot_answer(
|
|
ExerciseShowFunctions::display_hotspot_answer(
|
|
$feedback_type,
|
|
$feedback_type,
|
|
- $answerId,
|
|
|
|
|
|
+ ++$correctAnswerId,
|
|
$answer,
|
|
$answer,
|
|
$studentChoice,
|
|
$studentChoice,
|
|
$answerComment,
|
|
$answerComment,
|
|
- $results_disabled
|
|
|
|
|
|
+ $results_disabled,
|
|
|
|
+ $answerId
|
|
);
|
|
);
|
|
// }
|
|
// }
|
|
} elseif ($answerType == HOT_SPOT_ORDER) {
|
|
} elseif ($answerType == HOT_SPOT_ORDER) {
|