XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Questions, Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      The actual links in the paging when the number of questions is greater than 20 so the paging is working are defined as something like

      http://132.208.141.198/moodle_head_new/moodle_head_new/question/edit.php?qpage=1&cat=1%2C3&courseid=2

      notice the double /moodle_head_new/moodle_head_new/
      this happens because the
      class moodle_paging_bar

      add $CFG->wwwroot to the $pageurl which has been defined

      $thispageurl = new moodle_url();
      so the default path automatically generated is $ME
      line 306 in weblib

                  if ($url === null) {
                      global $ME;
                      $url = $ME;
                  }
                  if (is_string($url)) {
                      $url = parse_url($url);
                  }

      in the example case the value is

      "moodle_head_new/question/edit.php"

      So the $url to create the $paging bar should be different than the one used elsewhere in the showbank.

      A simple HACK replacing in question/editlib.php
      line 1275 $pagingbar = moodle_paging_bar::make($totalnumber, $page, $perpage, $pageurl);

      by
      $pageing_url = new moodle_url('edit.php');
      $r = $pageing_url->params($pageurl->params());
      $pagingbar = moodle_paging_bar::make($totalnumber, $page, $perpage, $pageing_url);
      solve the problem either with the general question showbank and the showbank version visible when editing the quiz.

      This happens as in either case the url goes to either question/edit.php or quiz/edit.php

      These are the only 2 calls to this function.

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            ppichet Pierre Pichet
            Tester:
            Nobody
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10