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

print_choose_qtype_to_add_form could use a extra argument $allowedqtypes = null

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3
    • Component/s: Questions
    • Labels:
      None
    • Testing Instructions:
      Hide

      Go to the edit quiz page. Check:
      1. Check that the Add question ... button works.
      2. Check that the Create a new question ... button works.
      3. Go to the question bank. Check that the Create a new question ... button works.
      4. Repeat those three tests with JavaScript disabled.

      5. Create a test script like:

      <?php
      require_once('config.php');
      require_once('question/editlib.php');
      require_login();
      $PAGE->set_context(context_system::instance());
      print_choose_qtype_to_add_form(array(), array('description', 'multichoice'));

      run it, and verify that it only shows those two qtypes, with no errors.

      Show
      Go to the edit quiz page. Check: 1. Check that the Add question ... button works. 2. Check that the Create a new question ... button works. 3. Go to the question bank. Check that the Create a new question ... button works. 4. Repeat those three tests with JavaScript disabled. 5. Create a test script like: <?php require_once('config.php'); require_once('question/editlib.php'); require_login(); $PAGE->set_context(context_system::instance()); print_choose_qtype_to_add_form(array(), array('description', 'multichoice')); run it, and verify that it only shows those two qtypes, with no errors.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      For some contrib activities, it only makes sense to allow certain types of question. This simple, backwards compatible API change, would allow that.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12