Skip to content

Commit

Permalink
Merge pull request #97 from turnitin/qa04
Browse files Browse the repository at this point in the history
Qa04
  • Loading branch information
dwinn committed Feb 23, 2016
2 parents 334b101 + 8e9da15 commit 958387c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 16 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### Date: 2016-February-23
### Release: v2016011104

- Fixes:
- EULA acceptance problem due to lack of module context.
- Missing noscript EULA string added.
- Incorrect version number in upgrade db script for adding due_date_refresh field.
- Split collated empty function for pre PHP 5.5 environments.

---

### Date: 2016-February-22
### Release: v2016011103

Expand Down
22 changes: 11 additions & 11 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
if( !empty( $cmid ) ){
$cm = get_coursemodule_from_id('', $cmid);
$context = context_course::instance($cm->course);
}

// Work out user role.
$userrole = '';
switch ($cm->modname) {
case "forum":
case "workshop":
$userrole = (has_capability('plagiarism/turnitin:viewfullreport', $context)) ? 'Instructor' : 'Learner';
break;
default:
$userrole = (has_capability('mod/'.$cm->modname.':grade', $context)) ? 'Instructor' : 'Learner';
break;
// Work out user role.
$userrole = '';
switch ($cm->modname) {
case "forum":
case "workshop":
$userrole = (has_capability('plagiarism/turnitin:viewfullreport', $context)) ? 'Instructor' : 'Learner';
break;
default:
$userrole = (has_capability('mod/'.$cm->modname.':grade', $context)) ? 'Instructor' : 'Learner';
break;
}
}

$pathnamehash = optional_param('pathnamehash', "", PARAM_ALPHANUM);
Expand Down
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function xmldb_plagiarism_turnitin_upgrade($oldversion) {
}
}

if ($oldversion < 2016011102) {
if ($oldversion < 2016011104) {
$table = new xmldb_table('plagiarism_turnitin_files');
$field = new xmldb_field('duedate_report_refresh', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, true, false, 0,'gm_feedback');
if (!$dbman->field_exists($table, $field)) {
Expand Down
2 changes: 1 addition & 1 deletion jquery/turnitin_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jQuery(document).ready(function($) {
// Open the DV in a new window in such a way as to not be blocked by popups.
function openDV(dvtype, submissionid, coursemoduleid, url) {
dvWindow = window.open('', '_blank');
var loading = '<div style="text-align:center;">';
var loading = '<div class="tii_dv_loading" style="text-align:center;">';
loading += '<img src="'+M.cfg.wwwroot+'/plagiarism/turnitin/pix/tiiIcon.svg" style="width:100px; height: 100px">';
loading += '<p style="font-family: Arial, Helvetica, sans-serif;">'+M.str.plagiarism_turnitin.loadingdv+'</p>';
loading += '</div>';
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 @@ -72,6 +72,7 @@
$string['turnitinrefreshsubmissions'] = 'Refresh Submissions';
$string['turnitinrefreshingsubmissions'] = 'Refreshing Submissions';
$string['turnitinppulapre'] = 'To submit a file to Turnitin you must first accept our EULA. Choosing to not accept our EULA will submit your file to Moodle only. Click here to accept.';
$string['noscriptula'] = '(As you do not have javascript enabled you will have to manually refresh this page before you can make a submission after accepting the Turnitin User Agreement)';
$string['filedoesnotexist'] = 'File has been deleted';


Expand Down
3 changes: 2 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,8 @@ public function tii_submission($cm, $tiiassignmentid, $user, $submitter, $identi
$title = $file->get_filename();
$timemodified = $file->get_timemodified();
$filename = $file->get_filename();
if (empty($textcontent = $file->get_content())) {
$textcontent = $file->get_content();
if (empty($textcontent)) {
$errorcode = 9;
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* and open the template in the editor.
*/

$plugin->version = 2016011103;
$plugin->version = 2016011104;
$plugin->release = "2.6+";
$plugin->requires = 2013111800;
$plugin->cron = 300;
$plugin->component = 'plagiarism_turnitin';
$plugin->maturity = MATURITY_STABLE;

$plugin->dependencies = array(
'mod_turnitintooltwo' => 2016011102,
'mod_turnitintooltwo' => 2016011104,
'mod_assign' => 2013110500
);

0 comments on commit 958387c

Please sign in to comment.