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

Incorrect question div id used in M.core_question_engine.init_submit_button

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.10, 3.7.6, 3.8.3, 3.9
    • Fix Version/s: 3.8.5, 3.9.2
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Set up

      1. Log in as teacher/admin.
      2. Create a test course (or use an existing one).
      3. Create an Quiz activity as below:
        • Name: Quiz with scroll.
        • Question behaviour: Immediate feedback.
        • Create/add 2 questions to this Quiz. Ex: 2 True/False questions.
        • Make sure that these 2 question will be display on the same page.
      4. Create an Quiz activity as below:
        • Name: Quiz without scroll.
        • Question behaviour: Immediate feedback.
        • Create/add only one question to this Quiz. Ex: True/False question
      5. Create an Quiz activity as below:
        • Name: Quiz navigation
        • Question behaviour: Immediate feedback.
        • Create add 3 questions to this Quiz. Ex: 3 True/False questions.
        • Make sure that we will have 2 pages. 1st page contain 2 questions and 2nd page contain 1 question.

      Testing if the page have more than one question

      1. Log in as student/teacher/admin.
      2. Go to "Quiz with scroll".
      3. Attempt the Quiz.
      4. Click on the Check button.
      5. Observe the browser address bar.
      6. Verify that there is #question-[usageid]-[slot] at the end of the URL.
      7. Verify that there is no #q at the end of the URL.

      Testing if the page have only one question

      1. Log in as student/teacher/admin.
      2. Go to "Quiz without scroll".
      3. Attempt the Quiz.
      4. Click on the Check button.
      5. Observe the browser address bar.
      6. Verify that there is no #question-[usageid]-[slot] at the end of the URL.
      7. Verify that there is no #q at the end of the URL.

      Testing Quiz navigation block

      1. Log in as student/teacher/admin.
      2. Go to "Quiz navigation".
      3. Attempt the Quiz.
      4. Click on "2" link in the Quiz navigation block
      5. Observe the browser address bar.
      6. Verify that there is #question-[usageid]-[slot] at the end of the URL.
      7. Verify that there is no #q at the end of the URL.
      Show
      Set up Log in as teacher/admin. Create a test course (or use an existing one). Create an Quiz activity as below: Name: Quiz with scroll. Question behaviour: Immediate feedback. Create/add 2 questions to this Quiz. Ex: 2 True/False questions. Make sure that these 2 question will be display on the same page. Create an Quiz activity as below: Name: Quiz without scroll. Question behaviour: Immediate feedback. Create/add only one question to this Quiz. Ex: True/False question Create an Quiz activity as below: Name: Quiz navigation Question behaviour: Immediate feedback. Create add 3 questions to this Quiz. Ex: 3 True/False questions. Make sure that we will have 2 pages. 1st page contain 2 questions and 2nd page contain 1 question. Testing if the page have more than one question Log in as student/teacher/admin. Go to "Quiz with scroll". Attempt the Quiz. Click on the Check button. Observe the browser address bar. Verify that there is #question- [usageid] - [slot] at the end of the URL. Verify that there is no #q at the end of the URL. Testing if the page have only one question Log in as student/teacher/admin. Go to "Quiz without scroll". Attempt the Quiz. Click on the Check button. Observe the browser address bar. Verify that there is no #question- [usageid] - [slot] at the end of the URL. Verify that there is no #q at the end of the URL. Testing Quiz navigation block Log in as student/teacher/admin. Go to "Quiz navigation". Attempt the Quiz. Click on "2" link in the Quiz navigation block Observe the browser address bar. Verify that there is #question- [usageid] - [slot] at the end of the URL. Verify that there is no #q at the end of the URL.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.8 Branch:
    • Pull 3.9 Branch:
    • Pull Master Branch:
      MDL-69165-master

      Description

      This is something that was missed when MDL-65029 was done. The id constructed here: https://github.com/moodle/moodle/blob/c11e2517a77b94c844d88e45b61af4305bbc1cf6/question/qengine.js#L133 is no longer right.

      Also, there is no point adding this fragment at the end of the URL in the case where there is only one question rendered in the form - which is always the case in StudentQuiz, where one of our users noticed and said it was ugly. We can detect that there is one qusetion in the form either by looking at the slots hidden input, which is a comma-separated list of stot ids, or, perhpas better, counting the number of div.que in the form.

      Note, this is only code which needs to be cleaned up on master, so I created MDL-69164 for that. however, this bug needs to be fixed on all stables first.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              HuongNV Huong Nguyen
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Tim Hunt
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Sep/20

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 45 minutes
                  1h 45m