-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add response for AJAX check so completion check only needs to happen so long as the activity is not completed #163
Comments
I have also made an addition to the header.php, to use caching instead of DB lookups to help reduce DB look-ups since the DB lookups are happening for records that don't really change, unless the activity is updated, deleted, or course is deleted. This way the activity can be cached and reduce the lookups to one per activity, till the cache is renewed. Since the AJAX function calls completion check which has 3 DB lookups per include. This can get pretty heavy in a big environment with a huge number of users. |
Thanks for this. Completion checking is definately an area that needs attention but I'm deliberately not looking at it this release to avoid too much scope. |
@caperneoignis - I know it has been a while since you commented on this, but any chance you have a PR for this? I'm resurrecting this repo and pushing for a v2.0 release with all current issues resolved. |
A lot has changed since this issue was submitted. The completion based on view has been implemented along with the newer (moodle 3.11) custom_completion.php requirements. The only item not implemented from this issue is the verbose execution of completion_check.php. |
The completion_check.php now only checks for completion if the cached completionstate isn't completed: bb7db56 |
Currently AJAX continues to check for completion as long as the person is taking the content. However, this does not handle if the user is retaking a completed activity, or has completed it and is still in the activity.
This is a good addition to avoid the LRS having unnecessary traffic for activities that are already completed.
We can pass a variable to the completion check.php file to echo "completed" for the ajax call and the ajax call only, so the ajax call only needs to happen once.
we also need to add a small condition to the completion check if the activity is marked 'user must view activity to complete it' currently this activity completion is not validated, only the event statement is being validated. If we add the small if condition. in
function tincanlaunch_get_completion_state($course, $cm, $userid, $type)
I can add this to it's own issue, but it's simple enough we can add it to this one. Up to you.
The text was updated successfully, but these errors were encountered: