Moodle
  1. Moodle
  2. MDL-32053

Quiz: Question bank - table displayed inconsistently

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Questions, Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1) create at least two questions.
      2) create a quiz (to demo the functionality on "Editing quiz" page where question bank is displayed)
      3) go to question bank page and click on "Show question text in the question list", check the way the table rows are displayed. The uncheck "Show question text in the question list" and observe the table rows (no zebra stipes)

      Show
      1) create at least two questions. 2) create a quiz (to demo the functionality on "Editing quiz" page where question bank is displayed) 3) go to question bank page and click on "Show question text in the question list", check the way the table rows are displayed. The uncheck "Show question text in the question list" and observe the table rows (no zebra stipes)
    • Workaround:
      Hide

      in question/editlib.php, the class question_bank_view has a protected method get_row_classes() which uses an if-statemanet causing the issue.

      in question/editlib.php:
      change

      if (!empty($this->extrarows))

      { $classes[] = 'r' . ($rowcount % 2); }

      to
      $classes[] = 'r' . ($rowcount % 2);

      and add some css classes to the table header.

      Show
      in question/editlib.php, the class question_bank_view has a protected method get_row_classes() which uses an if-statemanet causing the issue. in question/editlib.php: change if (!empty($this->extrarows)) { $classes[] = 'r' . ($rowcount % 2); } to $classes[] = 'r' . ($rowcount % 2); and add some css classes to the table header.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Rank:
      38741

      Description

      In question bank page, when "Show question text in the question list" is checked, it displays the table in zebra stripes (gray, white)format. However when you uncheck "Show question text in the question list", it displays the rows without the zebra stribes.

      There is no zebra stripe format in the way the question bank is displayed in the Edit quiz page.

        Activity

        Show
        Mahmoud Kassaei added a comment - Here is the diff https://github.com/mkassaei/moodle/compare/MOODLE_22_STABLE...MDL-32053
        Hide
        Tim Hunt added a comment -

        Nice one. Thanks Mahmoud. Submitting for integration.

        To INTEGRATORS, please cherry-pick this fix to the 21, 22 and master branches. Thanks.

        Show
        Tim Hunt added a comment - Nice one. Thanks Mahmoud. Submitting for integration. To INTEGRATORS, please cherry-pick this fix to the 21, 22 and master branches. Thanks.
        Hide
        Sam Hemelryk added a comment -

        Thanks Mahmoud, this has been integrated now.

        Show
        Sam Hemelryk added a comment - Thanks Mahmoud, this has been integrated now.
        Hide
        Rajesh Taneja added a comment -

        Works Great
        Thanks for fixing this Mahmoud.

        FYI: Testing instructions says "no zebra stripes" whereas it should say "zebra stripes" should be visible.

        Show
        Rajesh Taneja added a comment - Works Great Thanks for fixing this Mahmoud. FYI: Testing instructions says "no zebra stripes" whereas it should say "zebra stripes" should be visible.
        Hide
        Sam Hemelryk added a comment -

        Congratulations are in order, you've made it, or at least your code has!
        It's now part of Moodle and both the git and cvs repositories have been updated.

        This issue is being marked as fixed and closed.

        Thank you.

        Show
        Sam Hemelryk added a comment - Congratulations are in order, you've made it, or at least your code has! It's now part of Moodle and both the git and cvs repositories have been updated. This issue is being marked as fixed and closed. Thank you.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: