Skip to content

Commit

Permalink
Merge pull request #601 from turnitin/develop
Browse files Browse the repository at this point in the history
Release 2021091501
  • Loading branch information
jmcgettrick authored Sep 15, 2021
2 parents c825826 + ded664f commit 58b088b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 21 deletions.
37 changes: 29 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,56 @@
### Date: 2021-September-15
### Release: 2021091501

#### :wrench: Fixes and enhancements

#### Empty grades in Turnitin will not override Moodle grading

When you had completed grading in Moodle and someone opened the Turnitin viewer for the submission, if no grade had been set in Turnitin, the Moodle grade would be lost. Now, the grade within Moodle will be retained and an ungraded Turnitin viewer can be opened without it causing any problems.

Note: If a grade is removed from Turnitin, it will no longer remove it from Moodle as the viewer will then be ‘empty’ and we assume that the Moodle grade is intended.

#### Only the essay type question in a Moodle Quiz will request a Similarity Report

We’ve refined this feature to only request a Similarity Report for Essay type questions. Turnitin would only ever create a report for these types of questions anyway, but a request was sent for all question types. This could cause bigger classes to become sluggish. You should notice that bigger classes that use a lot of quizzes are much easier to navigate now.

Thanks to Dan Marsden And Alex Morris for highlighting and providing a fix for this.

#### Test connection now will check the connection to Turnitin at all times

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

#### :wrench: Fixes and enhancements

####Classes will create successfully
#### 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

#### :wrench: Fixes and enhancements

####Support for Moodle 3.11
#### Support for Moodle 3.11
You can now confidently use this integration with Moodle 3.11.

####Use Turnitin with Moodle Quizzes
#### Use Turnitin with Moodle Quizzes
We can now check for similarity on any files that are uploaded as a part of a Moodle quiz.

####Cron tasks will no longer run when Moodle is not configured
#### Cron tasks will no longer run when Moodle is not configured
Thanks to alexmorrisnz for the pull request!

####Removed grades change the grade in Moodle
#### Removed grades change the grade in Moodle
When a grade is removed from Turnitin, this removal will also be reflected within Moodle as the submission being ungraded.

####Turnitin classes will now be expired along with a Moodle course
#### Turnitin classes will now be expired along with a Moodle course
We will now sync dates in Moodle with the Turnitin database. When the Moodle course expires, we will close out those classes in Turnitin. This will free up the active student count for those classes.

####Create or access Moodle assignments, forums, and workshops when Turnitin is disabled
#### Create or access Moodle assignments, forums, and workshops when Turnitin is disabled
If Turnitin is disabled for an assignment, forum, or workshop and Turnitin is unavailable by having the wrong configuration options or being under maintenance, then an error message would be shown. This bug has been fixed, and Turnitin being unreachable will no longer impact your ability to create or access your content.

####Changes to the Moodle course name will be reflected everywhere
#### Changes to the Moodle course name will be reflected everywhere
When a Moodle course title is changed, this will now be updated in Turnitin too. This will include the digital receipts students receive when they submit their paper.

