Skip to content

Commit

Permalink
Merge pull request #166 from turnitin/develop
Browse files Browse the repository at this point in the history
Merge Release v2016062701
  • Loading branch information
David Hatton authored Jul 26, 2016
2 parents d8772cd + 6140c2e commit 31c69cf
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 70 deletions.
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
### Date: 2016-July-26
### Release: v2016072601

- Verified against Moodle 3.1.
- Removed word count check before submission.
- Added .xls and .xlsx to accepted filetypes.
- Increase submission processing limit in cron to 100.
- Fixes:
- Module can still be used if Turnitin account is not configured.
- Check $CFG exists before using in version.php (Thanks to @micaherne).
- Ensure file extension is lowercase when checking accepted files.
- Ensure refresh submissions link works for workshop and forums.
- Change recordset to records in data dump as recordset wasn't working for PostgreSQL.
- Assignment default settings are now applied when creating assignment (Thanks to @danmarsden).
- Added missing and changed incorrect error language strings.
- All uses of object() changed to stdClass().
- PeerMark Reviews launcher now enrols user correctly in Turnitin class.
- Catch exception if can not get file content when making a submission (Thanks to @kenneth-hendricks).
- Ignore inherited roles when looking for instructors on Turnitin class creation.
- Ensure activity edit page does not break if plugin is not fully configured. (Thanks to @mhughes2k).
- Fixed an issue where submission notifications would be sent to instructors even with instructor digital receipt notifications turned off.
- Fixed a bug that led to error and stack trace upon data dump generation.
- Grades are no longer sent to the gradebook before anonymity is lifted when blind marking is enabled.
- Fixed an issue where the EULA link would be broken post-submission if the student originally declined the EULA. (Thanks to @pauln)
- Added missing error language strings to the language string file.
- Fixed an issue where a submission could be stuck in pending if the user is not found.

---

### Date: 2016-April-11
### Release: v2016011105

