Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-1018

Problem with unchecked boxes saved as choice_id = 0

    XMLWordPrintable

    Details

    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      In version 1.9 (and 2.0), Table: mdl_questionnaire_resp_multiple field choice_id is set as Null: No.
      In prior versions (1.8), when a check box is left unchecked in a check boxes question type, that choice is saved as choice_id = 0.
      Ditto with version 1.9.
      This works in normal questionnaire operations, but it causes a problem when restoring a backed-up questionnaire with user data.
      I propose to fix the bug as follows:
      In file questiontypes.class.php, around line 350, test value of choice_id ($cid) and DO NOT SAVE response if $cid = 0 (i.e. box was not checked).
      But, in order to make questionnaires backed-up previously with the choice-id value saved as 0, I have provided a test in file restorelib.php.

        Attachments

          Activity

            People

            • Assignee:
              rezeau Joseph Rézeau
              Reporter:
              rezeau Joseph Rézeau
              Participants:
              Component watchers:
              Mike Churchward
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08