Skip to content

Commit

Permalink
RemedialCourse: blocking_percentage added #18165 - refs BT#18165
Browse files Browse the repository at this point in the history
  • Loading branch information
carlangas159 committed Mar 16, 2021
1 parent 62c0af0 commit 1a69d9b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion main/exercise/exercise.class.php
Expand Up @@ -10945,12 +10945,18 @@ public function remedialCourseList($userId = 0, $review = false, $sessionId = 0)
if (false === $remedialField) {
return null;
}
// Check blocking exercise.
$extraFieldValue = new ExtraFieldValue('exercise');
$blockExercise = $extraFieldValue->get_values_by_handler_and_field_variable(
$this->iId,
'blocking_percentage'
);
$questionExcluded = [
FREE_ANSWER,
ORAL_EXPRESSION,
ANNOTATION,
];
$userId = empty($userId) ? api_get_user_id() : (int) $userId;
$userId = empty($userId) ? api_get_user_id() : (int)$userId;
$extraMessage = null;
$bestAttempt = [];
$exercise_stat_info = Event::getExerciseResultsByUser(
Expand Down Expand Up @@ -10984,6 +10990,14 @@ public function remedialCourseList($userId = 0, $review = false, $sessionId = 0)
}
}
}
// Check blocking exercise.
if ($blockExercise && isset($blockExercise['value']) && !empty($blockExercise['value'])) {
$blockPercentage = (int)$blockExercise['value'];
if ($attemp['total_percentage'] <= $blockPercentage) {
return null;

}
}
}
$percentSuccess = $this->selectPassPercentage();
$pass = ExerciseLib::isPassPercentageAttemptPassed(
Expand Down

0 comments on commit 1a69d9b

Please sign in to comment.