Skip to content

Commit 5b7a2b0

Browse files
authored
Merge pull request #758 from turnitin/develop
Release 2024080101
2 parents 65a9de1 + d7b03e6 commit 5b7a2b0

29 files changed

+165
-84
lines changed

CHANGELOG.md

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,47 @@
1+
### Date: 2024-August-01
2+
### Release: v2024080101
3+
4+
---
5+
6+
#### Icon Image Fixed
7+
Previously when a file was submitted that did not meet the requirements for processing by Turnitin, an icon image would be displayed incorrectly. This has now been fixed.
8+
9+
#### Issue With Multiple Peermark Assignments
10+
Previously when a Moodle Direct V2 assignment contained 2 or more Peermark assignments, there was an issue that stopped them from successfully opening. This has now been fixed.
11+
12+
#### Fixed Inbox Ordering On First Name
13+
Previously when sorting submissions in the assignment inbox by first name, the order of the sorted items would be incorrect. This has now been resolved.
14+
15+
#### Error Logged While Creating Course
16+
Previously there was a bug which would sometimes cause an error to be logged while creating a course. This has now been resolved.
17+
18+
#### PHP 8.1+ Deprecation Warnings
19+
We have resolved several deprecation warnings that would be displayed when running under PHP 8.1+.
20+
21+
#### Issue With Bulk Editing of Completion Settings
22+
Previously there was an error when editing completion settings in bulk that would prevent the page from loading. This has now been resolved.
23+
24+
#### Error Generating Pseudo Last Names
25+
Previously when generating dummy lastnames for students for data privacy purposes, the process would fail if no last name was set. This has now been resolved.
26+
27+
#### Error when Max Grade Set To Zero
28+
Previously when a single part of a multi-part assignment had its max grade set to zero, the percentage grade would fail to be calculated and an error message would be shown instead. This has now been resolved and grades are shown correctly.
29+
30+
#### Error when restoring a course
31+
Previously when deleting and later restoring a course, the course restoration would fail if the course end date had already passed. This was because the start date was being set to be after the end date. In cases where this would occur, we now set the end date to today, which allows the course to be restored correctly.
32+
33+
#### Bug in student enrolment
34+
There was previously a bug in student enrolment that meant that sometimes suspended users were being enrolled on courses when they should have been skipped. This has now been resolved.
35+
36+
#### Checks For Submission File Types
37+
Previously we were missing a check for the file types of submissions. This meant that students could always submit files of any type, which would cause their submissions to become stuck in a pending state. This has now been resolved, and if the option is enabled, students can upload only files of supported types.
38+
39+
---
40+
141
### Date: 2024-March-29
242
### Release: v2024032901
343

444
#### Export Buttons Fixed
5-
645
The export buttons along with the individual submission refresh and download buttons and the bulk submission download buttons are now functioning as expected.
746

847
### Date: 2024-February-06

backup/moodle2/restore_turnitintooltwo_stepslib.php

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ protected function process_turnitintooltwo_submissions($data) {
149149

150150
// Create TII User Account Details.
151151
if (!$tiiuser = $DB->get_record('turnitintooltwo_users', array('turnitin_uid' => $data->tiiuserid))) {
152+
$tiiuser = new stdClass();
152153
$tiiuser->userid = $data->userid;
153154
$tiiuser->turnitin_uid = $data->tiiuserid;
154155
$DB->insert_record('turnitintooltwo_users', $tiiuser);

extras.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,7 @@
9797

9898
$output .= $OUTPUT->box($coursesearchform, 'generalbox', 'course_search_options');
9999

100-
$displaylist = array();
101-
$parentlist = array();
102-
require_once($CFG->dirroot."/course/lib.php");
103-
if (file_exists($CFG->libdir.'/coursecatlib.php')) {
104-
require_once($CFG->libdir.'/coursecatlib.php');
105-
$displaylist = coursecat::make_categories_list('');
106-
} else {
107-
make_categories_list($displaylist, $parentlist, '');
108-
}
100+
$displaylist = core_course_category::make_categories_list('');
109101

110102
$categoryselectlabel = html_writer::label(get_string('selectcoursecategory', 'turnitintooltwo'), 'create_course_category');
111103
$categoryselect = html_writer::select($displaylist, 'create_course_category', '', array(),

jquery/turnitintooltwo-2024032901.js

+5
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@
293293
if (i == 3) {
294294
submissionsDataTableColumns.push({ "sType": "string", "bSortable": false });
295295
visibleCols.push(true);
296+
// last name as index 2, make it hidden
296297
} else if (i == 2) {
297298
submissionsDataTableColumns.push({ "sType": "string", "bSortable": false, "bVisible": false });
298299
visibleCols.push(false);
@@ -308,6 +309,10 @@
308309
} else if ((i == 13 && showOrigReport) || (i == 12 && !showOrigReport)) {
309310
submissionsDataTableColumns.push({ "sClass": "right" });
310311
visibleCols.push(true);
312+
// first name index noOfColumns - 1 in ordinar and multipart assignments, make it hidden
313+
} else if (i == noOfColumns - 1) {
314+
submissionsDataTableColumns.push({ "sType": "string", "bSortable": false, "bVisible": false });
315+
visibleCols.push(false);
311316
} else if (i == 1 || ((i >= 9 && !showOrigReport && !useGradeMark)
312317
|| (i >= 11 && ((!showOrigReport && useGradeMark) || (showOrigReport && !useGradeMark)))
313318
|| (i >= 13 && showOrigReport && useGradeMark))) {

jquery/turnitintooltwo-2024032901.min.js

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

jquery/turnitintooltwo-2024032901.min.js.map

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

lib.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function turnitintooltwo_grade_item_update($turnitintooltwo, $grades = null) {
251251

252252
// Get the latest part, for the post date and set the default hidden value on grade item.
253253
$lastpart = $DB->get_record('turnitintooltwo_parts', array('turnitintooltwoid' => $turnitintooltwo->id), 'max(dtpost)');
254-
$lastpart = current($lastpart);
254+
$lastpart = current((array)$lastpart);
255255
$params['hidden'] = $lastpart;
256256

257257
// There should always be a $cm unless this is called on module creation.
@@ -823,7 +823,7 @@ function turnitintooltwo_cron_update_gradbook($assignment, $task) {
823823
}
824824

825825
/**
826-
* Abstracted version of print_error()
826+
* Abstracted version of throw new moodle_exception() - formerly print_error()
827827
*
828828
* @param string $input The error string if module = null otherwise the language string called by get_string()
829829
* @param string $module The module string
@@ -847,7 +847,7 @@ function turnitintooltwo_print_error($input, $module = 'turnitintooltwo',
847847
$message .= ' ('.basename($file).' | '.$line.')';
848848
}
849849

850-
print_error($input, 'turnitintooltwo', $link, $message);
850+
throw new moodle_exception($input, 'turnitintooltwo', $link, $message);
851851
exit();
852852
}
853853

@@ -1523,7 +1523,7 @@ function turnitintooltwo_init_browser_assignment_table($tiicourseid) {
15231523
);
15241524

15251525
if (!empty($turnitincourse)) {
1526-
$course = current($turnitincourse);
1526+
$course = current((array)$turnitincourse);
15271527
$coursedetails = turnitintooltwo_assignment::get_course_data($course->courseid, $course->course_type);
15281528
$courseid = $course->courseid;
15291529
$coursetitle = $coursedetails->fullname;

mod_form.php

+14-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,18 @@ class mod_turnitintooltwo_mod_form extends moodleform_mod {
3434
private $turnitintooltwo;
3535

3636
public function definition() {
37-
global $DB, $USER, $COURSE;
37+
global $DB, $USER, $COURSE, $PAGE;
38+
39+
// Don't do anything here if called from a completion page as output has already begun.
40+
// This is needed because of MDL-78528.
41+
$completionpagetypes = [
42+
'course-defaultcompletion' => 'Edit completion default settings (Moodle >= 4.3)',
43+
'course-editbulkcompletion' => 'Edit completion settings in bulk for a single course',
44+
'course-editdefaultcompletion' => 'Edit completion default settings (Moodle < 4.3)',
45+
];
46+
if (isset($completionpagetypes[$PAGE->pagetype])) {
47+
return;
48+
}
3849

3950
// Module string is useful for product support.
4051
$modulestring = '<!-- Turnitin Moodle Direct Version: '.turnitintooltwo_get_version().' - (';
@@ -119,10 +130,10 @@ public function definition() {
119130

120131
$modulestring .= ') -->';
121132

122-
$this->show_form($instructorrubrics, $sharedrubrics, $modulestring, $course->turnitin_cid);
133+
$this->show_form($instructorrubrics, $sharedrubrics, $course->turnitin_cid, $modulestring);
123134
}
124135

125-
public function show_form($instructorrubrics, $sharedrubrics, $modulestring = '', $tiicourseid) {
136+
public function show_form($instructorrubrics, $sharedrubrics, $tiicourseid, $modulestring = '') {
126137
global $CFG, $OUTPUT, $COURSE, $PAGE, $DB;
127138
$PAGE->requires->string_for_js('changerubricwarning', 'turnitintooltwo');
128139
$PAGE->requires->string_for_js('closebutton', 'turnitintooltwo');

sdk/api.class.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
require_once( 'usersoap.class.php' );
4-
require_once( 'classsoap.class.php' );
5-
require_once( 'assignmentsoap.class.php' );
6-
require_once( 'membershipsoap.class.php' );
7-
require_once( 'submissionsoap.class.php' );
8-
require_once( 'lti.class.php' );
3+
require_once( __DIR__.'/usersoap.class.php' );
4+
require_once( __DIR__.'/classsoap.class.php' );
5+
require_once( __DIR__.'/assignmentsoap.class.php' );
6+
require_once( __DIR__.'/membershipsoap.class.php' );
7+
require_once( __DIR__.'/submissionsoap.class.php' );
8+
require_once( __DIR__.'/lti.class.php' );
99

1010
/**
1111
* The Turnitin SDK Wrapper class. This class will give you access to all available API functionality.

sdk/assignmentsoap.class.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* and open the template in the editor.
55
*/
66

7-
require_once( 'soap.class.php' );
8-
require_once( 'tiiassignment.class.php' );
9-
require_once( 'tiipeermarkassignment.class.php' );
10-
require_once( 'response.class.php' );
11-
require_once( 'sdkexception.class.php' );
7+
require_once( __DIR__.'/soap.class.php' );
8+
require_once( __DIR__.'/tiiassignment.class.php' );
9+
require_once( __DIR__.'/tiipeermarkassignment.class.php' );
10+
require_once( __DIR__.'/response.class.php' );
11+
require_once( __DIR__.'/sdkexception.class.php' );
1212

1313
/**
1414
* @ignore

sdk/classsoap.class.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
* and open the template in the editor.
55
*/
66

7-
require_once( 'soap.class.php' );
8-
require_once( 'tiiclass.class.php' );
9-
require_once( 'response.class.php' );
10-
require_once( 'sdkexception.class.php' );
7+
require_once( __DIR__.'/soap.class.php' );
8+
require_once( __DIR__.'/tiiclass.class.php' );
9+
require_once( __DIR__.'/response.class.php' );
10+
require_once( __DIR__.'/sdkexception.class.php' );
1111

1212
/**
1313
* @ignore

sdk/log.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* and open the template in the editor.
55
*/
66

7-
require_once( 'logger.php' );
7+
require_once( __DIR__.'/logger.php' );
88

99
/**
1010
* @ignore

sdk/lti.class.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* and open the template in the editor.
77
*/
88

9-
require_once( 'sdkexception.class.php' );
10-
require_once( 'tiilti.class.php' );
11-
require_once( 'response.class.php' );
9+
require_once( __DIR__.'/sdkexception.class.php' );
10+
require_once( __DIR__.'/tiilti.class.php' );
11+
require_once( __DIR__.'/response.class.php' );
1212

1313
/**
1414
* @ignore
@@ -602,7 +602,7 @@ public function __getLastRequest() {
602602
*
603603
* @param string $lastrequest
604604
*/
605-
private function __setLastRequest( $lastrequest ) {
605+
private function setLastRequestPrivate( $lastrequest ) {
606606
$this->lastrequest = $lastrequest;
607607
}
608608

@@ -618,7 +618,7 @@ public function __getLastResponse() {
618618
*
619619
* @param string $lastresponse
620620
*/
621-
private function __setLastResponse( $lastresponse ) {
621+
private function setLastResponsePrivate( $lastresponse ) {
622622
$this->lastresponse = $lastresponse;
623623
}
624624

@@ -969,8 +969,8 @@ private function transportData( $params ) {
969969
$response = $result;
970970
}
971971

972-
$this->__setLastRequest( print_r( $params, true ) );
973-
$this->__setLastResponse( $result );
972+
$this->setLastRequestPrivate( print_r( $params, true ) );
973+
$this->setLastResponsePrivate( $result );
974974

975975
curl_close($ch);
976976
return $response;

sdk/membershipsoap.class.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
* and open the template in the editor.
55
*/
66

7-
require_once( 'soap.class.php' );
8-
require_once( 'tiimembership.class.php' );
9-
require_once( 'response.class.php' );
10-
require_once( 'sdkexception.class.php' );
7+
require_once( __DIR__.'/soap.class.php' );
8+
require_once( __DIR__.'/tiimembership.class.php' );
9+
require_once( __DIR__.'/response.class.php' );
10+
require_once( __DIR__.'/sdkexception.class.php' );
1111

1212
/**
1313
* @ignore

sdk/response.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once( 'sdkexception.class.php' );
3+
require_once( __DIR__.'/sdkexception.class.php' );
44

55
/**
66
* Response object containing data parsed from the API response

sdk/soap.class.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* and open the template in the editor.
55
*/
66

7-
require_once( 'oauthsimple.class.php' );
8-
require_once( 'log.class.php' );
7+
require_once( __DIR__.'/oauthsimple.class.php' );
8+
require_once( __DIR__.'/log.class.php' );
99

1010
/**
1111
* @ignore
@@ -283,8 +283,7 @@ public function __construct( $wsdl, $options, $logpath = null ) {
283283
parent::__construct( $wsdl, $options );
284284
}
285285

286-
#[\ReturnTypeWillChange]
287-
public function __doRequest($request, $location, $action, $version, $one_way = null) {
286+
public function __doRequest($request, $location, $action, $version, $one_way = null): ?string {
288287

289288
$http_headers = array(
290289
'Content-type: text/xml;charset="utf-8"',

sdk/submissionsoap.class.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
* and open the template in the editor.
55
*/
66

7-
require_once( 'soap.class.php' );
8-
require_once( 'tiisubmission.class.php' );
9-
require_once( 'response.class.php' );
10-
require_once( 'sdkexception.class.php' );
7+
require_once( __DIR__.'/soap.class.php' );
8+
require_once( __DIR__.'/tiisubmission.class.php' );
9+
require_once( __DIR__.'/response.class.php' );
10+
require_once( __DIR__.'/sdkexception.class.php' );
1111

1212
/**
1313
* @ignore

sdk/tiiassignment.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* and open the template in the editor.
77
*/
88

9-
require_once( 'tiipeermarkassignment.class.php' );
9+
require_once( __DIR__.'/tiipeermarkassignment.class.php' );
1010

1111
/**
1212
* Defines the TiiAssignment data object which contains getters and setters for a Turnitin Assignment API object.

sdk/tiiclass.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* and open the template in the editor.
77
*/
88

9-
require_once( 'tiirubric.class.php' );
9+
require_once( __DIR__.'/tiirubric.class.php' );
1010

1111
/**
1212
* Defines the TiiSubmission data object which contains getters and setters for a Turnitin Class API object.

sdk/tiilti.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* and open the template in the editor.
88
*/
99

10-
require_once( 'tiiform.class.php' );
10+
require_once( __DIR__.'/tiiform.class.php' );
1111

1212
/**
1313
* Defines the TiiLTI data object which contains getters and setters for a Turnitin LTI Launch object.

sdk/tiisubmission.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @subpackage TiiSubmission
55
*/
66

7-
require_once( 'tiiform.class.php' );
7+
require_once( __DIR__.'/tiiform.class.php' );
88

99
/**
1010
* Defines the TiiSubmission data object which contains getters and setters for a Turnitin Submission API object.

sdk/tiiuser.class.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* and open the template in the editor.
77
*/
88

9-
require_once( 'sdkexception.class.php' );
10-
require_once( 'tiirubric.class.php' );
9+
require_once( __DIR__.'/sdkexception.class.php' );
10+
require_once( __DIR__.'/tiirubric.class.php' );
1111

1212
/**
1313
* Defines the TiiUser data object which contains getters and setters for a Turnitin User object.

sdk/usersoap.class.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* To change this template, choose Tools | Templates
44
* and open the template in the editor.
55
*/
6-
require_once( 'soap.class.php' );
7-
require_once( 'tiiuser.class.php' );
8-
require_once( 'tiipseudouser.class.php' );
9-
require_once( 'response.class.php' );
10-
require_once( 'sdkexception.class.php' );
6+
require_once( __DIR__.'/soap.class.php' );
7+
require_once( __DIR__.'/tiiuser.class.php' );
8+
require_once( __DIR__.'/tiipseudouser.class.php' );
9+
require_once( __DIR__.'/response.class.php' );
10+
require_once( __DIR__.'/sdkexception.class.php' );
1111

1212
/**
1313
* @ignore

settings_extras.php

-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@
328328
$output .= $OUTPUT->box($coursesearchform, 'generalbox', 'course_search_options');
329329

330330
$displaylist = core_course_category::make_categories_list('');
331-
$parentlist = array();
332331

333332
$categoryselectlabel = html_writer::label(get_string('selectcoursecategory', 'turnitintooltwo'),
334333
'create_course_category');

0 commit comments

Comments
 (0)