Skip to content

Commit 74f979a

Browse files
authored
Merge pull request #490 from turnitin/develop
Develop to master for release 2019121701
2 parents 6bf8d57 + 0a350a2 commit 74f979a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+99
-229
lines changed

.travis.yml

+14-33
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,35 @@ language: php
22

33
sudo: false
44

5-
addons:
6-
postgresql: "9.3"
7-
85
cache:
96
directories:
107
- $HOME/.composer/cache
118

129
php:
13-
- 5.5
14-
- 7.0
15-
- 7.2
10+
- 7.1
11+
- 7.2
12+
13+
services:
14+
- mysql
15+
- postgresql
1616

1717
env:
1818
global:
1919
- IGNORE_PATHS=sdk/,pix/,vendor/
2020
- IGNORE_NAMES=jquery*,styles.css,autoload_static.php
2121
matrix:
22-
- DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
23-
- DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE
24-
25-
26-
#TODO: Readd these once the split is complete.
27-
28-
# - DB=pgsql MOODLE_BRANCH=MOODLE_34_STABLE
29-
# - DB=mysqli MOODLE_BRANCH=MOODLE_34_STABLE
30-
# - DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
31-
# - DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
32-
33-
matrix:
34-
exclude:
35-
- env: DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
36-
php: 7.2
37-
- env: DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE
38-
php: 7.2
39-
- env: DB=pgsql MOODLE_BRANCH=MOODLE_34_STABLE
40-
php: 5.5
41-
- env: DB=mysqli MOODLE_BRANCH=MOODLE_34_STABLE
42-
php: 5.5
43-
- env: DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
44-
php: 5.5
45-
- env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
46-
php: 5.5
22+
- DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE
23+
- DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE
24+
- DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE
25+
- DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
26+
- DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE
27+
- DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE
4728

4829
before_install:
4930
- phpenv config-rm xdebug.ini
5031
- cd ../..
5132
- composer selfupdate
52-
- composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^1
33+
- composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^1
5334
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
5435

5536
install:
@@ -61,4 +42,4 @@ script:
6142
- moodle-plugin-ci csslint
6243
- moodle-plugin-ci shifter
6344
- moodle-plugin-ci validate
64-
# - moodle-plugin-ci phpunit
45+
- moodle-plugin-ci phpunit

CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
### Date: 2019-December-17
2+
### Release: v2019121701
3+
4+
#### :zap: What's new
5+
6+
---
7+
8+
#### We now support Moodle 3.8
9+
10+
You can find out more about Moodle 3.8 via Moodle's [release notes](https://docs.moodle.org/dev/Moodle_3.8_release_notes).
11+
12+
#### :wrench: Fixes and enhancements
13+
14+
---
15+
16+
#### Anonymous marking is now available again
17+
18+
A bug had prevented the use of Anonymous marking when configuring the integration. This bug has now been fixed and the anonymous marketing will remain enabled when navigating away from the configuration page.
19+
20+
#### Submissions will still display when error code 13 is detected
21+
22+
Error code 13 can appear in various circumstances where a score is not returned to Turnitin. A bug caused submissions with this error code to no longer display in the inbox. While the error code can still occur, it will no longer prevent access to the submission and it will be displayed within the inbox as intended.
23+
24+
---
25+
126
### Date: 2019-June-25
227
### Release: v2019062501
328

@@ -10,6 +35,7 @@
1035
There was an issue affecting users trying to upgrade the latest version of Moodle Plagiarism Plugin. It was discovered that users attempting to upgrade to v2019060601 from versions older than v2016011101 weren't able to do so. This latest version will allow for all users to upgrade to the latest version from any of the previous versions.
1136

1237
---
38+
1339
### Date: 2019-June-06
1440
### Release: v2019060601
1541

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Plagiarism plugins also need to be enabled before this plugin can be used. You c
2626

2727
You can set default values and whether the plugin is enabled within Moodle modules by going to `"Site Administration" > "Plugins" > "Plagiarism prevention" > "Turnitin plagiarism plugin"`.
2828

29-
To create/update assignments, process submissions and update grades your moodle environment will need to have cron job running regularly. For information on how to do this please consult http://docs.moodle.org/26/en/Cron.
29+
To create/update assignments, process submissions and update grades your moodle environment will need to have cron job running regularly. For information on how to do this please consult https://docs.moodle.org/37/en/Cron.

ajax.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,12 @@
226226
$eulauser->user_agreement_accepted = 0;
227227
if ($message == 'turnitin_eula_accepted') {
228228
$eulauser->user_agreement_accepted = 1;
229-
plagiarism_turnitin_activitylog("User ".$USER->id." (".$turnitinuser->turnitin_uid.") accepted the EULA.", "PP_EULA_ACCEPTANCE");
229+
$logstring = "User ".$USER->id." (".$turnitinuser->turnitin_uid.") accepted the EULA.";
230+
plagiarism_turnitin_activitylog($logstring, "PP_EULA_ACCEPTANCE");
230231
} else if ($message == 'turnitin_eula_declined') {
231232
$eulauser->user_agreement_accepted = -1;
232-
plagiarism_turnitin_activitylog("User ".$USER->id." (".$turnitinuser->turnitin_uid.") declined the EULA.", "PP_EULA_ACCEPTANCE");
233+
$logstring = "User ".$USER->id." (".$turnitinuser->turnitin_uid.") declined the EULA.";
234+
plagiarism_turnitin_activitylog($logstring, "PP_EULA_ACCEPTANCE");
233235
}
234236

235237
// Update the user using the above object.

classes/digitalreceipt/pp_receipt_message.php

+2-14
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ public function send_message($userid, $message, $courseid) {
3636

3737
$subject = get_string('digital_receipt_subject', 'plagiarism_turnitin');
3838

39-
// Pre 2.9 does not have \core\message\message()
40-
if ($CFG->branch >= 29) {
41-
$eventdata = new \core\message\message();
42-
} else {
43-
$eventdata = new stdClass();
44-
}
39+
$eventdata = new \core\message\message();
4540
$eventdata->component = 'plagiarism_turnitin'; // Your component name.
4641
$eventdata->name = 'submission'; // This is the message name from messages.php.
4742
$eventdata->userfrom = \core_user::get_noreply_user();
@@ -115,16 +110,9 @@ public function build_instructor_message($input) {
115110
* @return void
116111
*/
117112
public function send_instructor_message($instructors, $message) {
118-
global $CFG;
119-
120113
$subject = get_string('receipt_instructor_copy_subject', 'plagiarism_turnitin');
121114

122-
// Pre 2.9 does not have \core\message\message()
123-
if ($CFG->branch >= 29) {
124-
$eventdata = new \core\message\message();
125-
} else {
126-
$eventdata = new stdClass();
127-
}
115+
$eventdata = new \core\message\message();
128116

129117
$eventdata->component = 'plagiarism_turnitin'; // Your component name.
130118
$eventdata->name = 'submission'; // This is the message name from messages.php.

classes/forms/turnitin_form.class.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
class turnitin_form extends moodleform {
3434

3535
// Define the form.
36-
public function definition()
37-
{
36+
public function definition() {
3837
$mform =& $this->_form;
3938

4039
foreach ($this->_customdata["elements"] as $element) {
@@ -128,8 +127,7 @@ public function definition()
128127
*
129128
* @return the form as an object to print to screen at our convenience
130129
*/
131-
public function display()
132-
{
130+
public function display() {
133131
ob_start();
134132
parent::display();
135133
$form = ob_get_contents();

classes/forms/turnitin_setupform.class.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public function definition() {
4848
$mform->addElement('advcheckbox', 'turnitin_use', get_string('useturnitin', 'plagiarism_turnitin'), '', null, array(0, 1));
4949

5050
// Loop through all modules that support Plagiarism.
51-
$mods = core_component::get_plugin_list('mod');
52-
foreach ($mods as $mod => $modpath) {
51+
$mods = array_keys(core_component::get_plugin_list('mod'));
52+
foreach ($mods as $mod) {
5353
if (plugin_supports('mod', $mod, FEATURE_PLAGIARISM)) {
5454
$mform->addElement('advcheckbox',
5555
'turnitin_use_mod_'.$mod,
@@ -97,7 +97,7 @@ public function definition() {
9797
);
9898

9999
// Debugging and logging settings.
100-
$mform->addElement('select', 'plagiarism_turnitin_enablediagnostic', get_string('turnitindiagnostic', 'plagiarism_turnitin'), $ynoptions);
100+
$mform->addElement('select', 'plagiarism_turnitin_enablediagnostic', get_string('turnitindiagnostic', 'plagiarism_turnitin'), $diagnosticoptions);
101101
$mform->addElement('static', 'plagiarism_turnitin_enablediagnostic_desc', null, get_string('turnitindiagnostic_desc', 'plagiarism_turnitin'));
102102

103103
$mform->addElement('header', 'plagiarism_accountsettings', get_string('tiiaccountsettings', 'plagiarism_turnitin'));
@@ -222,8 +222,8 @@ public function display() {
222222
*/
223223
public function save($data) {
224224
// Save whether the plugin is enabled for individual modules.
225-
$mods = core_component::get_plugin_list('mod');
226-
foreach ($mods as $mod => $modpath) {
225+
$mods = array_keys(core_component::get_plugin_list('mod'));
226+
foreach ($mods as $mod) {
227227
if (plugin_supports('mod', $mod, FEATURE_PLAGIARISM)) {
228228
$property = "turnitin_use_mod_" . $mod;
229229
${ "turnitin_use_mod_" . "$mod" } = (!empty($data->$property)) ? $data->$property : 0;
@@ -234,7 +234,7 @@ public function save($data) {
234234
}
235235
}
236236

237-
$properties = array("accountid", "secretkey", "apiurl", "enablediagnostic", "usegrademark", "enablepeermark", "useerater",
237+
$properties = array("accountid", "secretkey", "apiurl", "enablediagnostic", "usegrademark", "enablepeermark", "useerater", "useanon",
238238
"transmatch", "repositoryoption", "agreement", "enablepseudo", "pseudofirstname", "pseudolastname", "lastnamegen", "pseudosalt", "pseudoemaildomain");
239239

240240
foreach ($properties as $property) {

classes/modules/turnitin_assign.class.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public function set_content($linkarray, $cm) {
6868
*
6969
* @param $assignid
7070
*/
71-
public function is_resubmission_allowed($assignid, $reportgenspeed, $submissiontype, $attemptreopenmethod, $attemptreopened = null) {
71+
public function is_resubmission_allowed($assignid, $reportgenspeed, $submissiontype, $attemptreopenmethod,
72+
$attemptreopened = null) {
7273
global $DB, $CFG;
7374

7475
// Get the maximum number of file submissions allowed.

classes/turnitin_class.class.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616

1717
use Integrations\PhpSdk\TiiClass;
1818

19-
/**
20-
* @package plagiarism_turnitin
21-
* @copyright 2012 iParadigms LLC *
22-
*/
19+
// @package plagiarism_turnitin
20+
// @copyright 2012 iParadigms LLC
2321

2422
defined('MOODLE_INTERNAL') || die();
2523

classes/turnitin_submission.class.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function recreate_submission_event() {
130130
$forum = $DB->get_record("forum", array("id" => $this->cm->instance));
131131

132132
// Some forum types don't pass in certain values on main forum page.
133-
if ((empty($discussionid) || $querystrid != 0) && ($forum->type == 'blog' || $forum->type == 'single')) {
133+
if ((empty($discussionid)) && ($forum->type == 'blog' || $forum->type == 'single')) {
134134
$discussion = $DB->get_record_sql('SELECT FD.id
135135
FROM {forum_posts} FP JOIN {forum_discussions} FD
136136
ON FP.discussion = FD.id
@@ -187,7 +187,6 @@ public function recreate_submission_event() {
187187
* Get the file information from Moodle. We really specifically only need the itemid.
188188
*/
189189
public function get_file_info() {
190-
global $DB;
191190
$fs = get_file_storage();
192191

193192
if (!$file = $fs->get_file_by_hash($this->submissiondata->identifier)) {

classes/turnitin_user.class.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ public function get_pseudo_lastname() {
141141
$userinfoob->userid = $this->id;
142142
$userinfoob->fieldid = $config->plagiarism_turnitin_pseudolastname;
143143
$userinfoob->data = $uniqueid;
144-
if (isset($userinfoob->data)) {
144+
if ($userinfo != false) {
145145
$userinfoob->id = $userinfo->id;
146-
$DB->update_record('user_info_data', $userinfo);
146+
$DB->update_record('user_info_data', $userinfoob);
147147
} else {
148-
$DB->insert_record('user_info_data', $userinfo);
148+
$DB->insert_record('user_info_data', $userinfoob);
149149
}
150150
} else if ($config->plagiarism_turnitin_pseudolastname != 0) {
151151
$uniqueid = $userinfo->data;

css/colorbox.css

-105
This file was deleted.

lang/ar/plagiarism_turnitin.php

-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@
247247
$string['repositoryoptions_4'] = 'إرسال كل الورق إلى المستودع المؤسسي';
248248
$string['turnitinrepositoryoptions_help'] = '<strong>تمكين خيارات مستودعات المدرس القياسية: </strong><br />يستطيع المعلمون مطالبة Turnitin بإضافة مستندات إلى المستودع القياسي أو المستودع الخاص بالمؤسسة التعليمية أو عدم إضافتها إلى مستودع.<br /><br /><strong>تمكين خيارات المستودع الموسعة للمدرب: </strong><br />سوف يتيح هذا الخيار للمعلمين عرض إعداد الواجبات للمساح للطلاب بإعلام Turnitin بمكان تخزين مستنداتهم. ويستطيع الطلاب اختيار إضافة مستنداتهم إلى مستودع الطلاب القياسي أو إلى المستودع الخاص بالمعلم.<br /><br /><strong>قم بإرسال كل الأوراق إلى المستودع المعتاد: </strong><br />ستتم إضافة جميع المستندات إلى مستودع الطلاب القياسي بشكل افتراضي.<br /><br /><strong>لا تقم بإرسال أي أوراق إلى المستودع: </strong><br />سوف يقتصر استخدام المستندات على إجراء فحص أولي بواسطة Turnitin والعرض على المعلم لوضع الدرجات.<br /><br /><strong>إرسال كل الورق إلى المستودع المؤسسي: </strong><br />تتم مطالبة Turnitin بتخزين جميع الأوراق في مستودع أوراق المؤسسة. ولا يتم إجراء فحوصات التشابه على المستندات المرسلة إلا بواسطة معلمين آخرين من مؤسستك.';
249249
$string['turnitinuseanon'] = 'استخدام التعليم المجهول';
250-
$string['turnitinuseanon_desc'] = 'اختر ما اذا كنت ستسمح للتعليم المجهول عند تقييم الإرسالات.<br /><i>(هذا متوفر فقط للمستخدمين الذين يكون لديهم التعليم المجهول مكونًا في حساباتهم)</i>';
251250
$string['createassignmenterror'] = 'حدث خطأ عند محاولة إنشاء المهمة في Turnitin';
252251
$string['editassignmenterror'] = 'حدث خطأ عند محاولة تحرير المهمة في Turnitin';
253252
$string['ppassignmentediterror'] = 'تعذر تحرير هذه الوحدة {$a->title} (معرف TII: {$a->assignmentid})، يُرجى الرجوع إلى سجلات واجهة برمجة التطبيقات (API) للحصول على مزيد من المعلومات.';

0 commit comments

Comments
 (0)