Moodle
  1. Moodle
  2. MDL-32613

print_choose_qtype_to_add_form could use a extra argument $allowedqtypes = null

    Details

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

      Description

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

        Activity

        Hide
        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
        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
        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
        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
        Dan Poltawski added a comment -

        Thanks Tim - this has been integrated now

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

        works as expected...passing...
        Thanks

        Show
        Ankit Agarwal added a comment - works as expected...passing... Thanks
        Hide
        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
        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: