Skip to content

Commit

Permalink
Merge pull request #236 from turnitin/develop
Browse files Browse the repository at this point in the history
Release 2017022201
  • Loading branch information
jmcgettrick authored Feb 23, 2017
2 parents 9e73d74 + 76faccd commit b99924d
Show file tree
Hide file tree
Showing 14 changed files with 187 additions and 134 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
### Date: 2017-February-22
### Release: v2017022201

- Verified against Moodle 3.2.
- UI modified for compatibility with Boost theme.
- Update grade call removed for ULCC's coursework module. (Thanks to @aferenz)
- Fixes:
- An undefined index was causing a Moodle unit test to error. (Thanks to @danmarsden)
- Cron submission processing fails gracefully and doesn't stop further cron processing if submissiontype or submitter are not set.
- Cron submission processing fails gracefully and doesn't stop further cron processing if the file or forum post no longer exist. (Thanks to @danmarsden)
- Display customised error message if errormsg is '0'. (Thanks to @roperto)
- Save error message correctly instead of error code. (Thanks to @roperto)
- Undeclared variable replaced in logging call.

---

### Date: 2017-January-31
### Release: v2017013101

- Fixes:
- DB Upgrade script now checks submitter column exists as this was breaking for some users.

---

### Date: 2017-January-25
### Release: v2017012501

Expand Down
1 change: 1 addition & 0 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
$moduleconfigvalue->cm = $cm->id;
$moduleconfigvalue->name = 'grades_last_synced';
$moduleconfigvalue->value = time();
$moduleconfigvalue->config_hash = $moduleconfigvalue->cm."_".$moduleconfigvalue->name;
$DB->insert_record('plagiarism_turnitin_config', $moduleconfigvalue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function process_turnitin_config($data) {
$data = (object)$data;
$data->name = ($data->name == 'turnitin_assign') ? 'turnitin_assignid' : $data->name;
$data->cm = $this->task->get_moduleid();
$data->config_hash = $data->cm."_".$data->name;

$DB->insert_record('plagiarism_turnitin_config', $data);
}
Expand Down
3 changes: 2 additions & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="cm"/>
<FIELD NAME="cm" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="cm" NEXT="value"/>
<FIELD NAME="value" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="name"/>
<FIELD NAME="value" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="config_hash"/>
<FIELD NAME="config_hash" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="value"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="cm"/>
Expand Down
16 changes: 16 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,22 @@ function xmldb_plagiarism_turnitin_upgrade($oldversion) {
$DB->delete_records('task_scheduled', array('component' => 'plagiarism_turnitin', 'classname' => '\plagiarism_turnitin\task\plagiarism_turnitin_task'));
}

if ($oldversion < 2017012601) {
// Add new column that has to be unique.
$table = new xmldb_table('plagiarism_turnitin_config');
$field = new xmldb_field('config_hash', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'value');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

// Retrospectively update the new column to be id for previous configs.
$DB->execute("UPDATE ".$CFG->prefix."plagiarism_turnitin_config SET config_hash = id WHERE config_hash IS NULL");

// Add hash as key after update.
$key = new xmldb_key('config_hash', XMLDB_KEY_UNIQUE, array('config_hash'));
$dbman->add_key($table, $key);
}

return $result;
}

Expand Down
12 changes: 1 addition & 11 deletions extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,7 @@
}

// Build page.
echo $turnitintooltwoview->output_header(null,
null,
$_SERVER["REQUEST_URI"],
'',
'',
array(),
"",
"",
true,
'',
'');
echo $turnitintooltwoview->output_header($_SERVER["REQUEST_URI"]);

echo html_writer::tag("div", $viewcontext, array("id" => "tii_view_context"));

Expand Down
6 changes: 3 additions & 3 deletions jquery/turnitin_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ jQuery(document).ready(function($) {
});

// Open an iframe light box containing the Rubric View.
if ($('.rubric_view_pp_launch').length > 0) {
$(document).on('click', '.rubric_view_pp_launch', function() {
$('.rubric_view_pp_launch').colorbox({
iframe:true, width:"832px", height:"772px", opacity: "0.7", className: "rubric_view",
open:true, iframe:true, width:"832px", height:"772px", opacity: "0.7", className: "rubric_view",
onLoad: function() {
lightBoxCloseButton();
getLoadingGif();
Expand All @@ -100,7 +100,7 @@ jQuery(document).ready(function($) {
}
});
return false;
}
});

// Create new event for submission to be re-sent to Turnitin.
$(document).on('click', '.pp_resubmit_link', function() {
Expand Down
1 change: 1 addition & 0 deletions lang/en/plagiarism_turnitin.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
$string['because'] = 'This was because an administrator deleted the pending assignment from the processing queue and aborted the submission to Turnitin.<br /><strong>The file still exists in Moodle, please contact your instructor.</strong><br />Please see below for any error codes:';

$string['errorcode10'] = 'This file has not been submitted to Turnitin because there is a problem creating the class in Turnitin which is preventing submissions, please consult your API logs for further information';
$string['errorcode11'] = 'This file has not been submitted to Turnitin because it is missing data';
$string['queued'] = 'Queued';
$string['updatereportscores'] = 'Update Report Scores for Turnitin Plagiarism Plugin';
$string['sendqueuedsubmissions'] = 'Send Queued Files from the Turnitin Plagiarism Plugin';
Loading

0 comments on commit b99924d

Please sign in to comment.