Skip to content

Commit bf0299b

Browse files
authored
Merge pull request #580 from turnitin/develop
Release 2020072201
2 parents 7a38ce0 + 7f9f4a8 commit bf0299b

18 files changed

+159
-91
lines changed

.travis.yml

+18-28
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,39 @@ cache:
77
- $HOME/.composer/cache
88

99
php:
10-
- 5.5
11-
# - 5.6
1210
- 7.1
11+
- 7.2
12+
13+
services:
14+
- mysql
15+
- postgresql
1316

1417
env:
1518
global:
1619
- IGNORE_PATHS=sdk/,fonts/,pix/
1720
- IGNORE_NAMES=jquery*,moment.js,colorbox.css,tooltipster.css,*.min.css,*.min.js,tii-icon-webfont.css,styles.css,styles.css.map,gulpfile.js
1821
matrix:
19-
- DB=pgsql MOODLE_BRANCH=MOODLE_32_STABLE
20-
- DB=mysqli MOODLE_BRANCH=MOODLE_32_STABLE
21-
- DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
22-
- DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE
23-
24-
matrix:
25-
exclude:
26-
- env: DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
27-
php: 7.1
28-
- env: DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE
29-
php: 7.1
30-
- env: DB=pgsql MOODLE_BRANCH=MOODLE_32_STABLE
31-
php: 5.5
32-
- env: DB=mysqli MOODLE_BRANCH=MOODLE_32_STABLE
33-
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
3428

3529
before_install:
3630
- phpenv config-rm xdebug.ini
3731
- cd ../..
3832
- composer selfupdate
39-
- 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
4034
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
4135

4236
install:
4337
- moodle-plugin-ci install
4438

4539
script:
46-
- moodle-plugin-ci phplint
47-
# - moodle-plugin-ci phpcpd
48-
- moodle-plugin-ci phpmd
49-
# - moodle-plugin-ci codechecker
50-
- moodle-plugin-ci csslint
51-
- moodle-plugin-ci shifter
52-
# - moodle-plugin-ci jshint
53-
- moodle-plugin-ci validate
54-
- moodle-plugin-ci phpunit
55-
- moodle-plugin-ci behat
40+
- moodle-plugin-ci phplint
41+
- moodle-plugin-ci phpmd
42+
- moodle-plugin-ci csslint
43+
- moodle-plugin-ci shifter
44+
- moodle-plugin-ci validate
45+
- moodle-plugin-ci phpunit

CHANGELOG.md

