Moodle
  1. Moodle
  2. MDL-6769

GIFT Format - Option to set Shuffle Answers

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7.1, 1.8
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Rank:
      34321

      Description

      Currently, there is no documented way to specify whether a question written in GIFT format should accomodate for the shuffle answers option now available during question creation for multiple choice type questions. As I looked at other option in GIFT help I began to wonder if the following might work or not:

      $question->shuffleanswers = 1; // Answers are shuffle-able

      {I have suggested in another tracker request to make this the default}

      $question->shuffleanswers = 0; // Answers are not shuffle-able

      I will test this option to see if it accomplishes what I am hoping.

        Activity

        Hide
        Howard Miller added a comment -

        The default value of shuffleanswers is now set to $CFG->quiz_shuffleanswers.

        Please see discussion http://moodle.org/mod/forum/discuss.php?d=60209

        Show
        Howard Miller added a comment - The default value of shuffleanswers is now set to $CFG->quiz_shuffleanswers. Please see discussion http://moodle.org/mod/forum/discuss.php?d=60209
        Hide
        Anthony Borrow added a comment -

        Per http://moodle.org/mod/forum/discuss.php?d=60209

        The code in /question/format.php is fine. The problem is, where is it defined? The changes are not documented here in the tracker so it is difficult to follow what changes are being made to CVS. I would immediately suggest adding it as a variable to /config-dist.php or having a place for it to be set - I've not been following how configvars.php was deprecated.

        If the definition of $CFG->quiz_shufflequestions is to be obscure, at the very least it needs to be defined as a default value in mdl_config and be added to the sql files for the question code. My point being, we want to make sure that with the change you have checked in to CVS will not result in an attempt to use an undefined variable when /question/format.php is called.

        Since we are looking at this, I think it is better to get it right at the beginning and call the variable what it is - namely - question_shufflequestions. The simplest choice at this point is to leave it as a $CFG (site variable); however, I think at some point consideration should be made to making it a $COURSE variable (i.e. $COURSE->question_shuffequestions).

        Show
        Anthony Borrow added a comment - Per http://moodle.org/mod/forum/discuss.php?d=60209 The code in /question/format.php is fine. The problem is, where is it defined? The changes are not documented here in the tracker so it is difficult to follow what changes are being made to CVS. I would immediately suggest adding it as a variable to /config-dist.php or having a place for it to be set - I've not been following how configvars.php was deprecated. If the definition of $CFG->quiz_shufflequestions is to be obscure, at the very least it needs to be defined as a default value in mdl_config and be added to the sql files for the question code. My point being, we want to make sure that with the change you have checked in to CVS will not result in an attempt to use an undefined variable when /question/format.php is called. Since we are looking at this, I think it is better to get it right at the beginning and call the variable what it is - namely - question_shufflequestions. The simplest choice at this point is to leave it as a $CFG (site variable); however, I think at some point consideration should be made to making it a $COURSE variable (i.e. $COURSE->question_shuffequestions).
        Hide
        Anthony Borrow added a comment -

        Any reason not to change this for version 1.6 STABLE?

        Show
        Anthony Borrow added a comment - Any reason not to change this for version 1.6 STABLE?
        Hide
        Howard Miller added a comment -

        Applied to version MOODLE_16_STABLE as requested.

        Show
        Howard Miller added a comment - Applied to version MOODLE_16_STABLE as requested.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: