From 72d67e635e11bf6a85c5a906d78fe46acb8f9ee4 Mon Sep 17 00:00:00 2001 From: David Winn Date: Tue, 19 Oct 2021 17:24:36 +0100 Subject: [PATCH 1/5] Set grader when updating grade --- lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib.php b/lib.php index 9b86e5ca..7f6f5492 100755 --- a/lib.php +++ b/lib.php @@ -1532,6 +1532,11 @@ private function update_grade($cm, $submission, $userid) { if ($currentgrade) { $grade->id = $currentgrade->id; + + if ($cm->modname == 'assign') { + $grade->grader = $USER->id; + } + $return = $DB->update_record($table, $grade); } else { $grade->userid = $userid; From b7beeac82bf2d4c9bffefb0d01221e72788d5987 Mon Sep 17 00:00:00 2001 From: Nick Phillips Date: Thu, 28 Oct 2021 10:42:26 +1300 Subject: [PATCH 2/5] Fix failure to submit queued items when an item's attempt is missing. --- lang/en/plagiarism_turnitin.php | 1 + lib.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lang/en/plagiarism_turnitin.php b/lang/en/plagiarism_turnitin.php index 548eb34d..f568ae61 100644 --- a/lang/en/plagiarism_turnitin.php +++ b/lang/en/plagiarism_turnitin.php @@ -260,6 +260,7 @@ $string['errorcode10'] = 'This file has not been submitted to Turnitin because there is a problem creating the class in Turnitin which is preventing submissions, please consult your API logs for further information'; $string['errorcode11'] = 'This file has not been submitted to Turnitin because it is missing data'; $string['errorcode12'] = 'This file has not been submitted to Turnitin because it belongs to an assignment in which the course was deleted. Row ID: ({$a->id}) | Course Module ID: ({$a->cm}) | User ID: ({$a->userid})'; +$string['errorcode13'] = 'This file has not been submitted to Turnitin because the attempt it belongs to could not be found'; $string['queued'] = 'Queued'; $string['updatereportscores'] = 'Update Report Scores for Turnitin Plagiarism Plugin'; $string['sendqueuedsubmissions'] = 'Send Queued Files from the Turnitin Plagiarism Plugin'; diff --git a/lib.php b/lib.php index 7f6f5492..5450f3d3 100755 --- a/lib.php +++ b/lib.php @@ -3138,7 +3138,13 @@ function plagiarism_turnitin_send_queued_submissions() { } require_once($CFG->dirroot . '/mod/quiz/locallib.php'); - $attempt = quiz_attempt::create($queueditem->itemid); + try { + $attempt = quiz_attempt::create($queueditem->itemid); + } catch (Exception $e) { + plagiarism_turnitin_activitylog(get_string('errorcode13', 'plagiarism_turnitin'), "PP_NO_ATTEMPT"); + $errorcode = 13; + break; + } foreach ($attempt->get_slots() as $slot) { $qa = $attempt->get_question_attempt($slot); if ($queueditem->identifier == sha1($qa->get_response_summary())) { From 47ae104766a2f6734f12928dac18201f361c32d9 Mon Sep 17 00:00:00 2001 From: David Winn Date: Tue, 22 Mar 2022 16:31:05 +0000 Subject: [PATCH 3/5] Changing error code to 14 --- lang/en/plagiarism_turnitin.php | 2 +- lib.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/en/plagiarism_turnitin.php b/lang/en/plagiarism_turnitin.php index f568ae61..b0fd9df1 100644 --- a/lang/en/plagiarism_turnitin.php +++ b/lang/en/plagiarism_turnitin.php @@ -260,7 +260,7 @@ $string['errorcode10'] = 'This file has not been submitted to Turnitin because there is a problem creating the class in Turnitin which is preventing submissions, please consult your API logs for further information'; $string['errorcode11'] = 'This file has not been submitted to Turnitin because it is missing data'; $string['errorcode12'] = 'This file has not been submitted to Turnitin because it belongs to an assignment in which the course was deleted. Row ID: ({$a->id}) | Course Module ID: ({$a->cm}) | User ID: ({$a->userid})'; -$string['errorcode13'] = 'This file has not been submitted to Turnitin because the attempt it belongs to could not be found'; +$string['errorcode14'] = 'This file has not been submitted to Turnitin because the attempt it belongs to could not be found'; $string['queued'] = 'Queued'; $string['updatereportscores'] = 'Update Report Scores for Turnitin Plagiarism Plugin'; $string['sendqueuedsubmissions'] = 'Send Queued Files from the Turnitin Plagiarism Plugin'; diff --git a/lib.php b/lib.php index 5450f3d3..c84a9b3f 100755 --- a/lib.php +++ b/lib.php @@ -3141,8 +3141,8 @@ function plagiarism_turnitin_send_queued_submissions() { try { $attempt = quiz_attempt::create($queueditem->itemid); } catch (Exception $e) { - plagiarism_turnitin_activitylog(get_string('errorcode13', 'plagiarism_turnitin'), "PP_NO_ATTEMPT"); - $errorcode = 13; + plagiarism_turnitin_activitylog(get_string('errorcode14', 'plagiarism_turnitin'), "PP_NO_ATTEMPT"); + $errorcode = 14; break; } foreach ($attempt->get_slots() as $slot) { From e9adc669eb7758715059dc1492f3794e32544c9f Mon Sep 17 00:00:00 2001 From: David Winn Date: Wed, 23 Mar 2022 14:16:35 +0000 Subject: [PATCH 4/5] Release notes for 2022032301. --- CHANGELOG.md | 21 +++++++++++++++++++++ version.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7deaef4a..38f6d68d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +### Date: 2022-March-23 +### Release: 2022032301 + +#### :wrench: Fixes and enhancements + +#### Grader field previously not updating correctly - now resolved + +We’ve fixed an issue that was occasionally causing the grader field in Moodle assignments to not update correctly. + +#### Submission failure relating to Moodle Quiz items resolved + +A bug was discovered that was causing submissions to fail. This was found to be linked to Moodle Quiz items. This issue has been resolved. + +This fix was submitted as a pull request by [@nwp90](https://github.com/nwp90)on Github. Thanks, Nick! + +--- + ### Date: 2021-September-15 ### Release: 2021091501 @@ -19,6 +36,8 @@ Thanks to Dan Marsden And Alex Morris for highlighting and providing a fix for t Previously, Test Connection wouldn’t work until the plugin was configured. This could potentially cause confusion with users assuming that as no error had been shown the connection must already be established. We’ve changed it so that the Test Connection feature will always look to see if a successful connection has been made when checking. +--- + ### Date: 2021-August-13 ### Release: 2021081301 @@ -27,6 +46,8 @@ Previously, Test Connection wouldn’t work until the plugin was configured. Thi #### Classes will create successfully A bug potentially resulted in classes created in Moodle to not sync correctly when we tried to create them in Turnitin. We’ve fixed this problem and you will now be able to create classes again. +--- + ### Date: 2021-June-08 ### Release: 2021060801 diff --git a/version.php b/version.php index c0e71b8c..991c04a6 100644 --- a/version.php +++ b/version.php @@ -19,7 +19,7 @@ * @copyright 2012 iParadigms LLC */ -$plugin->version = 2021091501; +$plugin->version = 2022032301; $plugin->release = "3.5+"; $plugin->requires = 2018051700; $plugin->component = 'plagiarism_turnitin'; From c84eafe50f860d006cd91c33d84c53f27918cf48 Mon Sep 17 00:00:00 2001 From: David Winn Date: Wed, 23 Mar 2022 14:22:06 +0000 Subject: [PATCH 5/5] Space --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f6d68d..0b2a4a2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ We’ve fixed an issue that was occasionally causing the grader field in Moodle A bug was discovered that was causing submissions to fail. This was found to be linked to Moodle Quiz items. This issue has been resolved. -This fix was submitted as a pull request by [@nwp90](https://github.com/nwp90)on Github. Thanks, Nick! +This fix was submitted as a pull request by [@nwp90](https://github.com/nwp90) on Github. Thanks, Nick! ---