Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.4, 1.6.3, 1.6.4
    • Fix Version/s: 2.1
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_15_STABLE, MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Rank:
      3105

      Description

      I am using a 1.5.2 moodle version, but this bug is still present in the moodle.org Teacher's hands-on playground.

      When editing a calculated quiz question, there is a place for an optional unit. However, the indication of the unit does not affect the evaluation of the student's response to the question. this meas that if the numerical part of the answer is correct, the answer is considered correct whatever is present (or absent) as measurement unit.

      Moreover, the additional units seems not to be considered at all, since they disappear when the edit question page is reopened.

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Jeff Forssell (jeff.forssell at cfl.se) Monday, 13 February 2006, 08:11 PM:

          I am using the latest stable branch (beginning of feb) and have the same problem.

          When I set a correct answer: 13.3 tolerance: 0 and unit: mm

          and multiplicator: 0,1 for: cm

          it accepts: 13.3mm 13.3 mm ”13.3 mm” 13.3 mm 13,3mm 13,3 mm 1,33 cm 1,33cm but <b>even without any unit: 13.3

          I would expect it to say incorrect without unit or something when I have set a unit.</b>

          I haven't had a problem with the additional units disappearing. But I do think the help for the question type shold be expanded and include examples. (I would also like a more general acceptance of different numerical formats but that goes beyond this bug)

          From Gustav Delius (gwd2 at york.ac.uk) Monday, 13 February 2006, 08:47 PM:

          Help with the calculated question type would certainly be appreciated. I don't use it myself and have not investigated how it works. If you find out something about how it works, please contribute at http://docs.moodle.org/en/Calculated_question_developer_docs and if you can write teacher documentation for it, it should go to http://docs.moodle.org/en/mod/quiz/question#Calculated

          Show
          Martin Dougiamas added a comment - From Jeff Forssell (jeff.forssell at cfl.se) Monday, 13 February 2006, 08:11 PM: I am using the latest stable branch (beginning of feb) and have the same problem. When I set a correct answer: 13.3 tolerance: 0 and unit: mm and multiplicator: 0,1 for: cm it accepts: 13.3mm 13.3 mm ”13.3 mm” 13.3 mm 13,3mm 13,3 mm 1,33 cm 1,33cm but <b>even without any unit: 13.3 I would expect it to say incorrect without unit or something when I have set a unit.</b> I haven't had a problem with the additional units disappearing. But I do think the help for the question type shold be expanded and include examples. (I would also like a more general acceptance of different numerical formats but that goes beyond this bug) From Gustav Delius (gwd2 at york.ac.uk) Monday, 13 February 2006, 08:47 PM: Help with the calculated question type would certainly be appreciated. I don't use it myself and have not investigated how it works. If you find out something about how it works, please contribute at http://docs.moodle.org/en/Calculated_question_developer_docs and if you can write teacher documentation for it, it should go to http://docs.moodle.org/en/mod/quiz/question#Calculated
          Hide
          Jeff Forssell added a comment -

          This problem is still going on in 1.7 dev 20060920. Tim Would like a dsecription of How it should work. I'll try to make a description of what I'd like. Any other suggestions are wellcome.

          Show
          Jeff Forssell added a comment - This problem is still going on in 1.7 dev 20060920. Tim Would like a dsecription of How it should work. I'll try to make a description of what I'd like. Any other suggestions are wellcome.
          Hide
          Dustin Morris added a comment -

          I am having the same issue. I select the appropriate significant digits and it displays all of the digits. I also place the correct units in the optional section and alternative units. For example meters or m.

          But the quiz does not show the units or calculate the significant digits correctly.

          It works in numerical question type but not calculated question type.

          Show
          Dustin Morris added a comment - I am having the same issue. I select the appropriate significant digits and it displays all of the digits. I also place the correct units in the optional section and alternative units. For example meters or m. But the quiz does not show the units or calculate the significant digits correctly. It works in numerical question type but not calculated question type.
          Hide
          Paulo Matos added a comment -

          I already solved this before... seems patch were lost on import to the new tracker, take a look on:
          http://moodle.org/bugs/bug.php?op=show&bugid=4901
          for a patch to 1.5.x

          Show
          Paulo Matos added a comment - I already solved this before... seems patch were lost on import to the new tracker, take a look on: http://moodle.org/bugs/bug.php?op=show&bugid=4901 for a patch to 1.5.x
          Hide
          Paulo Matos added a comment -

          Here goes the updated patch!
          It assumes that if the teacher set a unit it should be checked. (take a look at MDL-4901).

          Show
          Paulo Matos added a comment - Here goes the updated patch! It assumes that if the teacher set a unit it should be checked. (take a look at MDL-4901 ).
          Hide
          Paulo Matos added a comment -

          Updated/Verified against moodle v1.6.4+ (2006050540).

          Show
          Paulo Matos added a comment - Updated/Verified against moodle v1.6.4+ (2006050540).
          Hide
          Paolo Oprandi added a comment -

          This is still a bug in 1.6.5... Although questiontype.php in calculated questions has moved about a bit Paulo's fix still works... Thanks... Can we have it in core please?

          Show
          Paolo Oprandi added a comment - This is still a bug in 1.6.5... Although questiontype.php in calculated questions has moved about a bit Paulo's fix still works... Thanks... Can we have it in core please?
          Hide
          Stefan Büchler added a comment -

          Does the newer patch also work in 1.82?
          How to install the patch? (I'm new to moodle)

          Show
          Stefan Büchler added a comment - Does the newer patch also work in 1.82? How to install the patch? (I'm new to moodle)
          Hide
          Jeff Forssell added a comment -

          When I saw Paulos patch in January it worked, but I'd really like to see a possibility to have some degree of differentiation in the feedback regarding the unit.

          My ideas about this (and some other wished for the numerical questions) can be seen here:

          http://docs.moodle.org/en/Development:Numerical_question_units_and_intervals

          Show
          Jeff Forssell added a comment - When I saw Paulos patch in January it worked, but I'd really like to see a possibility to have some degree of differentiation in the feedback regarding the unit. My ideas about this (and some other wished for the numerical questions) can be seen here: http://docs.moodle.org/en/Development:Numerical_question_units_and_intervals
          Hide
          Paulo Matos added a comment -

          Hi Stephan!
          I don't know if it works on 1.8.2 (probably not "as is"), I will initiate sooner the update of all my patches soon. I will post it here when done.
          Cheers,

          Paulo Matos

          Show
          Paulo Matos added a comment - Hi Stephan! I don't know if it works on 1.8.2 (probably not "as is"), I will initiate sooner the update of all my patches soon. I will post it here when done. Cheers, Paulo Matos
          Hide
          Tim Hunt added a comment -

          It is really time I got this checked into Moodle.

          Because this change affects how questions work, I don't think we should do it on a stable branch. It should be in a major release, with a warning in the release notes that if you use numerical questions with optional units, you will need to go and check your questions.

          Attached is a new patch, applying as much of Pualo's patch to head as I can manage.

          The two bits that no longer work are in the numerical question type, the methods test_response and apply_unit. I have rewritten both these methods since Moodle 1.6, and I hope the new version of these methods is more robust and easier to understand. However, they do mean that the changes to fix this bug need to be redone.

          Also, before I can check this into core, I need a patch without comments like "//paulo.matos: (bug #4901)".

          It would be really nice to get this into Moodle 1.9, but we are running out of time (almost entirely my fault, I know.)

          Show
          Tim Hunt added a comment - It is really time I got this checked into Moodle. Because this change affects how questions work, I don't think we should do it on a stable branch. It should be in a major release, with a warning in the release notes that if you use numerical questions with optional units, you will need to go and check your questions. Attached is a new patch, applying as much of Pualo's patch to head as I can manage. The two bits that no longer work are in the numerical question type, the methods test_response and apply_unit. I have rewritten both these methods since Moodle 1.6, and I hope the new version of these methods is more robust and easier to understand. However, they do mean that the changes to fix this bug need to be redone. Also, before I can check this into core, I need a patch without comments like "//paulo.matos: (bug #4901)". It would be really nice to get this into Moodle 1.9, but we are running out of time (almost entirely my fault, I know.)
          Hide
          Pierre Pichet added a comment -

          "Because this change affects how questions work, I don't think we should do it on a stable branch."
          If we want to implement grading on the presence or not of the unit, we should do it completely. i.e. allow a grade for the numerical results and a grade for the units.
          This become a new question type which will be also somewhat a multianswer question type .
          For the student there should be a message that units are mandatory and, to be fair, a list of valid units (this could be optional).
          A select element with the valid units would insure that typo errors will not be graded as bad.

          Show
          Pierre Pichet added a comment - "Because this change affects how questions work, I don't think we should do it on a stable branch." If we want to implement grading on the presence or not of the unit, we should do it completely. i.e. allow a grade for the numerical results and a grade for the units. This become a new question type which will be also somewhat a multianswer question type . For the student there should be a message that units are mandatory and, to be fair, a list of valid units (this could be optional). A select element with the valid units would insure that typo errors will not be graded as bad.
          Hide
          Paulo Matos added a comment -

          Here goes the updated patch for 1.8.x, built upon tim's revised patch.

          Show
          Paulo Matos added a comment - Here goes the updated patch for 1.8.x, built upon tim's revised patch.
          Hide
          Pierre Pichet added a comment -

          Thanks for the patch but it cannot be applied directly as it change the grading of numerical and calculated question.
          With your patch student grade is 0 if he did not put the unit or even if there is some misspelled unit.
          The actual Moodle handling is that the numerical value is graded. Units are used to allow the student to answer in other units not to grade the unit part.

          Show
          Pierre Pichet added a comment - Thanks for the patch but it cannot be applied directly as it change the grading of numerical and calculated question. With your patch student grade is 0 if he did not put the unit or even if there is some misspelled unit. The actual Moodle handling is that the numerical value is graded. Units are used to allow the student to answer in other units not to grade the unit part.
          Hide
          Tim Hunt added a comment -

          Yes, and the plan is to change the behaviour in Moodle 2.0. I'll look at the patch when I have a moment.

          Show
          Tim Hunt added a comment - Yes, and the plan is to change the behaviour in Moodle 2.0. I'll look at the patch when I have a moment.
          Hide
          Paulo Matos added a comment -

          Indeed it changes the behaviour, IMHO to the correct one!
          What's the point of set units on the answer if you accept it as correct with incorrect/misspelled or without units?
          If you don't want to use units, don't set it! If you want to accept mispelled units set them (mispelled) as correct.

          Show
          Paulo Matos added a comment - Indeed it changes the behaviour, IMHO to the correct one! What's the point of set units on the answer if you accept it as correct with incorrect/misspelled or without units? If you don't want to use units, don't set it! If you want to accept mispelled units set them (mispelled) as correct.
          Hide
          Paulo Matos added a comment -

          If I recall correctly there was a problem specifying multiple units with the same multiplier. An example would be "l (litre/liter)" and "dm^3".

          Show
          Paulo Matos added a comment - If I recall correctly there was a problem specifying multiple units with the same multiplier. An example would be "l (litre/liter)" and "dm^3".
          Hide
          Pierre Pichet added a comment -

          Please see the following discussion before CVS.
          http://moodle.org/mod/forum/discuss.php?d=95193

          Show
          Pierre Pichet added a comment - Please see the following discussion before CVS. http://moodle.org/mod/forum/discuss.php?d=95193
          Hide
          Paulo Matos added a comment -

          1.8.6+ version of patch

          Show
          Paulo Matos added a comment - 1.8.6+ version of patch
          Hide
          Pierre Pichet added a comment -

          Paulo
          The actual units handling of moodle 1.5 to 1.9 are the following.
          The answer is good if the student response numerical value == the answer calculated value.(with the restriction of MDL-15233). The units are not mandatory as long as their coeffcient is 1.
          If you set other units with a coefficient other than 1, then the units are mandatory because this coefficient will be apply to convert the student response to the value used to compare (i.e. ==) to the answer calculated value.
          We cannot change this in these versions (1.5 to 1.9) as this will change the quiz results.
          You can do it with various patch on your moodle site but you take the responsability of the quizz new grades...
          We invite you to add your comments to either the quiz forum or the docs as there is a necessary discussion before changing the questions grading.

          Show
          Pierre Pichet added a comment - Paulo The actual units handling of moodle 1.5 to 1.9 are the following. The answer is good if the student response numerical value == the answer calculated value.(with the restriction of MDL-15233 ). The units are not mandatory as long as their coeffcient is 1. If you set other units with a coefficient other than 1, then the units are mandatory because this coefficient will be apply to convert the student response to the value used to compare (i.e. ==) to the answer calculated value. We cannot change this in these versions (1.5 to 1.9) as this will change the quiz results. You can do it with various patch on your moodle site but you take the responsability of the quizz new grades... We invite you to add your comments to either the quiz forum or the docs as there is a necessary discussion before changing the questions grading.
          Hide
          Pierre Pichet added a comment -

          One suggestion is to add a new element to unit table storing the penalty and giving the user the possibility to apply a penalty if the unit is not in the response for all units that have a 1.0 multiplier values.
          If the multiplier is not 1.0 then the Penalty is 1.0 i.e. the unit is mandatory.

          Show
          Pierre Pichet added a comment - One suggestion is to add a new element to unit table storing the penalty and giving the user the possibility to apply a penalty if the unit is not in the response for all units that have a 1.0 multiplier values. If the multiplier is not 1.0 then the Penalty is 1.0 i.e. the unit is mandatory.
          Hide
          Paulo Matos added a comment -

          Ok. Just to clarify to whoever reads this: this new grading does not affect past quizzes, unless of course someone hits REGRADE function.
          In this context and as the code is at the moment I still think that if units are present they should be checked.
          I agree with more flexibility and with Pierre's ideas, but the changes to achieve what is proposed are not simple.

          Show
          Paulo Matos added a comment - Ok. Just to clarify to whoever reads this: this new grading does not affect past quizzes, unless of course someone hits REGRADE function. In this context and as the code is at the moment I still think that if units are present they should be checked. I agree with more flexibility and with Pierre's ideas, but the changes to achieve what is proposed are not simple.
          Hide
          Pierre Pichet added a comment -

          More easy to understand interface prototype.
          Thanks to Jamie Pratt for the trick of how to add group in repeat_elements.(first time done in moodle code)

          Show
          Pierre Pichet added a comment - More easy to understand interface prototype. Thanks to Jamie Pratt for the trick of how to add group in repeat_elements.(first time done in moodle code)
          Hide
          Pierre Pichet added a comment -

          I am working on adding a units_penalty to the question_numerical_units table so that the teacher can fix a penaty for units that have a 1.0 multiplier. The other ones have a 1.0 penalty by their own nature.
          This is the most wanted feature .

          Show
          Pierre Pichet added a comment - I am working on adding a units_penalty to the question_numerical_units table so that the teacher can fix a penaty for units that have a 1.0 multiplier. The other ones have a 1.0 penalty by their own nature. This is the most wanted feature .
          Hide
          Pierre Pichet added a comment -

          To Jamie

          Show
          Pierre Pichet added a comment - To Jamie
          Hide
          Pierre Pichet added a comment -

          to Jamie

          Show
          Pierre Pichet added a comment - to Jamie
          Hide
          Pierre Pichet added a comment -

          Jamie,
          I found the problem
          In repeat_elements you need fullclone so that each internal element is a new one.
          This is why when I setValue to an element in the group it was set to the same value in the similar element of the other groups.

          RCS file: /cvsroot/moodle/moodle/lib/formslib.php,v
          retrieving revision 1.160
          diff -u -r1.160 formslib.php
          — formslib.php 23 Sep 2008 14:45:58 -0000 1.160
          +++ formslib.php 9 Oct 2008 04:59:26 -0000
          @@ -736,7 +736,7 @@
          $mform->setConstants(array($repeathiddenname=>$repeats));
          for ($i=0; $i<$repeats; $i++) {
          foreach ($elementobjs as $elementobj){

          • $elementclone = clone($elementobj);
            + $elementclone = fullclone($elementobj);
            $name = $elementclone->getName();
            if (!empty($name)){
            $elementclone->setName($name."[$i]");

          Could you change this in HEAD (and it should be merged in 1.9 and 1.8).

          Show
          Pierre Pichet added a comment - Jamie, I found the problem In repeat_elements you need fullclone so that each internal element is a new one. This is why when I setValue to an element in the group it was set to the same value in the similar element of the other groups. RCS file: /cvsroot/moodle/moodle/lib/formslib.php,v retrieving revision 1.160 diff -u -r1.160 formslib.php — formslib.php 23 Sep 2008 14:45:58 -0000 1.160 +++ formslib.php 9 Oct 2008 04:59:26 -0000 @@ -736,7 +736,7 @@ $mform->setConstants(array($repeathiddenname=>$repeats)); for ($i=0; $i<$repeats; $i++) { foreach ($elementobjs as $elementobj){ $elementclone = clone($elementobj); + $elementclone = fullclone($elementobj); $name = $elementclone->getName(); if (!empty($name)){ $elementclone->setName($name." [$i] "); Could you change this in HEAD (and it should be merged in 1.9 and 1.8).
          Hide
          Jamie Pratt added a comment - - edited

          Thanks Pierre. Do you have time to describe this in a new bug filed for formslib?

          Show
          Jamie Pratt added a comment - - edited Thanks Pierre. Do you have time to describe this in a new bug filed for formslib?
          Hide
          Karsten Kreddig added a comment -

          we still notice this problem in our version 1.9.5 installation

          because it already exists for about two years and some of our natural scientific lecturers are very unsatisfied with this, it would be nice to increase the priority.

          thanx, karsten kreddig.

          Show
          Karsten Kreddig added a comment - we still notice this problem in our version 1.9.5 installation because it already exists for about two years and some of our natural scientific lecturers are very unsatisfied with this, it would be nice to increase the priority. thanx, karsten kreddig.
          Hide
          Pierre Pichet added a comment -

          Thanks for your reminder.
          The ideal way to solve this unit grading is to convert numerical or calculated questions as multiple answers questions with a grade applied to the correct numerical value (inside the range defined) and a grade to the presence or absence of units.
          However this change the actual role of units which are used to allow the student to express the correct numerical value in various units i.e in cm or m .
          Converting to multiple answers involve also upgrading the quiz reports.
          This was one of the reasons for not implementing a variant of the screenshot-3 proprosal .
          The quiz reports have a new design (thanks Jamie Pratt) and it could be the time to put this for version 5.+. (5.0 is probably to close...)

          In the mean time see
          http://moodle.org/mod/forum/discuss.php?d=95193

          Show
          Pierre Pichet added a comment - Thanks for your reminder. The ideal way to solve this unit grading is to convert numerical or calculated questions as multiple answers questions with a grade applied to the correct numerical value (inside the range defined) and a grade to the presence or absence of units. However this change the actual role of units which are used to allow the student to express the correct numerical value in various units i.e in cm or m . Converting to multiple answers involve also upgrading the quiz reports. This was one of the reasons for not implementing a variant of the screenshot-3 proprosal . The quiz reports have a new design (thanks Jamie Pratt) and it could be the time to put this for version 5.+. (5.0 is probably to close...) In the mean time see http://moodle.org/mod/forum/discuss.php?d=95193
          Hide
          Tim Hunt added a comment -

          Hopefully, once Moodle 2.1 is done, this can finally be resolved.

          Show
          Tim Hunt added a comment - Hopefully, once Moodle 2.1 is done, this can finally be resolved.
          Hide
          Tim Hunt added a comment -

          I think that, with Pierre's changes in Moodle 2.0, and then the further changes in the new question engine, this issue is now basically resolved.

          If anyone is still dissatisfied, please raise your concerns in the quiz forum (http://moodle.org/mod/forum/view.php?id=737) for discussion. If need be, we can open new tracker issues.

          Show
          Tim Hunt added a comment - I think that, with Pierre's changes in Moodle 2.0, and then the further changes in the new question engine, this issue is now basically resolved. If anyone is still dissatisfied, please raise your concerns in the quiz forum ( http://moodle.org/mod/forum/view.php?id=737 ) for discussion. If need be, we can open new tracker issues.

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: