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

Add MCS, MCVS, MCHS Cloze subquestion types

    XMLWordPrintable

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide

      You might find this helpful background reading:
      https://moodle.org/mod/forum/discuss.php?d=227183

      Before applying this patch:
      Create a new course and in default course question category
      Build a multianswer question with a text similar to this one.

      REGULAR
      MCH
      {1:MULTICHOICE_H:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      MCV
      {1:MULTICHOICE_V:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      MC
      {1:MULTICHOICE:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      

      Put the question in a quiz where you set quiz shuffle ON.
      ALL three questions will shuffle as shown here:

      Put the question in a quiz where you set quiz shuffle OFF.
      ALL three questions will NOT shuffle as shown in

      Backup the course so that you can create a copy of this course later.

      Query the database, doing something like:
      SELECT * FROM mdl_qtype_multichoice_options;
      the last 3 items should be the ones from this question and for the last one the shuffleanswers value should be set to one.

      You could also create a second question and delete one of mdl_qtype_multichoice_options (notice the id).

      After applying this patch

      Query the database, doing something like:
      SELECT * FROM mdl_qtype_multichoice_options;
      the last 3 items should be the ones from this question and for the last one the shuffleanswers value should be set to 0.

      If you have created a second question, the deleted one of mdl_qtype_multichoice_options should have been replaced by a new one (notice the id).
      (This checks the code of question/type/multianswer/db/upgrade.php)

      Verify that the MULTICHOICE NO MORE shuffle as in

      ...
      Build a more complete multianswer with a text similar to this one.

      REGULAR
      MCH
      {1:MULTICHOICE_H:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      MCV
      {1:MULTICHOICE_V:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      MC
      {1:MULTICHOICE:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      SHUFFLED IF SET IN QUIZ
      MCHS
      {1:MULTICHOICE_HS:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      MCVS
      {1:MULTICHOICE_VS:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      MCS
      {1:MULTICHOICE_S:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong}
      

      Put it in a quiz setting the quizzle shuffle to on or off. With shuffle ON the _S types should shuffle.
      Compare your results with the figures

      Shuffle OFF and ON

      Use preview on some MC type multianswer from preceeding 2,x version, they should not shuffle .
      Use the text for cloze import. It should give same results
      Restore the course backup as new course and check that the cloze question MC no more shuffle.
      Import Cloze import sample.txt file and preview. The shuffling subquestions should shuffle on preview as the shuffle option is set on preview.
      Backup again and restore the course as a new course.
      Check that the questions shuffle as they should.

      Show
      You might find this helpful background reading: https://moodle.org/mod/forum/discuss.php?d=227183 Before applying this patch: Create a new course and in default course question category Build a multianswer question with a text similar to this one. REGULAR MCH {1:MULTICHOICE_H:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} MCV {1:MULTICHOICE_V:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} MC {1:MULTICHOICE:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} Put the question in a quiz where you set quiz shuffle ON. ALL three questions will shuffle as shown here: Put the question in a quiz where you set quiz shuffle OFF. ALL three questions will NOT shuffle as shown in Backup the course so that you can create a copy of this course later. Query the database, doing something like: SELECT * FROM mdl_qtype_multichoice_options; the last 3 items should be the ones from this question and for the last one the shuffleanswers value should be set to one. You could also create a second question and delete one of mdl_qtype_multichoice_options (notice the id). After applying this patch Query the database, doing something like: SELECT * FROM mdl_qtype_multichoice_options; the last 3 items should be the ones from this question and for the last one the shuffleanswers value should be set to 0. If you have created a second question, the deleted one of mdl_qtype_multichoice_options should have been replaced by a new one (notice the id). (This checks the code of question/type/multianswer/db/upgrade.php) Verify that the MULTICHOICE NO MORE shuffle as in ... Build a more complete multianswer with a text similar to this one. REGULAR MCH {1:MULTICHOICE_H:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} MCV {1:MULTICHOICE_V:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} MC {1:MULTICHOICE:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} SHUFFLED IF SET IN QUIZ MCHS {1:MULTICHOICE_HS:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} MCVS {1:MULTICHOICE_VS:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} MCS {1:MULTICHOICE_S:=First one#OK~Second one#Wrong~Third one#Wrong~Fourth one#Wrong} Put it in a quiz setting the quizzle shuffle to on or off. With shuffle ON the _S types should shuffle. Compare your results with the figures Shuffle OFF and ON Use preview on some MC type multianswer from preceeding 2,x version, they should not shuffle . Use the text for cloze import. It should give same results Restore the course backup as new course and check that the cloze question MC no more shuffle. Import Cloze import sample.txt file and preview. The shuffling subquestions should shuffle on preview as the shuffle option is set on preview. Backup again and restore the course as a new course. Check that the questions shuffle as they should.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_28_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38214_wipd

      Description

      Some Cloze subquestion types (e.g. MULTICHOICE) automatically shuffle the choices presented to the student. The instructor sometimes wishes to present the choices in a fixed order.

      The underlying database and rendering code already supports shuffle on/off on a per-question basis, so it is sufficient to add a checkbox to the edit question screen add new Cloze subquestion types.

      I have created a branch that adds this checkbox:
      git://github.com/seemuth/moodle.git in branch MDL-38214
      https://github.com/seemuth/moodle/tree/MDL-38214

      Diff: https://github.com/seemuth/moodle/compare/MOODLE_24_STABLE...MDL-38214

      I have created a new branch based on master that adds new Cloze subquestion types:

      • MCS or MULTICHOICE_S (shuffles choices)
      • MCVS or MULTICHOICE_VS (shuffles choices)
      • MCHS or MULTICHOICE_HS (shuffles choices)
        MC will be non shuffling as in 1,9.

      This branch can be found:
      git://github.com/seemuth/moodle.git in branch MDL-38214-v2.5
      https://github.com/seemuth/moodle/tree/MDL-38214-v2.5

      A diff from master can be found:
      https://github.com/seemuth/moodle/compare/master...MDL-38214-v2.5

      A discussion of this implementation can be found:
      https://moodle.org/mod/forum/discuss.php?d=227183

        Attachments

        1. Cloze import sample.txt
          0.6 kB
        2. Master_quiz_shuffle_off.jpg
          Master_quiz_shuffle_off.jpg
          44 kB
        3. Master_quiz_shuffle_on.jpg
          Master_quiz_shuffle_on.jpg
          44 kB
        4. MDL_38214__NO_suffle.jpg
          MDL_38214__NO_suffle.jpg
          43 kB
        5. MDL-38214_shuffleon.jpg
          MDL-38214_shuffleon.jpg
          39 kB
        6. MDL-38214-1-definition.png
          MDL-38214-1-definition.png
          87 kB
        7. MDL-38214-2-checkbox.png
          MDL-38214-2-checkbox.png
          22 kB
        8. MDL-38214-3-shuffled.png
          MDL-38214-3-shuffled.png
          22 kB
        9. MDL-38214-4-uncheck.png
          MDL-38214-4-uncheck.png
          24 kB
        10. MDL-38214-5-unshuffled.png
          MDL-38214-5-unshuffled.png
          22 kB
        11. Quiz_NoShuffle.jpg
          Quiz_NoShuffle.jpg
          57 kB
        12. Quiz_shuffle_off.jpg
          Quiz_shuffle_off.jpg
          58 kB
        13. Shuffle_set_in_quiz.jpg
          Shuffle_set_in_quiz.jpg
          87 kB

          Issue Links

            Activity

              People

              • Votes:
                10 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  16/Nov/15