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

Allow quizzes to have random questions by tag

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Testing Instructions

      1. Log in as an admin and create a course
      2. Enrol someone as a teacher in the course
      3. Log in as the teacher and enter the course
      4. Go to the course's question bank and create 2 question categories: cat1 and cat2
      5. Create 2 true/false questions in each of the cat1 and cat2 categories (name them cat1-q1, cat1-q2, cat2-q1, cat2-q2) (Also for simplicity of the test, enter the question text the same as the question name).
      6. In the question bank, where you see the list of the questions you created, click on the 'tag' icon next to each question and tag them with t1 and t2 like this:
        cat1-q1 --> t1
        cat1-q2 --> t2
        cat2-q1 --> t1
        cat2-q2 --> t2
      7. Create a quiz activity in the course and name that Quiz1
      8. Create a "random" question in the quiz from cat1. set the tag to t1
      9. Create a "random" question in the quiz from cat2. set the tag to t2
      10. Attempt the quiz as a student
      11. Confirm that the first question is cat1-q1
      12. Confirm that the second question is cat2-q2
      13. Create another quiz in the course and name that Quiz2
      14. Create a "random" question in the new quiz you just created (Quiz2) from cat1. Leave the tags field empty.
      15. Create another "random" question in Quiz2 from the "Top" question category (the one that contains cat1 and cat2). Set the tag to t1.
      16. Attempt the quiz as a student
      17. Confirm that the first question is either cat1-q1 or cat1-q2
      18. Confirm that the second question is either cat1-q1 or cat2-q1
      19. Confirm that the 2 questions that the students see in the exam are not the same
      Show
      Testing Instructions Log in as an admin and create a course Enrol someone as a teacher in the course Log in as the teacher and enter the course Go to the course's question bank and create 2 question categories: cat1 and cat2 Create 2 true/false questions in each of the cat1 and cat2 categories (name them cat1-q1 , cat1-q2 , cat2-q1 , cat2-q2 ) (Also for simplicity of the test, enter the question text the same as the question name). In the question bank, where you see the list of the questions you created, click on the 'tag' icon next to each question and tag them with t1 and t2 like this: cat1-q1 --> t1 cat1-q2 --> t2 cat2-q1 --> t1 cat2-q2 --> t2 Create a quiz activity in the course and name that Quiz1 Create a "random" question in the quiz from cat1 . set the tag to t1 Create a "random" question in the quiz from cat2 . set the tag to t2 Attempt the quiz as a student Confirm that the first question is cat1-q1 Confirm that the second question is cat2-q2 Create another quiz in the course and name that Quiz2 Create a "random" question in the new quiz you just created (Quiz2) from cat1 . Leave the tags field empty. Create another "random" question in Quiz2 from the " Top " question category (the one that contains cat1 and cat2). Set the tag to t1 . Attempt the quiz as a student Confirm that the first question is either cat1-q1 or cat1-q2 Confirm that the second question is either cat1-q1 or cat2-q1 Confirm that the 2 questions that the students see in the exam are not the same
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-61380-master

      Description

      This is to allow having random question by tag, without doing quiz refactoring.

      At the moment, when adding a random question, an entry is created in the {question} table.

      • category is the category that the random question will be picked from
      • questiontext is either 0 which means not to pick questions from subcategories or 1 which means picking questions from subcategories aswell

      We will use the questiontext field to store a json string that contains data about tag(s) as well. The category field will be 0 if the random question is a "random question by tag".

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  17/May/18

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 weeks, 3 days, 3 hours, 30 minutes
                  2w 3d 3h 30m