Moodle
  1. Moodle
  2. MDL-26299

Units handling setting reverts to default upon editing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16391

      Description

      When editing a numerical question, the "units handling" option "Unit 1 displayed" is not persistent.

      Steps to reproduce:

      • Create a new numerical question
      • Set "units handling" to "Unit 1 displayed"
      • Save changes
      • Edit the question
      • "Units handling" has now reverted to "Unit not used"

        Issue Links

          Activity

          Hide
          Steve Bond added a comment -

          PS also affects 'calculated' question type

          Show
          Steve Bond added a comment - PS also affects 'calculated' question type
          Hide
          Charles Fulton added a comment -

          There's a missing "break" in the form code which causes the wrong value to appear when editing even though the correct value is stored in the database (note that it's called unitrole in the form but is stored as showunits in _question_numerical_options). Fix here: https://github.com/mackensen/moodle/commit/7038944105887f79c56b58a31c465808cff36014.

          Show
          Charles Fulton added a comment - There's a missing "break" in the form code which causes the wrong value to appear when editing even though the correct value is stored in the database (note that it's called unitrole in the form but is stored as showunits in _question_numerical_options). Fix here: https://github.com/mackensen/moodle/commit/7038944105887f79c56b58a31c465808cff36014 .
          Hide
          Pierre Pichet added a comment - - edited

          Charles,
          Thanks for spotting this and your solution seems OK.

          So Tim you can go ahead ...

          P.S."note that it's called unitrole in the form but is stored as showunits in _question_numerical_options"
          you are right, the interface change a lot in the creating process and the final code minimize the database changes already done.
          see MDL-20296

          Show
          Pierre Pichet added a comment - - edited Charles, Thanks for spotting this and your solution seems OK. So Tim you can go ahead ... P.S."note that it's called unitrole in the form but is stored as showunits in _question_numerical_options" you are right, the interface change a lot in the creating process and the final code minimize the database changes already done. see MDL-20296
          Hide
          Pierre Pichet added a comment -

          Tim,
          If you agree we could enlarge this bug to other trimmings that appears as more people are testing all the unit grading process.
          See
          http://moodle.org/mod/forum/discuss.php?d=168412

          Show
          Pierre Pichet added a comment - Tim, If you agree we could enlarge this bug to other trimmings that appears as more people are testing all the unit grading process. See http://moodle.org/mod/forum/discuss.php?d=168412
          Hide
          Tim Hunt added a comment -

          I think that Charles's fix is a good simple one that should go in now, and then this bug should be closed. Please could you create a new issue for further work.

          Show
          Tim Hunt added a comment - I think that Charles's fix is a good simple one that should go in now, and then this bug should be closed. Please could you create a new issue for further work.
          Hide
          Tim Hunt added a comment -

          Thanks.

          Show
          Tim Hunt added a comment - Thanks.
          Hide
          Helen Foster added a comment -

          Fix included in the latest 2.0.1+ weekly. Thanks everyone.

          Show
          Helen Foster added a comment - Fix included in the latest 2.0.1+ weekly. Thanks everyone.

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: