Skip to content

Commit cf3952c

Browse files
Merge pull request #562 from turnitin/develop
Release 2020112601
2 parents 1859714 + c967736 commit cf3952c

26 files changed

+237
-115
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
### Date: 2020-November-26
2+
### Release: 2020112601
3+
4+
#### :wrench: Fixes and enhancements
5+
6+
#### Attached rubrics sync with the Moodle assignment
7+
8+
When attaching a rubric via the Turnitin viewer we’ll now sync this with the Moodle assignment so the next time you launch the view it is still viewable.
9+
10+
#### Institutional default settings will now apply in Turnitin and Plagiarism plugin
11+
12+
The option to search the institutional repository will now sync correctly between Turnitin and the Plagiarism plugin allowing you to set this as a default for all your plagiarism plugin assignments.
13+
14+
####Improved logic for get_pseudo_lastname()
15+
16+
Thanks to pauldamiani for bringing this to our attention!
17+
18+
---
19+
120
### Date: 2020-July-22
221
### Release: 2020072201
322

ajax.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
$submissionid = optional_param('submission', 0, PARAM_INT);
9191

9292
if ($userrole == 'Instructor') {
93+
$pluginturnitin->update_rubric_from_tii($cm);
9394
$return["status"] = $pluginturnitin->update_grades_from_tii($cm);
9495

9596
$moduleconfigvalue = new stdClass();
@@ -249,7 +250,10 @@
249250

250251
$tiisubmission = new turnitin_submission($submissionid,
251252
array('forumdata' => $forumdata, 'forumpost' => $forumpost));
252-
$tiisubmission->recreate_submission_event();
253+
254+
if ($tiisubmission->recreate_submission_event()) {
255+
$return = array('success' => true);
256+
}
253257
break;
254258

255259
case "resubmit_events":

amd/build/open_viewer.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/rubric.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/src/open_viewer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ define(['jquery'], function($) {
9797
success: function() {
9898
var requestDuration = new Date().getTime() - refreshStartTime;
9999
if (requestDuration < 3000) {
100-
window.location = window.location;
100+
window.location = window.location + '';
101101
} else {
102102
$('.turnitin_score_refresh_alert').show();
103103
}

amd/src/rubric.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ define(['jquery',
1919
rubric: function() {
2020
var that = this;
2121
$('.rubric_manager_launch').on('click', function() {
22-
that.rubricCreateModal(ModalRubricManagerLaunch.TYPE);
22+
var courseid = $(this).data('courseid');
23+
var cmid = $(this).data('cmid');
24+
that.rubricCreateModal(ModalRubricManagerLaunch.TYPE, courseid, cmid);
2325
});
2426

2527
$(document).on('click', '.rubric_view', function() {
26-
that.rubricCreateModal(ModalRubricViewLaunch.TYPE);
28+
var courseid = $(this).data('courseid');
29+
var cmid = $(this).data('cmid');
30+
that.rubricCreateModal(ModalRubricViewLaunch.TYPE, courseid, cmid);
2731
});
2832

2933
// Show warning when changing the rubric linked to an assignment.
@@ -35,13 +39,12 @@ define(['jquery',
3539
}
3640
});
3741
},
38-
rubricCreateModal: function(modalType) {
39-
var courseid = ($('input[name="course"]')) ? $('input[name="course"]').val() : 0;
40-
42+
rubricCreateModal: function(modalType, courseid, cmid) {
4143
ModalFactory.create({
4244
type: modalType,
4345
templateContext: {
4446
courseid: courseid,
47+
cmid: cmid,
4548
wwwroot: M.cfg.wwwroot
4649
},
4750
large: true
@@ -53,4 +56,4 @@ define(['jquery',
5356
});
5457
}
5558
};
56-
});
59+
});

classes/turnitin_submission.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct($id, $data = array()) {
4343
* Get all relevant submission data to requeue submission for the cron to process.
4444
*/
4545
public function recreate_submission_event() {
46-
global $DB, $CFG;
46+
global $DB;
4747

4848
// Create module object.
4949
$moduleclass = "turnitin_".$this->cm->modname;

classes/turnitin_view.class.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ public function add_elements_to_settings_form($mform, $course, $location = "acti
276276
$this->lock($mform, $location, $locks);
277277
$mform->addHelpButton('plagiarism_compare_journals', 'journalcheck', 'plagiarism_turnitin');
278278

279-
if ($config->plagiarism_turnitin_repositoryoption == 1) {
279+
if ($config->plagiarism_turnitin_repositoryoption == PLAGIARISM_TURNITIN_ADMIN_REPOSITORY_OPTION_EXPANDED ||
280+
$config->plagiarism_turnitin_repositoryoption == PLAGIARISM_TURNITIN_ADMIN_REPOSITORY_OPTION_FORCE_INSTITUTIONAL) {
280281
$mform->addElement('select', 'plagiarism_compare_institution',
281282
get_string('compareinstitution', 'plagiarism_turnitin'), $options);
282283
$this->lock($mform, $location, $locks);
@@ -324,6 +325,8 @@ public function add_elements_to_settings_form($mform, $course, $location = "acti
324325
get_string('launchrubricmanager', 'plagiarism_turnitin'),
325326
array(
326327
'class' => 'rubric_manager_launch',
328+
'data-courseid' => $course->id,
329+
'data-cmid' => $cmid,
327330
'title' => get_string('launchrubricmanager', 'plagiarism_turnitin'),
328331
'id' => 'rubric_manager_form',
329332
'role' => 'link',

db/install.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<FIELD NAME="submitter" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="identifier"/>
1313
<FIELD NAME="identifier" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="submitter" NEXT="externalid"/>
1414
<FIELD NAME="externalid" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="identifier" NEXT="itemid"/>
15-
<FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="externalid" NEXT="statuscode"/>
15+
<FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="externalid" NEXT="statuscode"/>
1616
<FIELD NAME="statuscode" TYPE="char" LENGTH="10" NOTNULL="false" SEQUENCE="false" PREVIOUS="itemid" NEXT="similarityscore"/>
1717
<FIELD NAME="similarityscore" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="statuscode" NEXT="attempt"/>
1818
<FIELD NAME="attempt" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="similarityscore" NEXT="transmatch"/>
@@ -23,7 +23,7 @@
2323
<FIELD NAME="orcapable" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" PREVIOUS="submissiontype" NEXT="errorcode"/>
2424
<FIELD NAME="errorcode" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" PREVIOUS="orcapable" NEXT="errormsg"/>
2525
<FIELD NAME="errormsg" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" PREVIOUS="errorcode" NEXT="student_read"/>
26-
<FIELD NAME="student_read" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="errormsg" NEXT="gm_feedback"/>
26+
<FIELD NAME="student_read" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="errormsg" NEXT="gm_feedback"/>
2727
<FIELD NAME="gm_feedback" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="student_read" NEXT="duedate_report_refresh"/>
2828
<FIELD NAME="duedate_report_refresh" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="0 => Report does not need updating, 1 => Originality report needs to be updated, 2 => Report has been updated" PREVIOUS="gm_feedback"/>
2929
</FIELDS>
@@ -53,8 +53,8 @@
5353
<FIELDS>
5454
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" NEXT="userid"/>
5555
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="id" NEXT="turnitin_uid"/>
56-
<FIELD NAME="turnitin_uid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="userid" NEXT="turnitin_utp"/>
57-
<FIELD NAME="turnitin_utp" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" UNSIGNED="false" SEQUENCE="false" PREVIOUS="turnitin_uid" NEXT="instructor_rubrics"/>
56+
<FIELD NAME="turnitin_uid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="userid" NEXT="turnitin_utp"/>
57+
<FIELD NAME="turnitin_utp" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="0" UNSIGNED="false" SEQUENCE="false" PREVIOUS="turnitin_uid" NEXT="instructor_rubrics"/>
5858
<FIELD NAME="instructor_rubrics" TYPE="text" LENGTH="medium" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="turnitin_utp" NEXT="user_agreement_accepted"/>
5959
<FIELD NAME="user_agreement_accepted" TYPE="int" LENGTH="1" NOTNULL="false" DEFAULT="0" UNSIGNED="false" SEQUENCE="false" PREVIOUS="instructor_rubrics"/>
6060
</FIELDS>
@@ -69,9 +69,9 @@
6969
<FIELDS>
7070
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" NEXT="courseid"/>
7171
<FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="id" NEXT="ownerid"/>
72-
<FIELD NAME="ownerid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="courseid" NEXT="turnitin_ctl"/>
73-
<FIELD NAME="turnitin_ctl" TYPE="text" LENGTH="medium" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="ownerid" NEXT="turnitin_cid"/>
74-
<FIELD NAME="turnitin_cid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="turnitin_ctl"/>
72+
<FIELD NAME="ownerid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="courseid" NEXT="turnitin_ctl"/>
73+
<FIELD NAME="turnitin_ctl" TYPE="text" LENGTH="medium" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="ownerid" NEXT="turnitin_cid"/>
74+
<FIELD NAME="turnitin_cid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="turnitin_ctl"/>
7575
</FIELDS>
7676
<KEYS>
7777
<KEY NAME="primary" TYPE="primary" FIELDS="id" />

0 commit comments

Comments
 (0)