mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
quiz and qtypes: Regressions from MDL-7308 since '0.0000000' is not empty() in PHP.
This commit is contained in:
parent
f3a076ded4
commit
26da840f6b
@ -168,7 +168,7 @@ class quiz_report_responses_table extends table_sql {
|
||||
'reviewquestion', $summary, 450, 650, get_string('reviewresponse', 'quiz'),
|
||||
'none', true);
|
||||
if (question_state_is_graded($stateforqinattempt)
|
||||
&& ($question->maxgrade != 0)){
|
||||
&& ($question->maxgrade > 0)){
|
||||
$grade = $stateforqinattempt->grade
|
||||
/ $question->maxgrade;
|
||||
$qclass = question_get_feedback_class($grade);
|
||||
@ -193,9 +193,9 @@ class quiz_report_responses_table extends table_sql {
|
||||
function col_feedbacktext($attempt){
|
||||
if ($attempt->timefinish) {
|
||||
if (!$this->is_downloading()) {
|
||||
return quiz_report_feedback_for_grade(quiz_rescale_grade($attempt->sumgrades, $this->quiz), $this->quiz->id);
|
||||
return quiz_report_feedback_for_grade(quiz_rescale_grade($attempt->sumgrades, $this->quiz, false), $this->quiz->id);
|
||||
} else {
|
||||
return strip_tags(quiz_report_feedback_for_grade(quiz_rescale_grade($attempt->sumgrades, $this->quiz), $this->quiz->id));
|
||||
return strip_tags(quiz_report_feedback_for_grade(quiz_rescale_grade($attempt->sumgrades, $this->quiz, false), $this->quiz->id));
|
||||
}
|
||||
} else {
|
||||
return '-';
|
||||
|
@ -777,10 +777,9 @@ class default_questiontype {
|
||||
|
||||
// ULPGC ecastro
|
||||
function get_fractional_grade(&$question, &$state) {
|
||||
$maxgrade = $question->maxgrade;
|
||||
$grade = $state->grade;
|
||||
if ($maxgrade) {
|
||||
return (float)($grade/$maxgrade);
|
||||
if ($question->maxgrade > 0) {
|
||||
return (float)($grade / $question->maxgrade);
|
||||
} else {
|
||||
return (float)$grade;
|
||||
}
|
||||
@ -908,7 +907,7 @@ class default_questiontype {
|
||||
}
|
||||
|
||||
$grade = '';
|
||||
if ($question->maxgrade and $options->scores) {
|
||||
if ($question->maxgrade > 0 && $options->scores) {
|
||||
if ($cmoptions->optionflags & QUESTION_ADAPTIVE) {
|
||||
if ($isgraded) {
|
||||
$grade = question_format_grade($cmoptions, $state->last_graded->grade).'/';
|
||||
@ -1148,7 +1147,7 @@ class default_questiontype {
|
||||
echo ' ';
|
||||
print_string('duplicateresponse', 'quiz');
|
||||
}
|
||||
if (!empty($question->maxgrade) && $options->scores) {
|
||||
if ($question->maxgrade > 0 && $options->scores) {
|
||||
if (question_state_is_graded($state->last_graded)) {
|
||||
// Display the grading details from the last graded state
|
||||
$grade = new stdClass;
|
||||
|
@ -309,7 +309,7 @@ class question_shortanswer_qtype extends default_questiontype {
|
||||
echo ' ';
|
||||
print_string('duplicateresponse', 'quiz');
|
||||
}
|
||||
if (!empty($question->maxgrade) && $options->scores) {
|
||||
if ($question->maxgrade > 0 && $options->scores) {
|
||||
if (question_state_is_graded($state->last_graded)) {
|
||||
// Display the grading details from the last graded state
|
||||
$grade = new stdClass;
|
||||
|
Loading…
x
Reference in New Issue
Block a user