+27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
### Date: 2020-Jul-22
2+
### Release: v2020072201
3+
4+
#### :zap: What's new
5+
6+
####Support for Moodle 3.9
7+
8+
Moodle Direct V2 now supports Moodle version 3.9.
9+
10+
---
11+
12+
#### :wrench: Fixes and enhancements
13+
14+
#### Paper deletion icon now appears
15+
16+
A visual bug had caused the ‘trash can’ icon to now appear when using Moodle version 3.8 or later. The icon now appears as intended.
17+
18+
#### Undefined Index warnings no longer show in Apache logs
19+
20+
PHP warnings and notices could occasionally appear in your Apache logs from Turnitin due to a reference to an undefined variable. This issue has been fixed and these warnings will no longer appear.
21+
22+
#### The submission form displays better in Moodle versions 3.7 and above
23+
24+
A visual bug had caused the submission form to be pressed into a much smaller area in Moodle versions 3.7 and above. While functionality remained the same, this bug has been fixed to give the submission form more room and make it easier to use.
25+
26+
---
27+
128
### Date: 2019-Jul-02
229
### Release: v2019070201
330

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you are having issues, please consult our [TROUBLE SHOOTING](https://github.c
1212
Installation
1313
------------
1414

15-
Before installing these plugins firstly make sure you are logged in as an Administrator and that you are using Moodle 2.6 or higher.
15+
Before installing these plugins firstly make sure you are logged in as an Administrator and that you are using Moodle 3.5 or higher.
1616

1717
To install, all you need to do is copy all the files into the mod/turnitintooltwo directory on your moodle installation. You should then go to `"Site Administration" > "Notifications"` and follow the on screen instructions.
1818

backup/moodle2/backup_turnitintooltwo_stepslib.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function define_structure() {
8888
$values['tiiaccount'] = $config->accountid;
8989
$turnitintooltwo->fill_values($values);
9090

91-
$part->set_source_table('turnitintooltwo_parts', array('turnitintooltwoid' => backup::VAR_ACTIVITYID));
91+
$part->set_source_table('turnitintooltwo_parts', array('turnitintooltwoid' => backup::VAR_ACTIVITYID), 'id');
9292

9393
$course->set_source_sql("
9494
SELECT t.id, t.courseid, t.ownerid, tu.turnitin_uid AS ownertiiuid,

classes/nonsubmitters/nonsubmitters_message.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ class nonsubmitters_message {
2727
public function send_message($userid, $subject, $message, $courseid) {
2828
global $CFG;
2929

30-
// Pre 2.9 does not have \core\message\message()
31-
if ($CFG->branch >= 29) {
32-
$eventdata = new \core\message\message();
33-
} else {
34-
$eventdata = new stdClass();
35-
}
36-
30+
$eventdata = new \core\message\message();
3731
$eventdata->component = 'mod_turnitintooltwo';
3832
$eventdata->name = 'nonsubmitters'; // This is the message name from messages.php.
3933
$eventdata->userfrom = \core_user::get_noreply_user();

classes/privacy/provider.php

+71-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@
2727
defined('MOODLE_INTERNAL') || die();
2828

2929
use core_privacy\local\metadata\collection;
30+
use core_privacy\local\request\approved_userlist;
3031
use core_privacy\local\request\contextlist;
3132
use core_privacy\local\request\approved_contextlist;
3233
use core_privacy\local\request\helper;
34+
use core_privacy\local\request\userlist;
3335
use core_privacy\local\request\writer;
3436

3537
class provider implements
3638
// This plugin does store personal user data.
3739
\core_privacy\local\metadata\provider,
3840

41+
\core_privacy\local\request\core_userlist_provider,
42+
3943
// This plugin is a core_user_data_provider.
4044
\core_privacy\local\request\plugin\provider {
4145

@@ -113,7 +117,8 @@ public static function _get_contexts_for_userid($userid) {
113117
INNER JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel
114118
INNER JOIN {modules} m ON m.id = cm.module AND m.name = :modname
115119
INNER JOIN {turnitintooltwo} t ON t.id = cm.instance
116-
LEFT JOIN {turnitintooltwo_submissions} ts ON ts.turnitintooltwoid = t.id
120+
INNER JOIN {turnitintooltwo_submissions} ts ON ts.turnitintooltwoid = t.id
121+
WHERE ts.userid = :userid
117122
";
118123

119124
$params = [
@@ -243,4 +248,68 @@ public static function _delete_data_for_user(approved_contextlist $contextlist)
243248
);
244249
}
245250
}
246-
}
251+
252+
/**
253+
* Get the list of users who have data within a context.
254+
*
255+
* @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
256+
*/
257+
public static function get_users_in_context(userlist $userlist) {
258+
$context = $userlist->get_context();
259+
260+
if ($context->contextlevel != CONTEXT_MODULE) {
261+
return;
262+
}
263+
264+
$sql = "SELECT ts.userid
265+
FROM {turnitintooltwo_submissions} ts
266+
JOIN {course_modules} cm ON cm.instance = ts.turnitintooltwoid
267+
JOIN {modules} m ON m.id = cm.module AND m.name = :modname
268+
WHERE cm.id = :cmid";
269+
270+
$params = [
271+
'modname' => 'turnitintooltwo',
272+
'cmid' => $context->instanceid
273+
];
274+
275+
$userlist->add_from_sql('userid', $sql, $params);
276+
}
277+
278+
/**
279+
* Delete multiple users within a single context.
280+
*
281+
* @param approved_userlist $userlist The approved context and user information to delete information for.
282+
*/
283+
public static function delete_data_for_users(approved_userlist $userlist) {
284+
global $DB;
285+
286+
$context = $userlist->get_context();
287+
288+
if ($context->contextlevel != CONTEXT_MODULE) {
289+
return;
290+
}
291+
292+
$userids = $userlist->get_userids();
293+
294+
list($insql, $inparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
295+
296+
$sql1 = "SELECT ts.id
297+
FROM {turnitintooltwo_submissions} ts
298+
JOIN {course_modules} cm ON cm.instance = ts.turnitintooltwoid
299+
JOIN {modules} m ON m.id = cm.module AND m.name = :modname
300+
WHERE ts.userid $insql
301+
AND cm.id = :cmid";
302+
303+
$params = [
304+
'modname' => 'turnitintooltwo',
305+
'cmid' => $context->instanceid
306+
];
307+
308+
$params = array_merge($params, $inparams);
309+
310+
$attempt = $DB->get_fieldset_sql($sql1, $params);
311+
312+
313+
$DB->delete_records_list('turnitintooltwo_submissions', 'id', array_values($attempt));
314+
}
315+
}

jquery/turnitintooltwo-2018102601.js

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
}
3131
});
3232

33+
$("div.mod_turnitintooltwo").parent().css("width", "100%");
34+
3335
$(document).on('click', '.delete_paper', function () {
3436
// Set up the confirm window.
3537
var confirmstrname = $(this).data("confirm");

jquery/turnitintooltwo-2018102601.min.js

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

0 commit comments

Comments
 (0)