Show
Prerequisites
A course with an assignment module
Three users enrolled in the course from 1 (we'll call them Student A, Student B, and Student C)
Testing
Without the patch applied
You need to make sure you're running a site WITHOUT the patch applied first. To do that:
Create a fresh instance, but don't install yet
Checkout the latest weekly or on-demand release:
For master:
git checkout 35f39c45b75
For 400:
git checkout dbb2deed8c0
For 311:
git checkout 24bc7e9a196
Install the site as normal
Install and enable the dummy fileconverter plugin
git clone git@github.com:catalyst/moodle-fileconverter_dummy.git files/converter/dummy
Browse to "Site administration > Plugins > Document converters > Manage document converters" and open the eye on the "Dummy" converter - ensure all other converters are disabled
As Student A browse to the assignment and submit a text file with some small amount of content in it, e.g.,:
myfileA.txt
this is Student A's submission
Do the same as Student B but with a different text file containing different content, e.g.,:
myfileB.txt
this is Student B's submission
Run the relevant command to process the adhoc/scheduled task:
For master :
php admin/cli/adhoc_task.php -e
For 4.0 and 3.11 :
php admin/cli/scheduled_task.php --execute=\\assignfeedback_editpdf\\task\\convert_submissions
Verify you see some output from the dummy converter showing conversions started for both students:
Execute adhoc task: assignfeedback_editpdf\task\convert_submission
Adhoc task id: 3
Adhoc task custom data: {"submissionid":"2","submissionattempt":"0"}
... started 16:59:27. Current memory use 21.6Â MB.
Converting submission for user id 3
Dummy conversion started.
Conversion still in progress. Requeueing self to check again.
... used 42 dbqueries
... used 0.27109098434448 seconds
Adhoc task complete: assignfeedback_editpdf\task\convert_submission
Execute adhoc task: assignfeedback_editpdf\task\convert_submission
Adhoc task id: 4
Adhoc task custom data: {"submissionid":"3","submissionattempt":"0"}
... started 16:59:28. Current memory use 38.8Â MB.
Converting submission for user id 4
Dummy conversion started.
Conversion still in progress. Requeueing self to check again.
... used 31 dbqueries
... used 0.14274597167969 seconds
Adhoc task complete: assignfeedback_editpdf\task\convert_submission
Wait 60 seconds and run the adhoc/scheduled task again
Verify you see some output from the dummy converter showing conversions completed for both students:
Execute adhoc task: assignfeedback_editpdf\task\convert_submission
Adhoc task id: 5
Adhoc task custom data: {"submissionid":"2","submissionattempt":"0"}
... started 17:00:44. Current memory use 14.3Â MB.
Converting submission for user id 3
Dummy conversion completed.
The document has been successfully converted
... used 108 dbqueries
... used 1.248309135437 seconds
Adhoc task complete: assignfeedback_editpdf\task\convert_submission
Execute adhoc task: assignfeedback_editpdf\task\convert_submission
Adhoc task id: 6
Adhoc task custom data: {"submissionid":"3","submissionattempt":"0"}
... started 17:00:45. Current memory use 50.3Â MB.
Converting submission for user id 4
Dummy conversion completed.
The document has been successfully converted
... used 103 dbqueries
... used 1.1581900119781 seconds
Adhoc task complete: assignfeedback_editpdf\task\convert_submission
Tail your error logs as the next steps are carried out, e.g.,: tail -f /var/log/apache2/error.log
As admin, navigate to the assignment and view all submissions
Click the "Grade" button next to Student A
Verify that the text shown in the grader interface is the same as the text in the submitted text file
Repeat for Student B
Verify there is nothing in the error logs about document conversions
Edit Student A's text file locally ( NB do not change the filename), adding some content; e.g.,
myfile.txt
this is Student A's submission
with some extra content
As the student, go back to the assignment submission page
Press "Edit submission"
Upload the same text file (that you just modified)
You should be prompted to overwrite or rename the file, press "Overwrite"
Press "Save changes"
Run the scheduled/adhoc task again, no output from the dummy converter should be present (there should be no "Dummy conversion ..." lines)
As admin, grade Student A's assignment, the content should not have changed (will will verify that the upgrade fixes this)
With the patch applied
Apply the patch and run the upgrade from the CLI: php admin/cli/upgrade.php
Run adhoc tasks:
php admin/cli/adhoc_task.php -e
Verify you see some output indicating that one (and only one) submission has had its timemodified updated:
Execute adhoc task: assignfeedback_editpdf\task\bump_submission_for_stale_conversions
Adhoc task id: 6
Adhoc task custom data:
... started 11:25:14. Current memory use 40.1Â MB.
Set submission 2 timemodified to 1661484205
... used 5 dbqueries
... used 0.037574052810669 seconds
Adhoc task complete: assignfeedback_editpdf\task\bump_submission_for_stale_conversions
Tail your error logs (E.g. tail -f /var/log/apache2/error.log )
As admin, grade Student A's submission
Verify you see some output from the dummy converter in the error logs:
[Tue Aug 23 17:11:04.326063 2022] [php7:notice] [pid 1076237] [client 127.0.0.1:45092] Dummy conversion started., referer: http://localhost/m/stable_master/mod/assign/view.php?id=2&rownum=0&action=grader&userid=3
[Tue Aug 23 17:11:05.503660 2022] [php7:notice] [pid 1076237] [client 127.0.0.1:45092] Dummy conversion completed., referer: http://localhost/m/stable_master/mod/assign/view.php?id=2&rownum=0&action=grader&userid=3
Verify the content has updated in the assignment grader and now matches the text file
As admin, grade Student B's assignment
Verify no output from the dummy converter is present in the error logs
As Student C browse to the assignment and submit a text file with some small amount of content in it, e.g.,:
myfileC.txt
this is Student C's submission
Run the relevant adhoc/scheduled task and verify there is output from the dummy converter about Student C's submission (and no output about any other submissions):
Adhoc task custom data: {"submissionid":"4","submissionattempt":"0"}
... started 17:19:01. Current memory use 21.5Â MB.
Converting submission for user id 5
Dummy conversion started.
Conversion still in progress. Requeueing self to check again.
... used 35 dbqueries
... used 0.218022108078 seconds
Adhoc task complete: assignfeedback_editpdf\task\convert_submission
Wait 60 seconds and run it again to complete the conversion
As admin, grade Student C's submission
Verify that the text shown in the grader interface is the same as the text in the submitted text file
Edit Student C's text file locally ( NB do not change the filename), adding some content; e.g.,
myfileC.txt
this is Student C's submission
with some extra content
As Student C, go back to the assignment submission page
Press "Edit submission"
Upload the same text file (that you just modified)
You should be prompted to overwrite or rename the file, press "Overwrite"
Press "Save changes"
Tail your error logs  (E.g. tail -f /var/log/apache2/error.log )
As admin, grade Student C's submission
Verify you see some output from the dummy converter in the error logs:
[Tue Aug 23 17:22:33.474669 2022] [php7:notice] [pid 2575696] [client 127.0.0.1:45202] Dummy conversion started., referer: http://localhost/m/stable_master/mod/assign/view.php?id=2&rownum=0&action=grader&userid=5
[Tue Aug 23 17:22:34.640888 2022] [php7:notice] [pid 2717556] [client 127.0.0.1:45208] Dummy conversion completed., referer: http://localhost/m/stable_master/mod/assign/view.php?id=2&rownum=0&action=grader&userid=5
Verify the content has updated in the assignment grader and now matches the text file
Regression testing
NB: It's probably easiest to do this on a fresh install. The prerequisites are the same as before. You'll need:
A course with 3 students enrolled
Installed and enabled the dummy document converter plugin (Refer to Step 2 earlier in the testing for details on how to install + enable this plugin)
As Student A browse to the assignment and submit a text file with some small amount of content in it, e.g.,:
myfile.txt
this is my text file
Run the relevant command to process the adhoc/scheduled task:
For master :
php admin/cli/adhoc_task.php -e
For 4.0 and 3.11 :
php admin/cli/scheduled_task.php --execute=\\assignfeedback_editpdf\\task\\convert_submissions
Verify you see some output from the dummy converter that says:
Convert 1 submission attempt(s) for assignment 1
Dummy conversion started.
Wait 60 seconds and then run the adhoc/scheduled task again
Verify you see some output from the dummy converter that says:
Convert 1 submission attempt(s) for assignment 1
Dummy conversion completed.
As admin, navigate to the assignment and view all submissions
Click the "Grade" button net to student A
Verify that the text shown in the grader interface is the same as the text in the submitted text file
As student B, submit the exact same text file
Run the relevant conversion command as per step 2
Verify you do not see any output from the dummy converter (i.e., there should be no "Dummy conversion ..." lines)
As admin, navigate to the assignment and view all submissions
Click the "Grade" button net to student B
Verify that the text shown in the grader interface is the same as the text in the submitted text file