Moodle

Zero figure (0) not considered a valid response in any Lesson question type

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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

Activity

Hide
Bernd added a comment -

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

Show
Bernd added a comment - 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
Hide
Martin Dougiamas added a comment -

Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.

Show
Martin Dougiamas added a comment - Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (2)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: