Skip to content

Commit e0159b3

Browse files
authored
Merge pull request #645 from turnitin/develop
Release v2022020301
2 parents 6bc4f85 + d4400e8 commit e0159b3

Some content is hidden

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

53 files changed

+159
-180
lines changed

CHANGELOG.md

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1-
### Date: 2021-Jun-08
2-
### Release: v2021060801
1+
### Date: 2022-Feb-03
2+
### Release: v2022020301
3+
4+
---
5+
6+
#### Setting an assignment to grade type ‘none’ will no longer create a Moodle gradebook column
7+
Creating an assignment with the grade type set to ‘none’ would create a column in the Moodle gradebook after the first submission to the assignment. We’ve fixed this bug, and the column will no longer be created.
8+
9+
#### Grades will update when a grade item can’t be found
10+
When the automatic scheduler (cron) runs to update grades, it could fail when it tried to update a grade item that couldn’t be found. We’ve improved how grades update, and this scenario will no longer prevent the rest of the grades from updating.
11+
12+
#### Submit on behalf of a student, even when ‘allow late submissions’ is not enabled
13+
The ‘allow late submissions’ setting should only prevent students from submitting to class. You, as the instructor, should always have control over the assignments you create. This change allows you to submit on behalf of a student without needing to open up late submissions for the entire class.
314

415
---
516

6-
####Support for Moodle 3.11
17+
### Date: 2021-Jun-08
18+
### Release: v2021060801
19+
20+
#### Support for Moodle 3.11
721
You can now confidently use this integration with Moodle 3.11.
822

9-
####Submit button is no longer visible after the due date
23+
#### Submit button is no longer visible after the due date
1024
The submit button will no longer be shown to students who have already submitted to the assignment when the due date has passed. The current functionality will remain for users who have not already submitted.
1125

12-
####Delete parts without errors
26+
#### Delete parts without errors
1327
The option to delete a part will now only show after there is more than one part used. When there is only one part, we’ll no longer show the deletion option to prevent the assignment from potentially breaking.
1428

29+
---
30+
1531
### Date: 2020-Nov-18
1632
### Release: v2020111801
1733

18-
---
19-
2034
#### :wrench: Fixes and enhancements
2135

2236
#### Rubrics sync back to the assignment

CONTRIBUTIONS.md

-8
This file was deleted.

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Please be aware that the **Develop** branch should not be considered production
55

66
To see what has changed in recent versions of Moodle Direct V2, see the [CHANGELOG](https://github.com/turnitin/moodle-mod_turnitintooltwo/blob/master/CHANGELOG.md).
77

8-
If you would like to contribute to the plugin please see our [CONTRIBUTIONS](https://github.com/turnitin/moodle-mod_turnitintooltwo/blob/master/CONTRIBUTIONS.md) page.
9-
108
If you are having issues, please consult our [TROUBLE SHOOTING](https://github.com/turnitin/moodle-mod_turnitintooltwo/blob/master/TROUBLESHOOTING.md) page.
119

1210
Installation
@@ -24,3 +22,10 @@ Testing
2422
-------
2523

2624
Please see the [testing instructions](./TESTING.md) for detail instructions on running the unit tests.
25+
26+
Contributions
27+
------------------------------
28+
29+
We welcome contributions to all elements of the plugin. Since launch we've had a number of users provide us with fixes and enhancements through either pull request or commits linked to from the issues page. If you are interested in contributing enhancements, or would like to solve an issue raised by another user, please feel free to make a pull request against the develop branch.
30+
31+
------------------------------

ajax.php

+7-8
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@
302302
'submission_part' => $partid));
303303
$return["end"] = $start + TURNITINTOOLTWO_SUBMISSION_GET_LIMIT;
304304
$return["total"] = $_SESSION["num_submissions"][$partid];
305-
$return["nonsubmitters"] = $return["total"] - $totalsubmitters;
306305

307306
// Remove any leftover submissions from session and update grade timestamp.
308307
if ($return["end"] >= $return["total"]) {
@@ -479,13 +478,13 @@
479478
$turnitinclass = new turnitin_class($courseid);
480479
}
481480
$turnitinclass->read_class_from_tii();
482-
$sharedrubrics = $turnitinclass->sharedrubrics;
481+
$sharedrubrics = $turnitinclass->sharedrubrics;
483482

484-
foreach ($sharedrubrics as $group => $grouprubrics) {
485-
foreach ($grouprubrics as $rubricid => $rubricname) {
486-
$options[$group][$rubricid] = $rubricname;
487-
}
488-
}
483+
foreach ($sharedrubrics as $group => $grouprubrics) {
484+
foreach ($grouprubrics as $rubricid => $rubricname) {
485+
$options[$group][$rubricid] = $rubricname;
486+
}
487+
}
489488

490489
// Get assignment details.
491490
if (!empty($assignmentid)) {
@@ -927,7 +926,7 @@
927926

928927
$turnitintoolid = required_param('turnitintoolid', PARAM_INT);
929928

930-
// Check if v1 id is linked to a v2 id in the session
929+
// Check if v1 id is linked to a v2 id in the session.
931930
$turnitintooltwoid = 0;
932931
if ( isset( $_SESSION["migrationtool"][$turnitintoolid] ) && is_numeric( $_SESSION["migrationtool"][$turnitintoolid] ) ) {
933932
$turnitintooltwoid = intval( $_SESSION["migrationtool"][$turnitintoolid] );

backup/moodle2/restore_turnitintooltwo_stepslib.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ protected function process_turnitintooltwo_submissions($data) {
155155
}
156156

157157
// Check if this hash already exists.
158-
if ($check_hash = $DB->get_record('turnitintooltwo_submissions', array('submission_hash' => $data->submission_hash))) {
158+
if ($DB->get_record('turnitintooltwo_submissions', array('submission_hash' => $data->submission_hash))) {
159159
$data->submission_hash = turnitintooltwo_genUuid();
160160
}
161161

classes/digitalreceipt/instructor_message.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function build_instructor_message($input) {
3838
$message->submission_date = $input['submission_date'];
3939
$message->submission_id = $input['submission_id'];
4040

41-
return get_string('receipt_instructor_copy', 'turnitintooltwo', $message);
41+
return format_string(get_string('receipt_instructor_copy', 'turnitintooltwo', $message));
4242
}
4343

4444
/**

classes/digitalreceipt/receipt_message.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ public function build_message($input) {
7070
$message->submission_date = $input['submission_date'];
7171
$message->submission_id = $input['submission_id'];
7272

73-
return get_string('digital_receipt_message', 'turnitintooltwo', $message);
73+
return format_string(get_string('digital_receipt_message', 'turnitintooltwo', $message));
7474
}
7575
}

classes/event/add_submission.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ protected function validate_data() {
6262
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
6363
}
6464
}
65-
}
65+
}

classes/event/delete_submission.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ protected function validate_data() {
5858
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
5959
}
6060
}
61-
}
61+
}

classes/event/list_submissions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ protected function validate_data() {
5858
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
5959
}
6060
}
61-
}
61+
}

classes/event/view_submission.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ protected function validate_data() {
5454
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
5555
}
5656
}
57-
}
57+
}

classes/privacy/provider.php

-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ public static function delete_data_for_users(approved_userlist $userlist) {
309309

310310
$attempt = $DB->get_fieldset_sql($sql1, $params);
311311

312-
313312
$DB->delete_records_list('turnitintooltwo_submissions', 'id', array_values($attempt));
314313
}
315314
}

classes/v1migration/v1migration.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public static function migrate_gradebook($turnitintooltwoid, $turnitintoolid, $c
410410
// Handle overridden grades if necessary.
411411
$grading_info = grade_get_grades($courseid, 'mod', 'turnitintool', $turnitintoolid, $submission->userid);
412412

413-
if (!empty($grading_info->items[0]->grades[$submission->userid]->overridden)) {
413+
if ($grading_info != null && !empty($grading_info->items[0]->grades[$submission->userid]->overridden)) {
414414
self::handle_overridden_grade($v1_grades[$submission->userid], $submission->userid, $turnitintooltwoid, $courseid);
415415
}
416416

@@ -437,6 +437,11 @@ public static function migrate_gradebook($turnitintooltwoid, $turnitintoolid, $c
437437
public static function handle_overridden_grade($v1grade, $userid, $turnitintooltwoid, $courseid) {
438438
$grading_info = grade_get_grades($courseid, 'mod', 'turnitintooltwo', $turnitintooltwoid, $userid);
439439

440+
// Exit if this grading info cannot be found.
441+
if (!$grading_info) {
442+
return;
443+
}
444+
440445
$grades = new stdClass();
441446
$grades->userid = $userid;
442447
$grades->finalgrade = $v1grade;

db/upgrade.php

+19-2
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,12 @@ function xmldb_turnitintooltwo_upgrade($oldversion) {
308308
// Drop unused fields
309309
$table = new xmldb_table('turnitintooltwo_submissions');
310310
$field = new xmldb_field('submission_status');
311-
if (!$dbman->field_exists($table, $field)) {
311+
if ($dbman->field_exists($table, $field)) {
312312
$dbman->drop_field($table, $field);
313313
}
314314

315315
$field = new xmldb_field('submission_queued');
316-
if (!$dbman->field_exists($table, $field)) {
316+
if ($dbman->field_exists($table, $field)) {
317317
$dbman->drop_field($table, $field);
318318
}
319319

@@ -331,5 +331,22 @@ function xmldb_turnitintooltwo_upgrade($oldversion) {
331331
upgrade_mod_savepoint(true, 2021060801, 'turnitintooltwo');
332332
}
333333

334+
// Need to drop these again in case they weren't in previous upgrade.
335+
if ($oldversion < 2021073001) {
336+
// Drop unused fields
337+
$table = new xmldb_table('turnitintooltwo_submissions');
338+
$field = new xmldb_field('submission_status');
339+
if ($dbman->field_exists($table, $field)) {
340+
$dbman->drop_field($table, $field);
341+
}
342+
343+
$field = new xmldb_field('submission_queued');
344+
if ($dbman->field_exists($table, $field)) {
345+
$dbman->drop_field($table, $field);
346+
}
347+
348+
upgrade_mod_savepoint(true, 2021073001, 'turnitintooltwo');
349+
}
350+
334351
return true;
335352
}

extras.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
'name' => 'search_course_title'));
8686

8787
$coursesearchform .= html_writer::label(get_string('integration', 'turnitintooltwo').': ', 'search_course_integration');
88-
$coursesearchform .= html_writer::select(turnitintooltwo_get_integration_ids(), 'search_course_integration', '', array('' => 'choosedots'),
89-
array('id' => 'search_course_integration'));
88+
$coursesearchform .= html_writer::select(turnitintooltwo_get_integration_ids(), 'search_course_integration',
89+
'', array('' => 'choosedots'), array('id' => 'search_course_integration'));
9090

9191
$coursesearchform .= html_writer::label(get_string('ced', 'turnitintooltwo').': ', 'search_course_end_date');
9292
$coursesearchform .= html_writer::empty_tag('input', array('type' => 'text', 'id' => 'search_course_end_date',

jquery/turnitintooltwo-2020111101.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@
937937
enableEditingText(part_id);
938938

939939
// Enable Email non submitters link if there is any non submitters.
940-
if (result.nonsubmitters > 0) {
940+
if (result.total > $('.mod_turnitintooltwo_submissions_data_table .refresh_row').length) {
941941
$('.mod_turnitintooltwo_nonsubmitters_link').attr('style', 'display: block');
942942
}
943943
}

jquery/turnitintooltwo-2020111101.min.js

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

jquery/turnitintooltwo_extra-2020111101.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ jQuery(document).ready(function($) {
354354
// Show light box to change the end date of a course.
355355
function initialiseEditEndDate() {
356356
$("a.edit_course_end_link").colorbox({
357-
inline:true, width:"60%", top: "100px", background: "#fff", height:"260px", opacity: "0.7", className: "edit_end_date_form",
357+
inline:true, width:"60%", top: "100px", background: "#fff", height:"315px", opacity: "0.7", className: "edit_end_date_form",
358358
onLoad: function() {
359359
lightBoxCloseButton();
360360
},

0 commit comments

Comments
 (0)