Skip to content

Commit

Permalink
Merge pull request #645 from turnitin/develop
Browse files Browse the repository at this point in the history
Release v2022020301
  • Loading branch information
dwinn authored Feb 3, 2022
2 parents 6bc4f85 + d4400e8 commit e0159b3
Show file tree
Hide file tree
Showing 53 changed files with 159 additions and 180 deletions.
28 changes: 21 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
### Date: 2021-Jun-08
### Release: v2021060801
### Date: 2022-Feb-03
### Release: v2022020301

---

#### Setting an assignment to grade type ‘none’ will no longer create a Moodle gradebook column
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.

#### Grades will update when a grade item can’t be found
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.

#### Submit on behalf of a student, even when ‘allow late submissions’ is not enabled
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.

---

####Support for Moodle 3.11
### Date: 2021-Jun-08
### Release: v2021060801

#### Support for Moodle 3.11
You can now confidently use this integration with Moodle 3.11.

####Submit button is no longer visible after the due date
#### Submit button is no longer visible after the due date
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.

####Delete parts without errors
#### Delete parts without errors
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.

---

### Date: 2020-Nov-18
### Release: v2020111801

---

#### :wrench: Fixes and enhancements

#### Rubrics sync back to the assignment
Expand Down
8 changes: 0 additions & 8 deletions CONTRIBUTIONS.md

This file was deleted.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Please be aware that the **Develop** branch should not be considered production

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).

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.

If you are having issues, please consult our [TROUBLE SHOOTING](https://github.com/turnitin/moodle-mod_turnitintooltwo/blob/master/TROUBLESHOOTING.md) page.

Installation
Expand All @@ -24,3 +22,10 @@ Testing
-------

Please see the [testing instructions](./TESTING.md) for detail instructions on running the unit tests.

Contributions
------------------------------

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.

------------------------------
15 changes: 7 additions & 8 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@
'submission_part' => $partid));
$return["end"] = $start + TURNITINTOOLTWO_SUBMISSION_GET_LIMIT;
$return["total"] = $_SESSION["num_submissions"][$partid];
$return["nonsubmitters"] = $return["total"] - $totalsubmitters;

// Remove any leftover submissions from session and update grade timestamp.
if ($return["end"] >= $return["total"]) {
Expand Down Expand Up @@ -479,13 +478,13 @@
$turnitinclass = new turnitin_class($courseid);
}
$turnitinclass->read_class_from_tii();
$sharedrubrics = $turnitinclass->sharedrubrics;
$sharedrubrics = $turnitinclass->sharedrubrics;

foreach ($sharedrubrics as $group => $grouprubrics) {
foreach ($grouprubrics as $rubricid => $rubricname) {
$options[$group][$rubricid] = $rubricname;
}
}
foreach ($sharedrubrics as $group => $grouprubrics) {
foreach ($grouprubrics as $rubricid => $rubricname) {
$options[$group][$rubricid] = $rubricname;
}
}

