danmarsden / moodle-local_recompletion Goto Github PK
View Code? Open in Web Editor NEWAllows course recompletion
Allows course recompletion
Hi - hoping you can assist with this issue.
Recompletion scheduled task keeps failing with the error message 'The conversion of the nvarchar value '8639913600' overflowed an int column' - see attached log.
Initially ran ok but started failing once courses started using the option.
Running on Windows stack
Moodle 3.10.4 (Build: 20210510)
PHP 7.2.26
MSSQL 11.00.7493
local_recompletion | 2.02020122300
local_recompletion_task_check_recompletion-129064.log
Thanks - Phil
The plugin description reads "WARNING: This is currently proof of concept code - it should not be used in production!" yet the version.php has declared
$plugin->maturity = MATURITY_STABLE;
Maybe it would help to have the maturity set to ALPHA so that it raises a warning in the plugin installer.
Hi, i have solution for archives,
if would not be beter to storage all archived data in one table, as json data, for example:
quiz->idnumber= array(quiz_attempts->idnumber= array("quiz_attempt_row"),)
ad so,
scheme
module->id=array_of_archived_tables(module_table=table_row);
I recently discovered that the recompletion tables are empty even though I'm forcing the archival of completion data in the plugin's global settings. I know that we've had several completion resets happen, both in my testing and actual students, so that confirms the plugin is running. I also have the scheduled task set to run every 5 minutes while I'm testing its function.
I'm attaching a screenshot of my global plugin settings.
We love the way this plugin is working and how we can use it in courses.
And now we want to implement it within our LTI provider courses in Moodle 3.5, 3.8 and 3.9.
I did a test to see if it would work and if not what is needed.
And the even though the Course Recompletion plugin nicely removes the grade, the LTI provider saves in a separated table "enrol_lti_user" the last grade send.
Due to this, whenever a new grade is the same as in the last_grade in the Enrol_lti_User table de cron job LTI Grade sync, skips the grade and is not sending it towards the LTI consumer.
In my test, every higher and lower grade is being send, it just refuses to send the “same grade”.
I understand why this is build in from an LTI Provider point of view, and it does not seem to be logically to make a change there.
But for re completing a Moodle course using the LTI provider tool, we will need it to work.
To make it work, I would suggest to build in an new (extra) functionality in the Course Recompletion plugin similar to the Quiz, SCORM and Assignement options for the LTI Provider (Moodle standard!) in the ADVANCED section.
The setting would be similar to the other settings:
LTI Provider last grade send:
Do nothing (last grade stays in the table enrol_lti_user)
Delete last grade send (last grade in table enrol_lti_user will be removed)
Archive last grade send (last grade will be removed in table enrol_lti_user, but will be logged in local_recompletion_ltia (or table name that seems fitting to the developer) in a similar way as the Quiz module : LTI TOOL ID, Moodle USER ID, lastaccess, modified, course)
Dan, this is wonderful plugin. I wonder maybe there is a way to update the course completion date for all user in one step. Do you have any plan to introduce this feature?
There are a couple of major issues (bugs) that I have detected.
This even happens if you delete all submissions one a new submission is reset the old ones reappear as though they are being restored. It would not be all bad if it did not send out multiple emails to the learners.
I’m using Moodle 4.2 and the latest version of the plugin.
I read in many forum threads about recompletion, that resetting the certificates with a recompletion was something asked for a lot and planned to implement. In the docs it is not mentioned at all, though.
Is there a way or a workaround to issue new certificates (coursecertificate or customcertificate) when the course is reset for a student and the course or an activity is completed again?
As I found, it seems that coursecertificate does not issue a new certificate if one exists already, even if it is expired as a consequence of its own settings.
With badges I understand, that badges are something earned and built upon, but certificates are a different thing.
Is there a way to solve this?
(Usually the recommendations are that one could just set up a new certificate, but that only works if entire cohorts - in the original meaning of the word - start the course together and not at different times. Which is exactly why this plugin exists, as I understand...)
I jumped into an issue with the CourseRecompletion when used in a course with multiple LTI Tools. It did not seem to save data in the local_recompletion_ltia and did not clean the finalgrade in the enrol_lti table.
I have asked @luukverhoeven to take a look at it and he fixed the issue and will send in a push request.
It would be great if this could be checked/accepted as soon as possible.
Gemma
Hi,
It seems that local_recompletion_ltia
table isn't listed in privacy provider get_metadata()
:
There was 1 failure:
1) provider_testcase::test_table_coverage
The following tables with user fields must be covered with metadata providers:
- local_recompletion_ltia (userid)
/siteroot/privacy/tests/provider_test.php:327
/siteroot/lib/phpunit/classes/advanced_testcase.php:80
To re-run:
vendor/bin/phpunit "provider_testcase" privacy/tests/provider_test.php
Example: Using a single-activity course with an assignment
SETUP & GRADE
RESET
5. Edit course completion date for that student, choose a past date longer than the course duration from step 1.
6. Confirm grades have been deleted.
VIEW ISSUE
8. Navigate back to Assignment: "View all submissions" or "Grade"
9. View all submissions: Grade Status is "Graded", and the pass grade is still showing (not reset)
10. Grade: Grade status is "Graded", and the pass grade is still showing (not reset). In addition, directly underneath says "not graded"
We should retain a history of previous activity and course completions for auditing/reporting etc. - a bit liek the way grade history is kept.
We have quiz that has a restriction configured that requires 2 choice activities to be complete before the quiz can be accessed. (The choice activities are there for the purpose of the student agreeing to a policy and confirming they've read the instructions.)
What we're experiencing is that the recompletion plugin is not resetting the activity completion for the purpose of the restriction. The student visits the course for their second enrollment and the 2 choice activities still appear to the student as having been complete, however, in the activity completion report they do not have check marks for those activities.
The result is that the student cannot complete the activity again, but also the quiz will not allow them access because the quiz doesn't consider the activities complete to satisfy the restriction requirement.
The student notification email should allow a template to be set (like reengagement activity)
Hi,
I've noticed a fatal error while testing the plugin and running cron:
Execute scheduled task: Check for users that need to recomplete (local_recompletion\task\check_recompletion)
PHP Fatal error: Class 'completion_info' not found in /var/www/moodle/local/recompletion/classes/task/check_recompletion.php on line 52
in most cases, I think the recompletion message should be sent from support email address, if
support email address is not configured on Moodle, it should be sent from noreply email address, instead of site adminstrator's email address.
Allow the admin to set up a default email template to use so that teachers don't have to customise the e-mail each time.
Ciao,
potresti prevedere il Recompletion basato sul mancato superamento del quiz?
Grazie!
Hi Dan,
It seems like the Reset function not reset the Quiz properly when you have limited attempts in the settings. You still have your old attempts there and when checking for adding new attempts, that does not happen.
This can prevent data loss if recompletions are accidentally set up with archiving disabled.
We updated our LMS to release 2023040300 (2023040301).
Our notifications no longer behave as expected.
The placeholders within the body are not adding the expected values. The subject line is working as expected.
The body displays correctly until the reveal html is selected.
When I displayed the body in html the -> was replaced with >
I have tried multiple times to replace the > with -> and save the notification.
When I open the notification in html it is displayed with the > values.
This affects 49 courses to hundreds of students.
Hi Dan and team,
Thanks for your work developing this plugin! I'm not sure if this is intended behaviour, but I couldn't recognise anything in the documentation.
Once an expiration triggers a course reset, all course and assignment data for the student is cleared - assignment status, assignment grade, all dates, file submissions, comments, feedback files, feedback notes, final grade, completion status...
The activity settings which appear to cause this are:
Activity Settings: Submission settings: Additional Attempts: Automatic until pass
Activity Settings: Submission settings: Maximum Attempts: Unlimited
I was finally able to retain data by changing
Additional Attempts: Manual
Maximum Attempts: 1
Hello,
We have a situation where a course needs to be completed yearly during a set period of time regardless of when the course was last completed. This situation comes up when a new hire is trained outside of the required timeframe during their first calendar year, but the following calendar year they need to complete the course during the set period of time, which could be just a month from the last time.
Is this in the roadmap, or is there a way to accomplish this that I am not seeing?
We are running Moodle 3.9.6 and plugin version 2021092000.
Regards,
Ron
I feel like I must be missing something here, but I've reproduced this issue on two Moodle sites. It looks like, when making changes to the course-level recompletion settings for specific plugins (Course > Course Recompletion > Advanced), the changes are not actually saved in the database.
This seems to be because of the way the plugin tries to set these settings in recompletion.php. The code gets a list of the supported plugins, and then iterates over that list trying to grab the relevant settings from the form data using the plugin name. The problem is that the list returned by local_recompletion_get_supported_plugins() does not match the plugin names given by the form data. Here's an example of the form data that might be passed:
{
["enable"]=>
string(1) "1"
["recompletionduration"]=>
int(0)
["mform_isexpanded_id_emailheader"]=>
int(0)
["recompletionemailsubject"]=>
string(0) ""
["recompletionemailbody"]=>
string(0) ""
["mform_isexpanded_id_advancedheader"]=>
int(1)
["deletegradedata"]=>
string(1) "1"
["assign"]=>
string(1) "0"
["questionnaire"]=>
string(1) "1"
["quiz"]=>
string(1) "1"
["scorm"]=>
string(1) "1"
["submitbutton"]=>
string(12) "Save changes"
["course"]=>
int(13)
["forcearchive"]=>
int(0)
}
And here's the setnames variable that gets built from the above mentioned function:
{
[0]=>
string(6) "enable"
[1]=>
string(20) "recompletionduration"
[2]=>
string(15) "deletegradedata"
[3]=>
string(21) "archivecompletiondata"
[4]=>
string(23) "recompletionemailenable"
[5]=>
string(24) "recompletionemailsubject"
[6]=>
string(21) "recompletionemailbody"
[7]=>
string(11) "assignevent"
[8]=>
string(10) "mod_assign"
[9]=>
string(17) "archivemod_assign"
[10]=>
string(7) "mod_lti"
[11]=>
string(14) "archivemod_lti"
[12]=>
string(17) "mod_questionnaire"
[13]=>
string(24) "archivemod_questionnaire"
[14]=>
string(8) "mod_quiz"
[15]=>
string(15) "archivemod_quiz"
[16]=>
string(9) "mod_scorm"
[17]=>
string(16) "archivemod_scorm"
}
As you can see, the plugin names don't match. The plugin will try to get a value by doing $data->$name -- for example, $data->mod_quiz -- but this doesn't exist; instead, it would need to be $data->quiz.
Into table local_recompletion_config fild "value" is translated to "clob" on oracle database due to using "text" in install.xml as type for that colum. Having value as clob, breaks the query at the biginning execute () function of scheduled task.
Similar issue on query:
SELECT DISTINCT a. *
FROM {assign} a
JOIN {assign_submission} s ON a.id = s.assignment
WHERE a.course =? AND s.userid =?
of rest_assign funciton. Having "distinct" into select breaks the query due to a clob field in assign table. Maybe using only a.id as select fix this problm considering that "id" is the only field used in that pice of code.
We run courses with serveral groups, it would be nice if we could set a Course Completion Reset Period per group.
The message and what to reset does not change.
@danmarsden if you think this is a valid request, then - if you don't mind - I can discuss with the team to create the change code. I am just not sure if:
and maybe I am missing other things to concider.
Probably need to backup the recompletion settings within a course.
I'm wondering if it's possible to insert completion data (in the same format as the local_recompletion_cc table). My use case is for adding completion data from another LMS.
End Dated Courses (Retired) are still sending Reminder Notifications.
Right now you can do a bulk action change completion date for selected users -it would be nice to also have the option for a bulk action ** reset all completion for selected users** on the same page (/local/recomplation/participants (modify course completion dates)
Recompletion should be logged and trigger standard Moodle events.
should we provide the ability to delete content within specific modules? - deleting quiz attempts/assignments/SCORM attempts.
my current thoughts are "no we shouldn't" but maybe we could add support to allow the number of allowed attempts to be bumped... giving students the ability to submit a new attempt to some activities that support it.
Looks like grade_history table is only built when we delete grades using the API - we need to change this line:
https://github.com/danmarsden/moodle-local_recompletion/blob/master/classes/task/check_recompletion.php#L102
to get a list of the grade_items and then call the grade_grades::delete() (or something similar that triggers the delete from the parent "grade_items" class)
I have scheduled the all the cron's and everything successfully completed for the past days, but now a days having issue with the recompletion cron, please look on the below content that i taken from the cron log file(First its printed the task completed and then task failed printing)
Can you please help me to find out the issue, because of this other crons also not running.
Execute scheduled task: Check for users that need to recomplete (local_recompletion\task\check_recompletion)
... started 22:30:44. Current memory use 49.7MB.
... used 112 dbqueries
... used 3164.0160620213 seconds
Scheduled task complete: Check for users that need to recomplete (local_recompletion\task\check_recompletion)
... used 113 dbqueries
... used 3164.0176432133 seconds
Scheduled task failed: Check for users that need to recomplete (local_recompletion\task\check_recompletion),Error reading from database
!!! Error reading from database !!!
the archive tables may contain user information that needs to be exposed to the privacy api.
if the course recompletion is not enable or the the course is not completed, it is more reasonable to hide the 'Reset my activity completion' button
Issue when checking db schema, which probably happened post-upgrade
Detected on Moodle 3.9
local_recompletion_qr
column 'course' has default 'NULL', expected '0' (I)
Version 2022032400
To reproduce...
The page can no longer be displayed. I'm guessing that clearing a cache may fix it but I haven't tried
Debug info: Unknown column 'coursecompletion' in 'order clause'
SELECT COALESCE(ul.timeaccess, 0) AS lastaccess , u.id, u.username, u.idnumber, u.email, u.picture, u.firstname, u.lastname, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.imagealt, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance, ctx.locked AS ctxlocked
FROM (SELECT DISTINCT udistinct.id
FROM mdl_user udistinct
JOIN mdl_user_enrolments ue ON ue.userid = udistinct.id
JOIN mdl_enrol e ON e.id = ue.enrolid
AND e.courseid = ?
WHERE udistinct.deleted = 0 AND udistinct.id <> ?
) targetusers
JOIN mdl_user u ON u.id = targetusers.id
LEFT JOIN mdl_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = ?)
LEFT JOIN mdl_context ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = ?)
ORDER BY coursecompletion ASC, lastname ASC LIMIT 0, 20
-- line 117 of /user/classes/table/participants_search.php: call to mysqli_native_moodle_database->get_recordset_sql()
-- line 421 of /user/classes/table/participants.php: call to core_user\table\participants_search->get_participants()
-- line 162 of /local/recompletion/classes/table/participants.php: call to core_user\table\participants->query_db()
-- line 174 of /local/recompletion/participants.php: call to local_recompletion\table\participants->out()
[array (
0 => '8283',
1 => '1',
2 => '8283',
3 => 30,
)]
we have a scenario, the courses need to recomplete after two years, on the same date. I found the bigest duration unit option is weeks, I think we can add years and months to the unit options. I have had my own implement, I will send a pull request to you.
Allow the teacher to specify which activities should be reset - an example of this use could allow for the initial
course completion to use a specific certificate activity, but subsequent completions could use a different
instance of the certificate activity - there could also be activities within the course that do not requite re-completion.
It should be possible to notifiy other people (teachers/admins etc) when a user recompletion event occurs.
should allow e-mails to be configured.
Due to how Attempts Allowed are managed in Moodle Quiz Activity Core (1-10 or unlimited), this plugin doesn't issue additional attempts upon recompletion processing if the users' total attempts > 10.
Appreciate any fix or workaround.
Hi Dan,
Some missing strings are causing unit tests fail:
There was 1 failure:
1) core_privacy\privacy\provider_test::test_metadata_provider with data set "local_recompletion" ('local_recompletion', 'local_recompletion\privacy\provider')
Expectation failed, debugging() was triggered.
Debugging: Invalid get_string() identifier: 'privacy:metadata:local_recompletion_cha' or component 'local_recompletion'. Perhaps you are missing $string['privacy:metadata:local_recompletion_cha'] = ''; in /siteroot/local/recompletion/lang/en/local_recompletion.php?
* line 356 of /lib/classes/string_manager_standard.php: call to debugging()
* line 7419 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
* line 152 of /privacy/tests/privacy/provider_test.php: call to get_string()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to core_privacy\privacy\provider_test->test_metadata_provider()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 661 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 97 of phpvfscomposer:///vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 118 of /vendor/bin/phpunit: call to include()
Failed asserting that 1 matches expected 0.
/siteroot/lib/phpunit/classes/advanced_testcase.php:398
/siteroot/privacy/tests/privacy/provider_test.php:153
/siteroot/lib/phpunit/classes/advanced_testcase.php:80
phpvfscomposer:///siteroot/vendor/phpunit/phpunit/phpunit:97
FAILURES!
Tests: 1497, Assertions: 11670, Failures: 1.
The latest changes use some deprecated Apis that need to be updated for 3.9 so it doesn't throw debugging notices.
core_user_renderer->unified_filter() is deprecated. Please use participants_filter() instead.
line 124 of /user/renderer.php: call to debugging()
line 205 of /local/recompletion/participants.php: call to core_user_renderer->unified_filter()
core_user\output\unified_filter class is deprecated. Please use \core\table\participants_search::class with table filtersets instead.
line 64 of /user/classes/output/unified_filter.php: call to debugging()
line 259 of /user/renderer.php: call to core_user\output\unified_filter->__construct()
line 205 of /local/recompletion/participants.php: call to core_user_renderer->unified_filter()
also some copied api functions that we don't need to maintain in the code related to the participants table stuff.
Should we clear the gradebook at the same time as recompletion?
Very excited to find your plugin! However, in my testing it looks like it does not reset activities created with the H5P Interactive Content plugin.
Any chance this can be implemented? Or guidance on how I might be able to hack it myself?
Hi,
i have one question, about issued badges,
when is completion cleared, i think it would be fine for removing issued badges on that completion too.
I can make implementation for this.
We have some courses which use local_recompletion where learners have a limited number of attempts on a quiz and are then required to speak to their educator who may choose to give them extra attempts.
When Recompletion is engaged, all quiz attempts are deleted but the user overrides remain, so instead of getting the x attempts they should get getting, they get x+n.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.