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

Why does the Preview question popup window is made to retain the whole course interface?

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: 2.1.1
    • Component/s: Questions
    • Labels:
      None
    • Testing Instructions:
      Hide

      1.- From Course front page, Navigation block -> Question bank -> Click on the Preview question icon of any question in the bank:
      Preview question popup window is correctly displayed (without any extra elements).

      2.- From Course front page, Navigation block -> Click link to existing Quiz instance (or in central column, click on link to existing Quiz instance)
      When Quiz -> Info page is displayed, in Navigation block -> Question bank -> Click on the Preview question icon of any question in the bank:
      Preview question popup window is incorrectly displayed (with extra elements).

      Show
      1.- From Course front page, Navigation block -> Question bank -> Click on the Preview question icon of any question in the bank: Preview question popup window is correctly displayed (without any extra elements). 2.- From Course front page, Navigation block -> Click link to existing Quiz instance (or in central column, click on link to existing Quiz instance) When Quiz -> Info page is displayed, in Navigation block -> Question bank -> Click on the Preview question icon of any question in the bank: Preview question popup window is incorrectly displayed (with extra elements).
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      running Moodle 2.1 (Build: 20110701)

      In Moodle 2.0, the Preview question popup window contains only the question interface.
      In Moodle 2.1, this has changed and the Preview question popup window contains the site breadcrumb and the navigation block as well, which IMHO is quite useless and obtrusive in this context.
      This is related to file lib/questionlib.php, function question_preview_url(),
      if ($context->contextlevel == CONTEXT_MODULE)

      { $params['cmid'] = $context->instanceid; }

      else if ($context->contextlevel == CONTEXT_COURSE)

      { $params['courseid'] = $context->instanceid; }

      I do not understand the need for these conditions, and would really prefer
      $params['courseid'] = $context->instanceid;
      at all times...

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            timhunt Tim Hunt added a comment -

            That was unintended. I explicitly set $PAGE->set_pagelayout('popup'); and something is overriding that when previewing from the quiz page.

            The issue is not the $params['courseid'] - and setting $params['courseid'] = $context->instanceid; for anything other than a course context is clearly stupid.

            Show
            timhunt Tim Hunt added a comment - That was unintended. I explicitly set $PAGE->set_pagelayout('popup'); and something is overriding that when previewing from the quiz page. The issue is not the $params ['courseid'] - and setting $params ['courseid'] = $context->instanceid; for anything other than a course context is clearly stupid.
            Hide
            timhunt Tim Hunt added a comment -

            This fix is needed on both the master and 21 branches.

            Show
            timhunt Tim Hunt added a comment - This fix is needed on both the master and 21 branches.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks! (21_STABLE and master)

            Curiously I'd say I noticed this happening when testing other issues last weeks, but I remember that, at some point I started getting "correct" popups so I forgot it on purpose.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (21_STABLE and master) Curiously I'd say I noticed this happening when testing other issues last weeks, but I remember that, at some point I started getting "correct" popups so I forgot it on purpose.
            Hide
            rwijaya Rossiani Wijaya added a comment -

            Tested and works well.

            Show
            rwijaya Rossiani Wijaya added a comment - Tested and works well.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Moodle's git/cvs repositories have been updated with this piece of art! Thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Moodle's git/cvs repositories have been updated with this piece of art! Thanks!
            Hide
            rezeau Joseph Rézeau added a comment -

            Thanks!
            Joseph

            Show
            rezeau Joseph Rézeau added a comment - Thanks! Joseph

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11