-
Bug
-
Resolution: Fixed
-
Major
-
2.3.6, 2.5
-
MOODLE_23_STABLE, MOODLE_25_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MDL-41155-master -
-
FRONTEND Sprint 15
When Provide option to try a question again set to Yes and Max number of attempts is greater than 1, then students can attempt a question many times, even when the max attempt value is reached.
This issue still exists in v.2.3.x and v2.5. I could reproduce this on the demo.moodle.net site as well.
There does not seem to be any workaround to this issue.
Looks like the maxattemptsreached property of the lesson page object isn't checked in all places. The following changes in /mod/lesson/continue.php seems to solve this issue:
Change:
if ($result->attemptsremaining != 0 && !$lesson->review && !$reviewmode) {
|
to:
if ($result->attemptsremaining != 0 && $lesson->review && !$reviewmode) {
|
Change:
if ($result->maxattemptsreached != 0 && !$lesson->review && !$reviewmode) {
|
to:
if ($result->maxattemptsreached != 0 && $lesson->review && !$reviewmode) {
|
Change:
echo $result->feedback;
|
to:
if(!$result->maxattemptsreached && !$reviewmode)
|
echo $result->feedback;
|
Change:
if (!$result->correctanswer && !$result->noanswer && !$result->isessayquestion && !$reviewmode && $lesson->review) {
|
to:
if (!$result->correctanswer && !$result->noanswer && !$result->isessayquestion && !$reviewmode && $lesson->review && !$result->maxattemptsreached) {
|
Change:
if ($lesson->review && !$result->correctanswer && !$result->noanswer && !$result->isessayquestion) {
|
to:
if ($lesson->review && !$result->correctanswer && !$result->noanswer && !$result->isessayquestion && !$result->maxattemptsreached) {
|
The following fields in table mdl_lesson also creates confusion and may have contributed to this bug being introduced:
- modattempts - this records value for Allow student to review setting
- review - this records value for Provide option to retry question again
A similar issue was reported earlier: https://tracker.moodle.org/browse/MDL-23598
- has a non-specific relationship to
-
MDL-23598 Display problem with Display review button setting.
-
- Closed
-
-
MDL-38106 Missing Introduction field in Lesson setting form
-
- Closed
-
- is duplicated by
-
MDL-39200 Inconsistency in lesson question attempts settings
-
- Closed
-
-
MDL-43231 Lesson allows students to take multiple attempts when only 1 is allowed
-
- Closed
-
- will help resolve
-
MDL-29907 Lesson Max attempts broken
-
- Closed
-