User Able To Repeat Content They Should No Longer Have Access To

Created on 11 July 2024, 5 months ago

Problem/Motivation

A student is able to incorrectly repeat content that they have previously already done and shouldn't have further access to.

Steps to reproduce

Create a new learning path with 3 modules and any number of activities within them. Set the 3 modules to allowed attempts 1.

A user will enter module #1 on their first attempt and then proceed to module #2. The user completes module #2 and proceeds to #3. Now at module #3, the user leaves their session. Upon returning the user instead manually goes to an activity in module #1. i.e. /group/1/module/1/answer/1

A new attempt is blindly created (in user_module_status db table) and the user is directed to the activity page they entered in the URL. The user is now able to redo content they previously did a second attempt, even though we have the setting to allow single attempts only.

Of course as soon as the user completes the module a second time (module #1 in our example), the system attempts to redirect the user to module #2. But there is a check to make sure they can do it again and since we've set it to 1 attempt, the system redirects to the group homepage with an error preventing them for repeating content further.

This is still not ideal. A user can repeat modules indefinitely as long as they keep going to the /group/1/module/1/answer/2 url.

Proposed resolution

The function moduleQuestionAnswerForm() within the opigno_module/src/Controller/OpignoModuleController.php file (line 710) shouldn't blindly create a new attempt at line 735. A check should be preformed if the user is able to create a new attempt and if not redirect them to the correct location - ideally just redirect to the opigno_learning_path.steps.next route.

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇨🇦Canada 2gendevs

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024