"anu_lms.lesson_completed" event getting invoked twice

Created on 15 August 2023, 11 months ago
Updated 20 September 2023, 9 months ago

Problem/Motivation

hi, so there is this issue related to the "anu_lms.lesson_completed" event that i am facing. the issue is that when "Enable linear progress" is disabled for a course then only the following rest resource is called everytime a quiz is completed:

/assessments/assessment

inside this rest resource, there is a call made to the "setCompleted()" method inside which the "anu_lms.lesson_completed" event is invoked, now all this is good, the issue arises when the "Enable linear progress" is enabled, that causes issue, since my quiz is at the very end so now the following rest resources are called everytime a user submits a quiz and then clicks on next to go to the next lesson:

/assessments/assessment
/anu_lms/progress

inside "/anu_lms/progress" rest resource a call is also made to the "setCompleted()" method inside which the "anu_lms.lesson_completed" event is invoked, so now we have the "anu_lms.lesson_completed" event getting called two times, i want it to be called only once, can you please remove the following line from the "/anu_lms/progress" rest resource:

$this->lesson->setCompleted($node->id());

or do some other logic changes so that the "anu_lms.lesson_completed" event do not get called twice.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.9

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024