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

            Hide
            timhunt Tim Hunt added a comment -

            OK, that was quick and easy.

            Jurgen, if you need this before you move to Moodle 2.3, you will have to cherry-pick the change yourself.

            Show
            timhunt Tim Hunt added a comment - OK, that was quick and easy. Jurgen, if you need this before you move to Moodle 2.3, you will have to cherry-pick the change yourself.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks Tim - this has been integrated now

            Show
            poltawski Dan Poltawski added a comment - Thanks Tim - this has been integrated now
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            works as expected...passing...
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - works as expected...passing... Thanks
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            UPDATE tracker_issues
               SET status = 'Closed',
                  comment = 'Thanks!'
            WHEN participants = 'Did a gorgeous work'

            This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - UPDATE tracker_issues SET status = 'Closed', comment = 'Thanks!' WHEN participants = 'Did a gorgeous work' This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

              People

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

                Dates

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