// Get assignment details.
if (!empty($assignmentid)) {
Expand Down Expand Up @@ -927,7 +926,7 @@

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

// Check if v1 id is linked to a v2 id in the session
// Check if v1 id is linked to a v2 id in the session.
$turnitintooltwoid = 0;
if ( isset( $_SESSION["migrationtool"][$turnitintoolid] ) && is_numeric( $_SESSION["migrationtool"][$turnitintoolid] ) ) {
$turnitintooltwoid = intval( $_SESSION["migrationtool"][$turnitintoolid] );
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_turnitintooltwo_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected function process_turnitintooltwo_submissions($data) {
}

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

Expand Down
2 changes: 1 addition & 1 deletion classes/digitalreceipt/instructor_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function build_instructor_message($input) {
$message->submission_date = $input['submission_date'];
$message->submission_id = $input['submission_id'];

return get_string('receipt_instructor_copy', 'turnitintooltwo', $message);
return format_string(get_string('receipt_instructor_copy', 'turnitintooltwo', $message));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/digitalreceipt/receipt_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ public function build_message($input) {
$message->submission_date = $input['submission_date'];
$message->submission_id = $input['submission_id'];

return get_string('digital_receipt_message', 'turnitintooltwo', $message);
return format_string(get_string('digital_receipt_message', 'turnitintooltwo', $message));
}
}
2 changes: 1 addition & 1 deletion classes/event/add_submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ protected function validate_data() {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
}
}
2 changes: 1 addition & 1 deletion classes/event/delete_submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ protected function validate_data() {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
}
}
2 changes: 1 addition & 1 deletion classes/event/list_submissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ protected function validate_data() {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
}
}
2 changes: 1 addition & 1 deletion classes/event/view_submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ protected function validate_data() {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
}
}
1 change: 0 additions & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ public static function delete_data_for_users(approved_userlist $userlist) {

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


$DB->delete_records_list('turnitintooltwo_submissions', 'id', array_values($attempt));
}
}
7 changes: 6 additions & 1 deletion classes/v1migration/v1migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public static function migrate_gradebook($turnitintooltwoid, $turnitintoolid, $c
// Handle overridden grades if necessary.
$grading_info = grade_get_grades($courseid, 'mod', 'turnitintool', $turnitintoolid, $submission->userid);

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

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

// Exit if this grading info cannot be found.
if (!$grading_info) {
return;
}

$grades = new stdClass();
$grades->userid = $userid;
$grades->finalgrade = $v1grade;
Expand Down
21 changes: 19 additions & 2 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ function xmldb_turnitintooltwo_upgrade($oldversion) {
// Drop unused fields
$table = new xmldb_table('turnitintooltwo_submissions');
$field = new xmldb_field('submission_status');
if (!$dbman->field_exists($table, $field)) {
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

$field = new xmldb_field('submission_queued');
if (!$dbman->field_exists($table, $field)) {
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

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

// Need to drop these again in case they weren't in previous upgrade.
if ($oldversion < 2021073001) {
// Drop unused fields
$table = new xmldb_table('turnitintooltwo_submissions');
$field = new xmldb_field('submission_status');
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

$field = new xmldb_field('submission_queued');
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

upgrade_mod_savepoint(true, 2021073001, 'turnitintooltwo');
}

return true;
}
4 changes: 2 additions & 2 deletions extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
'name' => 'search_course_title'));

$coursesearchform .= html_writer::label(get_string('integration', 'turnitintooltwo').': ', 'search_course_integration');
$coursesearchform .= html_writer::select(turnitintooltwo_get_integration_ids(), 'search_course_integration', '', array('' => 'choosedots'),
array('id' => 'search_course_integration'));
$coursesearchform .= html_writer::select(turnitintooltwo_get_integration_ids(), 'search_course_integration',
'', array('' => 'choosedots'), array('id' => 'search_course_integration'));

$coursesearchform .= html_writer::label(get_string('ced', 'turnitintooltwo').': ', 'search_course_end_date');
$coursesearchform .= html_writer::empty_tag('input', array('type' => 'text', 'id' => 'search_course_end_date',
Expand Down
2 changes: 1 addition & 1 deletion jquery/turnitintooltwo-2020111101.js
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@
enableEditingText(part_id);

// Enable Email non submitters link if there is any non submitters.
if (result.nonsubmitters > 0) {
if (result.total > $('.mod_turnitintooltwo_submissions_data_table .refresh_row').length) {
$('.mod_turnitintooltwo_nonsubmitters_link').attr('style', 'display: block');
}
}
Expand Down
2 changes: 1 addition & 1 deletion jquery/turnitintooltwo-2020111101.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jquery/turnitintooltwo_extra-2020111101.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ jQuery(document).ready(function($) {
// Show light box to change the end date of a course.
function initialiseEditEndDate() {
$("a.edit_course_end_link").colorbox({
inline:true, width:"60%", top: "100px", background: "#fff", height:"260px", opacity: "0.7", className: "edit_end_date_form",
inline:true, width:"60%", top: "100px", background: "#fff", height:"315px", opacity: "0.7", className: "edit_end_date_form",
onLoad: function() {
lightBoxCloseButton();
},
Expand Down
Loading

0 comments on commit e0159b3

Please sign in to comment.