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

qtype_multichoice's style override should be restricted on own edit form

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 5.1
    • 4.4.8, 4.5.4, 5.0
    • Questions
    • MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE
    • MOODLE_501_STABLE
    • MDL-85240_main
    • Hide

      Preparation

      1. As the administrator, install the plugins "qbehaviour_adaptivemultipart" and "qtype_formulas".

      Test 1: Layout of multichoice and calculatedmulti question types are still correct

      1. Logged in as teacher, go to any question bank in any of your courses.
      2. Click "Create a new question ...".
      3. In the modal dialog, choose "Multiple choice" and click "Add".
      4. Scroll to "Answers" and verify the gray rectangle around the three fields ("Choice 1", "Grade" and "Feedback") is not interrupted, as shown in the attached screenshot 1. (It would be without the override.)
      5. Click "Cancel" and go back to the question bank.
      6. Click "Create a new question ...".
      7. In the modal dialog, choose "Calculated multichoice" and click "Add".
      8. Scroll to "Answers" and verify the gray rectangle around the fields fields ("Choice 1", "Grade", "Answer display" and "Feedback") is not interrupted, as shown in the attached screenshot.
      9. Click "Cancel" and go back to the question bank.

      Test 2: Layout of other question type (e. g. Formulas) is no longer modified

      1. Still in the question bank, click "Create a new question ..." again.
      2. In the modal dialog, choose "Formulas".
      3. Scroll to "Part 1" and open the section.
      4. In your browser's developer tools, select the div containing the "Answer*" field, i. e. the div with id fitem_id_answer_0.
      5. Verify that the div has a bottom margin of 1 rem. With my settings, this means 16 pixels, but your value might differ. See the attached screenshots 2a and 2b.
      6. Click "Cancel".
      Show
      Preparation As the administrator, install the plugins "qbehaviour_adaptivemultipart" and "qtype_formulas". Test 1: Layout of multichoice and calculatedmulti question types are still correct Logged in as teacher, go to any question bank in any of your courses. Click "Create a new question ...". In the modal dialog, choose "Multiple choice" and click "Add". Scroll to "Answers" and verify the gray rectangle around the three fields ("Choice 1", "Grade" and "Feedback") is not interrupted, as shown in the attached screenshot 1. (It would be without the override.) Click "Cancel" and go back to the question bank. Click "Create a new question ...". In the modal dialog, choose "Calculated multichoice" and click "Add". Scroll to "Answers" and verify the gray rectangle around the fields fields ("Choice 1", "Grade", "Answer display" and "Feedback") is not interrupted, as shown in the attached screenshot. Click "Cancel" and go back to the question bank. Test 2: Layout of other question type (e. g. Formulas) is no longer modified Still in the question bank, click "Create a new question ..." again. In the modal dialog, choose "Formulas". Scroll to "Part 1" and open the section. In your browser's developer tools, select the div containing the "Answer*" field, i. e. the div with id fitem_id_answer_0 . Verify that the div has a bottom margin of 1 rem. With my settings, this means 16 pixels, but your value might differ. See the attached screenshots 2a and 2b. Click "Cancel".
    • Hide

      Code verified against automated checks.

      Checked MDL-85240 using repository: https://github.com/PhilippImhof/moodle.git

      More information about this report

      Built on: Sun Apr 20 08:53:28 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85240 using repository: https://github.com/PhilippImhof/moodle.git MOODLE_404_STABLE (0 errors / 0 warnings) [branch: MDL-85240_404 | CI Job ] MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-85240_405 | CI Job ] MOODLE_500_STABLE (0 errors / 0 warnings) [branch: MDL-85240_500 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-85240_main | CI Job ] More information about this report Built on: Sun Apr 20 08:53:28 UTC 2025
    • Hide

      Launching automatic jobs for branch MDL-85240_404

      Launching automatic jobs for branch MDL-85240_405

      Launching automatic jobs for branch MDL-85240_500

      Launching automatic jobs for branch MDL-85240_main

      Built on: Sat Apr 19 10:30:26 UTC 2025

      Show
      Launching automatic jobs for branch MDL-85240 _404 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19069/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65212/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65213/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-85240 _405 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19070/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65214/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65215/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-85240 _500 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19071/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65216/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65217/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-85240 _main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19072/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65218/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65219/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65220/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65221/ App tests (stable app version) --> unrelated Built on: Sat Apr 19 10:30:26 UTC 2025

      The style sheet for the multichoice question type overrides divs whose id attribute starts with fitem_id_answer_ and have the mb-3 class, removing the bottom margin. As a consequence, this also changes the appearance of form fields with the id id_answer_xxx in other question types, which IMHO is not desired.

      I suggest that the modification should be restricted to the multichoice question's own edit form.

            philippimhof Philipp Imhof
            philippimhof Philipp Imhof
            Luca Bösch Luca Bösch
            Tim Hunt Tim Hunt
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 27 minutes
                27m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.