---
Expand Down
6 changes: 5 additions & 1 deletion ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,12 @@
if (empty($config)) {
$config = plagiarism_plugin_turnitin::plagiarism_turnitin_admin_config();
}
if ($config->plagiarism_turnitin_enablediagnostic != 2) {
if (!isset($config->plagiarism_turnitin_enablediagnostic)) {
$turnitincomms->set_diagnostic(0);
} else {
if ($config->plagiarism_turnitin_enablediagnostic != 2) {
$turnitincomms->set_diagnostic(0);
}
}

$tiiapi = $turnitincomms->initialise_api(true);
Expand Down
11 changes: 8 additions & 3 deletions classes/turnitin_comms.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,23 @@ class turnitin_comms {
public function __construct($accountid = null, $accountshared = null, $url = null) {
$config = plagiarism_plugin_turnitin::plagiarism_turnitin_admin_config();

$tiiapiurl = (substr($config->plagiarism_turnitin_apiurl, -1) == '/') ? substr($config->plagiarism_turnitin_apiurl, 0, -1) : $config->plagiarism_turnitin_apiurl;
if (!is_null($url)) {
$this->tiiapiurl = $url;
} else {
$this->tiiapiurl = (substr($config->plagiarism_turnitin_apiurl, -1) == '/')
? substr($config->plagiarism_turnitin_apiurl, 0, -1) : $config->plagiarism_turnitin_apiurl;
}

$this->tiiintegrationid = 12;
$this->tiiaccountid = is_null($accountid) ? $config->plagiarism_turnitin_accountid : $accountid;
$this->tiiapiurl = is_null($url) ? $tiiapiurl : $url;
$this->tiisecretkey = is_null($accountshared) ? $config->plagiarism_turnitin_secretkey : $accountshared;

if (empty($this->tiiaccountid) || empty($this->tiiapiurl) || empty($this->tiisecretkey)) {
plagiarism_turnitin_print_error( 'configureerror', 'plagiarism_turnitin' );
}

$this->diagnostic = $config->plagiarism_turnitin_enablediagnostic;
$this->diagnostic = (isset($config->plagiarism_turnitin_enablediagnostic))
? $config->plagiarism_turnitin_enablediagnostic : 1;
$this->langcode = $this->get_lang();
}

Expand Down
19 changes: 11 additions & 8 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1357,10 +1357,10 @@ private function update_submission($cm, $submissionid, $tiisubmission) {

// Identify if an update is required for the similarity score and grade.
if ($submissiondata->similarityscore != $plagiarismfile->similarityscore ||
$submissiondata->grade != $plagiarismfile->grade ||
$submissiondata->orcapable != $plagiarismfile->orcapable ||
$submissiondata->student_read != $plagiarismfile->student_read ||
$submissiondata->gm_feedback != $plagiarismfile->gm_feedback) {
$submissiondata->grade != $plagiarismfile->grade ||
$submissiondata->orcapable != $plagiarismfile->orcapable ||
$submissiondata->student_read != $plagiarismfile->student_read ||
$submissiondata->gm_feedback != $plagiarismfile->gm_feedback) {
$updaterequired = true;
}

Expand Down Expand Up @@ -1427,7 +1427,7 @@ private function update_submission($cm, $submissionid, $tiisubmission) {
array('iteminstance' => $cm->instance, 'itemmodule' => $cm->modname,
'courseid' => $cm->course, 'itemnumber' => 0));

if (!empty($gradeitem) && $gbupdaterequired) {
if (!is_null($plagiarismfile->grade) && !empty($gradeitem) && $gbupdaterequired) {
$return = $this->update_grade($cm, $tiisubmission, $submissiondata->userid);
}
}
Expand All @@ -1444,11 +1444,11 @@ private function update_grade($cm, $submission, $userid) {
global $DB, $USER, $CFG;
$return = true;

if ($cm->modname != 'forum') {
if (!is_null($submission->getGrade()) && $cm->modname != 'forum') {
// Module grade object.
$grade = new stdClass();
// If submission has multiple content/files in it then get average grade.
// Ignore files no longer part of submission.
// Ignore NULL grades and files no longer part of submission.

// Create module object.
$moduleclass = "turnitin_".$cm->modname;
Expand Down Expand Up @@ -1482,7 +1482,7 @@ private function update_grade($cm, $submission, $userid) {
}
$grade->grade = (!is_null($averagegrade) && $gradescounted > 0) ? (int)($averagegrade / $gradescounted) : null;
} else {
$grade->grade = ($submission->getGrade() == '') ? null : $submission->getGrade();
$grade->grade = $submission->getGrade();
}

// Check whether submission is a group submission - only applicable to assignment module.
Expand Down Expand Up @@ -2563,6 +2563,9 @@ public function event_handler($eventdata) {
$attempt = quiz_attempt::create($eventdata['objectid']);
foreach ($attempt->get_slots() as $slot) {
$qa = $attempt->get_question_attempt($slot);
if ($qa->get_question()->get_type_name() != 'essay') {
continue;
}
$eventdata['other']['content'] = $qa->get_response_summary();

// Queue text content.
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 = 2021081301;
$plugin->version = 2021091501;
$plugin->release = "3.5+";
$plugin->requires = 2018051700;
$plugin->component = 'plagiarism_turnitin';
Expand Down

0 comments on commit 58b088b

Please sign in to comment.