Skip to content
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

Merge upstream master to master-catalyst latest release v2025030501 #23

Open
wants to merge 10 commits into
base: master-catalyst
Choose a base branch
from
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### Date: 2025-March-05
### Release: v2025030501

---

#### Quiz Attempt Issue Fixed
An issue was identified which affected the ability of users to view student submissions to quizzes in Moodle 4.1. This has now been fixed.

---

### Date: 2024-December-19
### Release: v2024121901

Expand Down
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ function xmldb_plagiarism_turnitin_upgrade($oldversion) {
$dbman->add_index($table, $index);
}
}

upgrade_plugin_savepoint(true, 2021101800, 'plagiarism', 'turnitin');
}

Expand Down Expand Up @@ -568,7 +569,6 @@ function xmldb_plagiarism_turnitin_upgrade($oldversion) {
}
upgrade_plugin_savepoint(true, 2022072501, 'plagiarism', 'turnitin');
}

return $result;
}

Expand Down
17 changes: 15 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,14 @@ public function event_handler($eventdata) {

// Queue every question submitted in a quiz attempt.
if ($eventdata['eventtype'] == 'quiz_submitted') {
$attempt = mod_quiz\quiz_attempt::create($eventdata['objectid']);

if (class_exists('\mod_quiz\quiz_attempt')) {
$quizattemptclass = '\mod_quiz\quiz_attempt';
} else {
$quizattemptclass = 'quiz_attempt';
}
$attempt = $quizattemptclass::create($eventdata['objectid']);

foreach ($attempt->get_slots() as $slot) {
$qa = $attempt->get_question_attempt($slot);
if ($qa->get_question()->get_type_name() != 'essay' && $qa->get_question()->get_type_name() != 'coderunner') {
Expand Down Expand Up @@ -3203,7 +3210,13 @@ function plagiarism_turnitin_send_queued_submissions() {

require_once($CFG->dirroot . '/mod/quiz/locallib.php');
try {
$attempt = mod_quiz\quiz_attempt::create($queueditem->itemid);
if (class_exists('\mod_quiz\quiz_attempt')) {
$quizattemptclass = '\mod_quiz\quiz_attempt';
} else {
$quizattemptclass = 'quiz_attempt';
}
$attempt = $quizattemptclass::create($queueditem->itemid);

} catch (Exception $e) {
plagiarism_turnitin_activitylog(get_string('errorcode14', 'plagiarism_turnitin'), "PP_NO_ATTEMPT");
$errorcode = 14;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @copyright 2012 iParadigms LLC
*/

$plugin->version = 2024121901;
$plugin->version = 2025030501;

$plugin->release = "4.1+";
$plugin->requires = 2018051700;
Expand Down