Moodle
  1. Moodle
  2. MDL-28160

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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:
    • Rank:
      17859

      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...

        Issue Links

          Activity

          Hide
          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
          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
          Tim Hunt added a comment -

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

          Show
          Tim Hunt added a comment - This fix is needed on both the master and 21 branches.
          Hide
          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
          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
          Rossiani Wijaya added a comment -

          Tested and works well.

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

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

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

          Thanks!
          Joseph

          Show
          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: