Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26299

Units handling setting reverts to default upon editing

    Details

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

      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"

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            daveyboond Steve Bond added a comment -

            PS also affects 'calculated' question type

            Show
            daveyboond Steve Bond added a comment - PS also affects 'calculated' question type
            Hide
            cfulton 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
            cfulton 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
            ppichet 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
            ppichet 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
            ppichet 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
            ppichet 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
            timhunt 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
            timhunt 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
            timhunt Tim Hunt added a comment -

            Thanks.

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

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

            Show
            tsala 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:
                  Fix Release Date:
                  21/Feb/11