Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.2
-
Fix Version/s: None
-
Component/s: Lesson
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
Description
Zero figure (0) not considered a valid response in any Lesson question type.
See this discussion: http://moodle.org/mod/forum/discuss.php?d=106688
Well, I don't know if I am right here, but my problem was, that in a quiz, when '0' was the correct answer in either a numerical or calculated question (possibly in others, too) and a user either entered a value different from 0 or nothing then moodle didnt' show him the correct answer. (However, if the user entered a '0', moodle accepted the value as correct.)
Now I finally discovered the problem: In <moodleroot>\type\shortanswer\questiontype.php I replaced line 412 by the following:
// REPLACED because if correctanswer is a 0 then the correctanswer is not shown
// if ($correctanswer) {
if ($correctanswer || (is_numeric($correctanswer) && $correctanswer==0)) {
I cannot guarantee that this workaround has no side effects, but yet it works for me now. If you observe any side effects, let me know!
On the other hand, I dont really understand why this issue has not been fixed for so long, and why I need another login on tracker.moodle.org and cannot use the same login as on moodle.org. Well, but thats another thing... I love creating user accounts en masse
I use Moodle 1.9.3