Merge branch 'ofaj' of github.com:chamilo/chamilo-lms into ofaj

ofaj
jmontoyaa 9 years ago
commit 4b62a892f2
  1. 3
      main/exercise/exercise.class.php
  2. 46
      main/exercise/hotspot_answers.as.php

@ -4322,6 +4322,9 @@ class Exercise
}
}
// force to show whether the choice is correct or not
$showTotalScoreAndUserChoicesInLastAttempt = true;
ExerciseShowFunctions::display_hotspot_answer(
$feedback_type,
$answerId,

@ -57,15 +57,47 @@ $data['image_height'] = $pictureHeight;
$data['courseCode'] = $_course['path'];
$data['hotspots'] = [];
$showScoreOptions = [
RESULT_DISABLE_SHOW_SCORE_ONLY,
RESULT_DISABLE_SHOW_FINAL_SCORE_ONLY_WITH_CATEGORIES,
RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT
];
$showExpectedChoice = !in_array($objExercise->results_disabled, $showScoreOptions);
if ($showExpectedChoice) {
$showTotalScoreAndUserChoicesInLastAttempt = true;
if ($objExercise->selectResultsDisabled() == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT) {
$showOnlyScore = true;
$showResults = true;
if ($objExercise->attempts > 0) {
$attempts = Event::getExerciseResultsByUser(
api_get_user_id(),
$objExercise->id,
api_get_course_int_id(),
api_get_session_id(),
$trackExerciseInfo['orig_lp_id'],
$trackExerciseInfo['orig_lp_item_id'],
'desc'
);
$numberAttempts = count($attempts);
$showTotalScoreAndUserChoicesInLastAttempt = false;
if ($numberAttempts >= $objExercise->attempts) {
$showResults = true;
$showOnlyScore = false;
$showTotalScoreAndUserChoicesInLastAttempt = true;
}
}
}
$hideExpectedAnswer = false;
if ($objExercise->selectFeedbackType() == 0 && $objExercise->selectResultsDisabled() == 2) {
$hideExpectedAnswer = true;
}
if ($objExercise->selectResultsDisabled() == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT) {
$hideExpectedAnswer = $showTotalScoreAndUserChoicesInLastAttempt ? false : true;
}
if (!$hideExpectedAnswer) {
$qb = $em->createQueryBuilder();
$qb
->select('a')

Loading…
Cancel
Save