Expand All @@ -13,7 +42,6 @@
- fixed issue in JS that prevented Rubric Manager and Quickmark loading. This fixes #101
- Increased foreign key support and fixed cron index error (#92). (Thanks to AviMoto)


---

### Date: 2016-February-23
Expand Down
12 changes: 7 additions & 5 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

$submissionid = optional_param('submission', 0, PARAM_INT);

if ($userrole == 'Instructor' && $cm->modname == "assign") {
if ($userrole == 'Instructor') {
$return["status"] = $pluginturnitin->update_grades_from_tii($cm);

$moduleconfigvalue = new stdClass();
Expand Down Expand Up @@ -165,12 +165,14 @@
has_capability('mod/'.$cm->modname.':submit', $context);

if ($userrole == 'Instructor' || $isstudent) {
$role = ($istutor) ? 'Instructor' : 'Learner';

$tiiassignment = $DB->get_record('plagiarism_turnitin_config', array('cm' => $cm->id, 'name' => 'turnitin_assignid'));

$user = new turnitintooltwo_user($USER->id, $userrole);
$coursedata = turnitintooltwo_assignment::get_course_data($cm->course, 'PP');
$user->join_user_to_class($coursedata->turnitin_cid);

echo html_writer::tag("div", turnitintooltwo_view::output_lti_form_launch('peermark_reviews',
$role, $tiiassignment->value),
$userrole, $tiiassignment->value),
array("class" => "launch_form", "style" => "display:none;"));
echo html_writer::script("<!--
window.document.forms[0].submit();
Expand All @@ -189,7 +191,7 @@
$turnitin_user = $DB->get_record('turnitintooltwo_users', array('userid' => $USER->id));

// Build user object for update
$eula_user = new object();
$eula_user = new stdClass();
$eula_user->id = $turnitin_user->id;
$eula_user->user_agreement_accepted = 0;
if ($message == 'turnitin_eula_accepted') {
Expand Down
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function xmldb_plagiarism_turnitin_upgrade($oldversion) {
if ($turnitinsetting->value == 1) {
$supported_mods = array('assign', 'forum', 'workshop');
foreach ($supported_mods as $mod) {
$configfield = new object();
$configfield = new stdClass();
$configfield->value = 1;
$configfield->plugin = 'plagiarism';
$configfield->name = 'turnitin_use_mod_'.$mod;
Expand Down
35 changes: 19 additions & 16 deletions jquery/turnitin_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,27 @@ jQuery(document).ready(function($) {

// Open an iframe light box containing the EULA View
if ($('.pp_turnitin_eula_link').length > 0) {
$('.pp_turnitin_eula_link').colorbox({
iframe:true, width:"766px", height:"596px", opacity: "0.7", className: "eula_view", scrolling: "false",
onLoad: function() { getLoadingGif(); },
onComplete: function() {
$(window).on("message", function(ev) {
var message = typeof ev.data === 'undefined' ? ev.originalEvent.data : ev.data;
$(document).on('click', '.pp_turnitin_eula_link', function(e) {
e.preventDefault();
$.colorbox({
iframe:true, href:this.href, width:"766px", height:"596px", opacity: "0.7", className: "eula_view", scrolling: "false",
onOpen: function() { getLoadingGif(); },
onComplete: function() {
$(window).on("message", function(ev) {
var message = typeof ev.data === 'undefined' ? ev.originalEvent.data : ev.data;

$.ajax({
type: "POST",
url: M.cfg.wwwroot +"/plagiarism/turnitin/ajax.php",
dataType: "json",
data: {action: "actionuseragreement", message: message, sesskey: M.cfg.sesskey},
success: function(data) { window.location.reload(); },
error: function(data) { window.location.reload(); }
$.ajax({
type: "POST",
url: M.cfg.wwwroot +"/plagiarism/turnitin/ajax.php",
dataType: "json",
data: {action: "actionuseragreement", message: message, sesskey: M.cfg.sesskey},
success: function(data) { window.location.reload(); },
error: function(data) { window.location.reload(); }
});
});
});
},
onCleanup: function() { hideLoadingGif(); }
},
onCleanup: function() { hideLoadingGif(); }
});
});
}

Expand Down
11 changes: 11 additions & 0 deletions lang/en/plagiarism_turnitin.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@
$string['errorcode7'] = 'This file has not been submitted to Turnitin because there is a problem creating the user in Turnitin which is preventing submissions, please consult your API logs for further information';
$string['errorcode8'] = 'This file has not been submitted to Turnitin because there is a problem creating the temp file. The most likely cause is an invalid file name. Please rename the file and re-upload using Edit Submission.';
$string['errorcode9'] = 'The file cannot be submitted as there is no accessible content in the file pool to submit.';
$string['coursegeterror'] = 'Could not get course data';
$string['configureerror'] = 'You must configure this module fully as Administrator before using it within a course. Please contact your Moodle administrator.';
$string['turnitintoolofflineerror'] = 'We are experiencing a temporary problem. Please try again shortly.';
$string['defaultinserterror'] = 'There was an error when trying to insert a default setting value into the database';
$string['defaultupdateerror'] = 'There was an error when trying to update a default setting value in the database';
$string['tiiassignmentgeterror'] = 'There was an error when trying to get an assignment from Turnitin';
$string['assigngeterror'] = 'Could not get turnitintooltwo data';
$string['classupdateerror'] = 'Could not update Turnitin Class data';
$string['pp_createsubmissionerror'] = 'There was an error trying to create the submission in Turnitin';
$string['pp_updatesubmissionerror'] = 'There was an error trying to resubmit your submission to Turnitin';
$string['tiisubmissiongeterror'] = 'There was an error when trying to get a submission from Turnitin';

// Javascript
$string['closebutton'] = 'Close';
Expand Down
Loading

0 comments on commit 31c69cf

Please sign in to comment.