Skip to content

Commit

Permalink
Merge pull request #175 from turnitin/develop
Browse files Browse the repository at this point in the history
Release 2016091401
  • Loading branch information
jmcgettrick authored Sep 14, 2016
2 parents 48145e3 + 265d05d commit 31ae422
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 47 deletions.
46 changes: 29 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### Date: 2016-September-14
### Release: v2016091401

- Support added for ULCC's coursework module (Thanks to @aferenz).
- Blank update_status function added for consistency.
- Fixes:
- Locked default settings are now observed.
- Default settings are now used when enabling Turnitin on an assignment which didn't previously have it enabled.
- Use each module's specific grade item update instead of calling grade_update directly.

---

### Date: 2016-July-26
### Release: v2016072601

Expand All @@ -12,7 +24,7 @@
- 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).
- Admins - please ensure that plugin settings match account settings.
- Admins - please ensure that plugin settings match account settings.
- 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.
Expand Down Expand Up @@ -409,8 +421,8 @@ Releases prior to version 2015040106 will refer to changes made to the Turnitin'

---

###Date: 2014-September-04
###Release: v2014012407
### Date: 2014-September-04
### Release: v2014012407

- Remove Grademark settings if GradeMark is disabled. (Thanks to Alex Rowe)
- Date handling reconfigured in PP to prevent erros (Thanks to Dan Marsden)
Expand All @@ -424,8 +436,8 @@ Releases prior to version 2015040106 will refer to changes made to the Turnitin'

---

###Date: 2014-August-19
###Release: v2014012406
### Date: 2014-August-19
### Release: v2014012406

- Error reporting added for files that are too large, small submissions and any other submission errors.
- Error reporting added to cron.
Expand All @@ -445,8 +457,8 @@ Releases prior to version 2015040106 will refer to changes made to the Turnitin'

---

###Date: 2014-June-11
###Release: v2014012405
### Date: 2014-June-11
### Release: v2014012405

- Course reset functionality added to remove Turnitin data when a class/module is reset.
- Ability added to enable/disable Turnitin in individual modules.
Expand Down Expand Up @@ -493,15 +505,15 @@ Releases prior to version 2015040106 will refer to changes made to the Turnitin'

---

###Date: 2014-June-11
###Release: v2014012404
### Date: 2014-June-11
### Release: v2014012404

- EULA acceptance is now stored locally for submissions.

---

###Date: 2014-April-17
###Release: v2014012403
### Date: 2014-April-17
### Release: v2014012403

- Grademark link removed for student if a grade has not been set in Plagiarism Plugin.
- Feedback release date changed on forum with plagiarism plugin to be the same as start date.
Expand All @@ -518,8 +530,8 @@ Releases prior to version 2015040106 will refer to changes made to the Turnitin'

---

###Date: 2014-February-26
###Release: v2014012402
### Date: 2014-February-26
### Release: v2014012402

- Vietnamese Language pack added.
- Option to send draft submissions to Turnitin in Plagiarism Plugin reinstated.
Expand All @@ -542,8 +554,8 @@ Releases prior to version 2015040106 will refer to changes made to the Turnitin'

---

###Date: 2014-January-24
###Release: v2014012401
### Date: 2014-January-24
### Release: v2014012401

- File type limit removed.
- Ability to accept no file added so that marks / grades can be allocated to non file submissions.
Expand All @@ -553,8 +565,8 @@ Releases prior to version 2015040106 will refer to changes made to the Turnitin'

---

###Date: 2013-December-18
###Release: v2013121801
### Date: 2013-December-18
### Release: v2013121801

- Supports Turnitin Originality Checking, GradeMark and PeerMark
- Allows access to the Rubric Manager and Quickmark Manager from within the Moodle environment
Expand Down
87 changes: 87 additions & 0 deletions classes/modules/turnitin_coursework.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package plagiarism_turnitin
* @copyright 2012 iParadigms LLC *
*/

// TODO: Split out all module specific code from plagiarism/turnitin/lib.php
class turnitin_coursework {

private $modname;
public $grades_table;
public $filecomponent;

public function __construct() {
$this->modname = 'coursework';
$this->grades_table = $this->modname.'_feedbacks';
$this->filecomponent = 'mod_'.$this->modname;
}

public function is_tutor($context) {
$capabilities = array($this->get_tutor_capability(),'mod/coursework:addagreedgrade', 'mod/coursework:addallocatedagreedgrade', 'mod/coursework:administergrades');
return has_any_capability($capabilities,$context);
}

public function get_tutor_capability() {
return 'mod/'.$this->modname.':addinitialgrade';
}

public function user_enrolled_on_course($context, $userid) {
return has_capability('mod/'.$this->modname.':submit', $context, $userid);
}

public function get_author($itemid) {
global $DB;

$id = 0;

if ($submission = $DB->get_record('coursework_submissions', array('id' => $itemid)))
$id = $submission->authorid;

return $id;
}



public function create_file_event($params) {
return \mod_coursework\event\assessable_uploaded::create($params);
}


public function get_current_gradequery($userid, $moduleid, $itemid = 0) {
global $DB;

$sql = "SELECT *
FROM {coursework_submissions} cs,
{coursework_feedbacks} cf
WHERE cs.id = cf.submissionid
AND cs.authorid = :authorid
AND cs.courseworkid = :courseworkid
AND cf.stage_identifier = :stage";

$params = array('stage'=>'final_agreed_1','authorid'=>$userid,'courseworkid'=>$moduleid);

$currentgradesquery = $DB->get_record_sql($sql, $params);

return $currentgradesquery;
}

public function initialise_post_date($moduledata) {
return 0;
}
}
Loading

0 comments on commit 31ae422

Please sign in to comment.