From faaca3e8accb2bad20d52a0156f773e6da59cca5 Mon Sep 17 00:00:00 2001 From: Jane Adelmann Date: Tue, 5 Mar 2024 12:56:36 +0200 Subject: [PATCH] v3.14.7 Add compapability with bulk upload plugin --- lib.php | 10 +++------- version.php | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib.php b/lib.php index becc841..81b5f74 100644 --- a/lib.php +++ b/lib.php @@ -797,16 +797,12 @@ display: inline-block;" // Set the author and submitter. $submitter = $eventdata['userid']; - $author = (!empty($eventdata['relateduserid'])) ? $eventdata['relateduserid'] : $eventdata['userid']; // Related user ID will be NULL if an instructor submits on behalf of a student who is in a group. // To get around this, we get the group ID, get the group members and set the author as the first student in the group. if ((empty($eventdata['relateduserid'])) && ($eventdata['other']['modulename'] == 'assign') && has_capability('mod/assign:editothersubmission', $context, $submitter)) { $moodlesubmission = $DB->get_record('assign_submission', array('id' => $eventdata['objectid']), 'id, groupid'); - if (!empty($moodlesubmission->groupid)) { - $author = $this->get_first_group_author($cm->course, $moodlesubmission->groupid); - } } if ($eventdata['other']['modulename'] === 'forum' @@ -976,7 +972,7 @@ display: inline-block;" $moodlesubmission = $DB->get_record('assign_submission', array('id' => $eventdata['objectid']), 'id'); $moodletextsubmission = $DB->get_record('assignsubmission_onlinetext', - array('submission' => $moodlesubmission->id), 'onlinetext'); + array('submission' => $eventdata['objectid']), 'onlinetext'); if ($moodletextsubmission) { $eventdata['other']['content'] = $moodletextsubmission->onlinetext; @@ -984,8 +980,8 @@ display: inline-block;" $filesconditions = array( 'component' => 'assignsubmission_file', - 'itemid' => $moodlesubmission->id, - 'userid' => $author + 'itemid' => $eventdata['objectid'], + 'userid' => $eventdata['userid'] ); $moodlefiles = $DB->get_records('files', $filesconditions); diff --git a/version.php b/version.php index 582f3ea..819273f 100644 --- a/version.php +++ b/version.php @@ -26,9 +26,9 @@ defined('MOODLE_INTERNAL') || die(); if (!isset($plugin)) { $plugin = new stdClass(); } -$plugin->version = 2023112019; +$plugin->version = 2024030512; $plugin->requires = 2020061501; // Requires Moodle 3.9 . -$plugin->release = 'v3.14.6'; +$plugin->release = 'v3.14.7'; $plugin->component = 'plagiarism_pchkorg'; $plugin->maturity = MATURITY_STABLE; $plugin->dependencies = array(