Moodle
  1. Moodle
  2. MDL-29115

Provide option to try a question again

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide

      In Moodle 2.0 or 2.1
      Create a Lesson with a couple of MCQ questions.
      ---------
      Lesson settings: Flow control
      Allow student review NO
      Provide option to try a question again NO
      Maximum number of attempts 1
      Display default feedback YES
      --------
      Log in as student and do the lesson.
      Select incorrect answer for Q1
      Lesson displays 2 buttons:
      Yes, I'd like to try again and Continue.
      --------
      Since the Provide option to try a question again is set to NO, this should NOT happen, only the Continue button should get displayed!

      Show
      In Moodle 2.0 or 2.1 Create a Lesson with a couple of MCQ questions. --------- Lesson settings: Flow control Allow student review NO Provide option to try a question again NO Maximum number of attempts 1 Display default feedback YES -------- Log in as student and do the lesson. Select incorrect answer for Q1 Lesson displays 2 buttons: Yes, I'd like to try again and Continue. -------- Since the Provide option to try a question again is set to NO, this should NOT happen, only the Continue button should get displayed!
    • Workaround:
      Hide

      No workaround, but see my suggested fix in the Description field above.

      Show
      No workaround, but see my suggested fix in the Description field above.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      The way that those two Lesson settings: Provide option to try a question again and Maximum number of attempts interact leads to inconsistencies in the Lesson flow control.

      see this forum discussion:http://moodle.org/mod/forum/discuss.php?d=183756

      I have found a simple fix, which does work in the case at hand, but may have unexpected side-effects, so use at own risk.

      For Moodle 2.0 and 2.1. In file <moodle>/mod/lesson/continue.php, change line 200 from:

       if (!$result->correctanswer && !$result->noanswer && !$result->isessayquestion && !$reviewmode) {

      to

       if (!$result->correctanswer && !$result->noanswer && !$result->isessayquestion && !$reviewmode && $lesson->review) {

        Gliffy Diagrams

          Activity

          Hide
          Joseph Rézeau added a comment -

          BUMP ! any progress on this?

          Show
          Joseph Rézeau added a comment - BUMP ! any progress on this?
          Hide
          Andrea Bicciolo added a comment -

          Hello Rossiani, there are possibilities to speed up a resolution for this? It is affecting some production sites where Lesson module is used.

          Show
          Andrea Bicciolo added a comment - Hello Rossiani, there are possibilities to speed up a resolution for this? It is affecting some production sites where Lesson module is used.
          Hide
          Rossiani Wijaya added a comment -

          Hi Joseph ,

          Thanks for providing solution to the issue.

          Andrea,
          I just created a patch for integration review and hopefully it could be part of this week integration.

          Show
          Rossiani Wijaya added a comment - Hi Joseph , Thanks for providing solution to the issue. Andrea, I just created a patch for integration review and hopefully it could be part of this week integration.
          Hide
          Ankit Agarwal added a comment -

          Looks good to me!
          Thanks

          Show
          Ankit Agarwal added a comment - Looks good to me! Thanks
          Hide
          Andrea Bicciolo added a comment -

          Hello, there are chances for integration this week ?

          Show
          Andrea Bicciolo added a comment - Hello, there are chances for integration this week ?
          Hide
          Rossiani Wijaya added a comment -

          Pushing this for integration review.

          Show
          Rossiani Wijaya added a comment - Pushing this for integration review.
          Hide
          Sam Hemelryk added a comment -

          Thanks Rosie this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Rosie this has been integrated now
          Hide
          Sam Hemelryk added a comment -

          Tested during integration review

          Show
          Sam Hemelryk added a comment - Tested during integration review
          Hide
          Eloy Lafuente (stronk7) added a comment -

          And this has landed upstream, just on time for the upcoming new releases week. Thanks for it!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - And this has landed upstream, just on time for the upcoming new releases week. Thanks for it! Ciao
          Hide
          Rajneel Totaram added a comment -

          This issue (or similar issue) still exists in v.2.3.x and v2.5. I could reproduce this on the demo.moodle.net site as well.
          When Provide option to try a question again set to No and Max number of attempts is greater than 1, students can attempt the question as many times as set in Max attempts. The Provide option to try a question again setting is completely ignored.

          Current workaround is to set Max number of attempts to 1 when setting Provide option to try a question again to No.
          This not a very good workaround as teachers can easily fail to do this.

          A simple hack that works is to add the following condition in lesson_update_instance() in /mod/lesson/lib.php:
          if($data->review == 0) // cannot retry question, so only 1 attempt

          { $data->maxattempts = 1; }

          This sets max attempts to 1 if no retry option is available.
          Probably a better patch will be to not allow this condition to occur in the first place. Max number of attempts should be disabled and set to 1 when retry question option is set to No in mod_form.php

          Show
          Rajneel Totaram added a comment - This issue (or similar issue) still exists in v.2.3.x and v2.5. I could reproduce this on the demo.moodle.net site as well. When Provide option to try a question again set to No and Max number of attempts is greater than 1, students can attempt the question as many times as set in Max attempts. The Provide option to try a question again setting is completely ignored. Current workaround is to set Max number of attempts to 1 when setting Provide option to try a question again to No. This not a very good workaround as teachers can easily fail to do this. A simple hack that works is to add the following condition in lesson_update_instance() in /mod/lesson/lib.php: if($data->review == 0) // cannot retry question, so only 1 attempt { $data->maxattempts = 1; } This sets max attempts to 1 if no retry option is available. Probably a better patch will be to not allow this condition to occur in the first place. Max number of attempts should be disabled and set to 1 when retry question option is set to No in mod_form.php

            People

            • Votes:
              4 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: