Merge branch 'MDL-26505_19' of git://github.com/timhunt/moodle into MOODLE_19_STABLE
This commit is contained in:
+1
-1
@@ -147,7 +147,7 @@
|
||||
$feedback = '';
|
||||
if ($quiz->grade && !is_null($bestgrade)) {
|
||||
if ($alloptions->scores) {
|
||||
$grade = "$bestgrade / $quiz->grade";
|
||||
$grade = round($bestgrade, $quiz->decimalpoints) . ' / ' . $quiz->grade;
|
||||
}
|
||||
if ($alloptions->overallfeedback) {
|
||||
$feedback = quiz_feedback_for_grade($bestgrade, $quiz->id);
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ function quiz_get_best_grade($quiz, $userid) {
|
||||
|
||||
// Need to detect errors/no result, without catching 0 scores.
|
||||
if (is_numeric($grade)) {
|
||||
return round($grade, $quiz->decimalpoints);
|
||||
return $grade + 0;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ function quiz_save_best_grade($quiz, $userid = null) {
|
||||
|
||||
// Calculate the best grade
|
||||
$bestgrade = quiz_calculate_best_grade($quiz, $attempts);
|
||||
$bestgrade = quiz_rescale_grade($bestgrade, $quiz);
|
||||
$bestgrade = quiz_rescale_grade($bestgrade, $quiz, false);
|
||||
|
||||
// Save the best grade in the database
|
||||
if ($grade = get_record('quiz_grades', 'quiz', $quiz->id, 'userid', $userid)) {
|
||||
|
||||
+3
-3
@@ -267,11 +267,11 @@
|
||||
}
|
||||
|
||||
// Ouside the if because we may be showing feedback but not grades.
|
||||
$attemptgrade = quiz_rescale_grade($attempt->sumgrades, $quiz);
|
||||
$attemptgrade = quiz_rescale_grade($attempt->sumgrades, $quiz, false);
|
||||
|
||||
if ($gradecolumn) {
|
||||
if ($attemptoptions->scores && $attempt->timefinish > 0) {
|
||||
$formattedgrade = $attemptgrade;
|
||||
$formattedgrade = round($attemptgrade, $quiz->decimalpoints);
|
||||
// highlight the highest grade if appropriate
|
||||
if ($overallstats && $numattempts > 1 && !is_null($mygrade) && $attemptgrade == $mygrade && $quiz->grademethod == QUIZ_GRADEHIGHEST) {
|
||||
$table->rowclass[$attempt->attempt] = 'bestrow';
|
||||
@@ -313,7 +313,7 @@
|
||||
if ($available && $moreattempts) {
|
||||
$a = new stdClass;
|
||||
$a->method = quiz_get_grading_option_name($quiz->grademethod);
|
||||
$a->mygrade = $mygrade;
|
||||
$a->mygrade = round($mygrade, $quiz->decimalpoints);
|
||||
$a->quizgrade = $quiz->grade;
|
||||
$resultinfo .= print_heading(get_string('gradesofar', 'quiz', $a), '', 2, 'main', true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user