mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Plagiarism Lib MDL-13680 - reverting commit for now.
This commit is contained in:
parent
4e0effd60c
commit
30b5ee6b06
@ -125,10 +125,6 @@
|
||||
get_mailer('close');
|
||||
mtrace("Finished activity modules");
|
||||
|
||||
//now do plagiarism checks
|
||||
require_once($CFG->libdir.'/plagiarismlib.php');
|
||||
plagiarism_check_files();
|
||||
|
||||
mtrace("Starting blocks");
|
||||
if ($blocks = $DB->get_records_select("block", "cron > 0 AND ((? - lastcron) > cron) AND visible = 1", array($timenow))) {
|
||||
// we will need the base class.
|
||||
|
@ -1,131 +0,0 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* plagiarism.php - allows the admin to configure plagiarism stuff
|
||||
*
|
||||
* @package administration
|
||||
* @author Dan Marsden <dan@danmarsden.com>
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/plagiarismlib.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('plagiarism');
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
|
||||
|
||||
require_once('plagiarism_form.php');
|
||||
$mform = new plagiarism_setup_form();
|
||||
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect('');
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('plagiarism', 'plagiarism'));
|
||||
|
||||
if (($data = $mform->get_data()) && confirm_sesskey()) {
|
||||
if (!isset($data->turnitin_use)) {
|
||||
$data->turnitin_use = 0;
|
||||
}
|
||||
if (!isset($data->turnitin_enablegrademark)) {
|
||||
$data->turnitin_enablegrademark = 0;
|
||||
}
|
||||
if (!isset($data->turnitin_senduseremail)) {
|
||||
$data->turnitin_senduseremail = 0;
|
||||
}
|
||||
foreach ($data as $field=>$value) {
|
||||
if (strpos($field, 'turnitin')===0) {
|
||||
if ($tiiconfigfield = $DB->get_record('config_plugins', array('name'=>$field, 'plugin'=>'plagiarism'))) {
|
||||
$tiiconfigfield->value = $value;
|
||||
if (! $DB->update_record('config_plugins', $tiiconfigfield)) {
|
||||
error("errorupdating");
|
||||
}
|
||||
} else {
|
||||
$tiiconfigfield = new stdClass();
|
||||
$tiiconfigfield->value = $value;
|
||||
$tiiconfigfield->plugin = 'plagiarism';
|
||||
$tiiconfigfield->name = $field;
|
||||
if (! $DB->insert_record('config_plugins', $tiiconfigfield)) {
|
||||
error("errorinserting");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//now call TII settings to set up teacher account as set on this page.
|
||||
if ($plagiarismsettings = plagiarism_get_settings()) { //get tii settings.
|
||||
$tii = array();
|
||||
//set globals.
|
||||
$tii['username'] = $plagiarismsettings['turnitin_userid'];
|
||||
$tii['uem'] = $plagiarismsettings['turnitin_email'];
|
||||
$tii['ufn'] = $plagiarismsettings['turnitin_firstname'];
|
||||
$tii['uln'] = $plagiarismsettings['turnitin_lastname'];
|
||||
$tii['uid'] = $plagiarismsettings['turnitin_userid'];
|
||||
$tii['utp'] = '2'; //2 = this user is an instructor
|
||||
$tii['cid'] = $plagiarismsettings['turnitin_courseprefix']; //course ID
|
||||
$tii['ctl'] = $plagiarismsettings['turnitin_courseprefix']; //Course title. -this uses Course->id and shortname to ensure uniqueness.
|
||||
//$tii['diagnostic'] = '1'; //debug only
|
||||
$tii['fcmd'] = '2'; //when set to 2 the TII API should return XML
|
||||
$tii['fid'] = '1'; //set command. - create user and login to Turnitin (fid=1)
|
||||
$tiixml = plagiarism_get_xml(turnitin_get_url($tii));
|
||||
if (!empty($tiixml->rcode[0]) && $tiixml->rcode[0] == '11') {
|
||||
notify(get_string('savedconfigsuccess', 'plagiarism'), 'notifysuccess');
|
||||
} else {
|
||||
//disable turnitin as this config isn't correct.
|
||||
$rec = $DB->get_record('config_plugins', array('name'=>'turnitin_use', 'plugin'=>'plagiarism'));
|
||||
$rec->value = 0;
|
||||
$DB->update_record('config_plugins', $rec);
|
||||
notify(get_string('savedconfigfailure', 'plagiarism'));
|
||||
}
|
||||
}
|
||||
}
|
||||
$plagiarismsettings = plagiarism_get_settings();
|
||||
$mform->set_data($plagiarismsettings);
|
||||
|
||||
$currenttab='plagiarism';
|
||||
require_once('plagiarism_tabs.php');
|
||||
|
||||
echo $OUTPUT->heading(get_string('tiiheading', 'plagiarism'), 3);
|
||||
if ($plagiarismsettings) {
|
||||
//Now show link to ADMIN tii interface - NOTE: this logs in the ADMIN user, should be hidden from normal teachers.
|
||||
$tii['uid'] = $plagiarismsettings['turnitin_userid'];
|
||||
$tii['username'] = $plagiarismsettings['turnitin_userid'];
|
||||
$tii['uem'] = $plagiarismsettings['turnitin_email'];
|
||||
$tii['ufn'] = $plagiarismsettings['turnitin_firstname'];
|
||||
$tii['uln'] = $plagiarismsettings['turnitin_lastname'];
|
||||
$tii['utp'] = '2'; //2 = this user is an instructor
|
||||
$tii['utp'] = '3';
|
||||
$tii['fcmd'] = '1'; //when set to 2 this returns XML
|
||||
$tii['fid'] = '12'; //set commands - Administrator login/statistics.
|
||||
echo '<div align="center">';
|
||||
echo '<a href="'.turnitin_get_url($tii).'" target="_blank">'.get_string("adminlogin","plagiarism").'</a><br/>';
|
||||
$tii['utp'] = '2';
|
||||
$tii['fid'] = '1'; //set commands - Administrator login/statistics.
|
||||
echo '<a href="'.turnitin_get_url($tii).'" target="_blank">'.get_string("teacherlogin","plagiarism").'</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter', 'intro');
|
||||
$mform->display();
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
@ -1,70 +0,0 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* turnitin_errors.php - Displays Turnitin files with a current error state.
|
||||
*
|
||||
* @package administration
|
||||
* @author Dan Marsden <dan@danmarsden.com>
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/plagiarismlib.php');
|
||||
require_once('plagiarism_form.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('plagiarism');
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$fileid = optional_param('fileid',0,PARAM_INT);
|
||||
$resetuser = optional_param('reset',0,PARAM_INT);
|
||||
$page = optional_param('page', 0, PARAM_INT);
|
||||
|
||||
$mform = new plagiarism_defaults_form(null);
|
||||
$plagiarismdefaults = $DB->get_records_menu('plagiarism_config', array('cm'=>0),'','name,value'); //cmid(0) is the default list.
|
||||
if (!empty($plagiarismdefaults)) {
|
||||
$mform->set_data($plagiarismdefaults);
|
||||
}
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('plagiarismdefaults', 'plagiarism'));
|
||||
$currenttab='plagiarismdefaults';
|
||||
require_once('plagiarism_tabs.php');
|
||||
if (($data = $mform->get_data()) && confirm_sesskey()) {
|
||||
$plagiarismelements = plagiarism_config_options();
|
||||
foreach($plagiarismelements as $element) {
|
||||
if (isset($data->$element)) {
|
||||
$newelement = new object();
|
||||
$newelement->cm = 0;
|
||||
$newelement->name = $element;
|
||||
$newelement->value = $data->$element;
|
||||
if (isset($plagiarismdefaults[$element])) { //update
|
||||
$newelement->id = $DB->get_field('plagiarism_config', 'id', (array('cm'=>0, 'name'=>$element)));
|
||||
$DB->update_record('plagiarism_config', $newelement);
|
||||
} else { //insert
|
||||
$DB->insert_record('plagiarism_config', $newelement);
|
||||
}
|
||||
}
|
||||
}
|
||||
notify(get_string('plagiarismdefaultupdated','plagiarism'),'notifysuccess');
|
||||
}
|
||||
echo $OUTPUT->box(get_string('plagiarismdefaultsdesc', 'plagiarism'));
|
||||
|
||||
$mform->display();
|
||||
echo $OUTPUT->footer();
|
@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once($CFG->dirroot.'/lib/formslib.php');
|
||||
|
||||
class plagiarism_setup_form extends moodleform {
|
||||
|
||||
/// Define the form
|
||||
function definition () {
|
||||
global $CFG;
|
||||
|
||||
$mform =& $this->_form;
|
||||
$choices = array('No','Yes');
|
||||
$mform->addElement('html', get_string('tiiexplain', 'plagiarism'));
|
||||
$mform->addElement('checkbox', 'turnitin_use', get_string('usetii', 'plagiarism'));
|
||||
|
||||
$mform->addElement('text', 'turnitin_api', get_string('tiiapi', 'plagiarism'));
|
||||
$mform->addElement('static','turnitin_api_description', '', get_string('configtiiapi', 'plagiarism'));
|
||||
$mform->addRule('turnitin_api', null, 'required', null, 'client');
|
||||
$mform->setDefault('turnitin_api', 'https://api.turnitin.com/api.asp');
|
||||
|
||||
$mform->addElement('text', 'turnitin_accountid', get_string('tiiaccountid', 'plagiarism'));
|
||||
$mform->addElement('static','turnitin_accountid_description', '', get_string('configtiiaccountid', 'plagiarism'));
|
||||
$mform->addRule('turnitin_accountid', null, 'numeric', null, 'client');
|
||||
|
||||
$mform->addElement('passwordunmask', 'turnitin_secretkey', get_string('tiisecretkey', 'plagiarism'));
|
||||
$mform->addElement('static','turnitin_secretkey_description', '', get_string('configtiisecretkey', 'plagiarism'));
|
||||
$mform->addRule('turnitin_secretkey', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('checkbox', 'turnitin_senduseremail', get_string('tiisenduseremail', 'plagiarism'));
|
||||
$mform->addElement('static','turnitin_senduseremail_description', '', get_string('config_tiisenduseremail', 'plagiarism'));
|
||||
|
||||
$mform->addElement('checkbox', 'turnitin_enablegrademark', get_string('tiienablegrademark', 'plagiarism'));
|
||||
$mform->addElement('static','turnitin_enablegrademark_description', '', get_string('config_tiienablegrademark', 'plagiarism'));
|
||||
|
||||
$mform->addElement('text', 'turnitin_emailprefix', get_string('tiiemailprefix', 'plagiarism'));
|
||||
$mform->addElement('static','turnitin_emailprefix_description', '', get_string('configtiiemailprefix', 'plagiarism'));
|
||||
$mform->disabledIf('turnitin_emailprefix', 'turnitin_senduseremail', 'checked');
|
||||
|
||||
$mform->addElement('text', 'turnitin_courseprefix', get_string('tiicourseprefix', 'plagiarism'));
|
||||
$mform->addElement('static','turnitin_courseprefix_description', '', get_string('configtiicourseprefix', 'plagiarism'));
|
||||
$mform->addRule('turnitin_courseprefix', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('text', 'turnitin_userid', get_string('username'));
|
||||
$mform->addElement('static','turnitin_userid_description', '', get_string('configtiiuserid', 'plagiarism'));
|
||||
$mform->addRule('turnitin_userid', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('text', 'turnitin_email', get_string('email'));
|
||||
$mform->addElement('static','turnitin_email_description', '', get_string('configtiiemail', 'plagiarism'));
|
||||
$mform->addRule('turnitin_email', null, 'email', null, 'client');
|
||||
$mform->addRule('turnitin_email', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('text', 'turnitin_firstname', get_string('firstname'));
|
||||
$mform->addElement('static','turnitin_firstname_description', '', get_string('configtiifirstname', 'plagiarism'));
|
||||
$mform->addRule('turnitin_firstname', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('text', 'turnitin_lastname', get_string('lastname'));
|
||||
$mform->addElement('static','turnitin_lastname_description', '', get_string('configtiilastname', 'plagiarism'));
|
||||
$mform->addRule('turnitin_lastname', null, 'required', null, 'client');
|
||||
|
||||
$mform->addElement('textarea', 'turnitin_student_disclosure', get_string('studentdisclosure','plagiarism'),'wrap="virtual" rows="6" cols="50"');
|
||||
$mform->addElement('static','turnitin_student_disclosure_description', '', get_string('configstudentdisclosure','plagiarism'));
|
||||
$mform->setDefault('turnitin_student_disclosure', get_string('studentdisclosuredefault','plagiarism'));
|
||||
|
||||
$this->add_action_buttons(true);
|
||||
}
|
||||
}
|
||||
|
||||
class plagiarism_defaults_form extends moodleform {
|
||||
|
||||
/// Define the form
|
||||
function definition () {
|
||||
$mform =& $this->_form;
|
||||
plagiarism_get_form_elements($mform);
|
||||
$this->add_action_buttons(true);
|
||||
}
|
||||
}
|
||||
|
@ -1,134 +0,0 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* turnitin_errors.php - Displays Turnitin files with a current error state.
|
||||
*
|
||||
* @package administration
|
||||
* @author Dan Marsden <dan@danmarsden.com>
|
||||
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/plagiarismlib.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('plagiarism');
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$fileid = optional_param('fileid',0,PARAM_INT);
|
||||
$resetuser = optional_param('reset',0,PARAM_INT);
|
||||
$page = optional_param('page', 0, PARAM_INT);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('plagiarismreports', 'plagiarism'));
|
||||
$currenttab='plagiarismreports';
|
||||
require_once('plagiarism_tabs.php');
|
||||
|
||||
echo $OUTPUT->box(get_string('tiiexplainerrors', 'plagiarism'));
|
||||
|
||||
if ($resetuser==1 && $fileid) {
|
||||
$tfile = $DB->get_record('plagiarism_files', array('id'=>$fileid));
|
||||
$tfile->statuscode = 'pending';
|
||||
if ($DB->update_record('plagiarism_files', $tfile)) {
|
||||
notify("File reset");
|
||||
}
|
||||
} elseif ($resetuser==2) {
|
||||
$sql = "statuscode <>'success' AND statuscode<>'pending' AND statuscode<>'51'";
|
||||
$tiifiles = $DB->get_records_select('plagiarism_files', $sql);
|
||||
foreach($tiifiles as $tiifile) {
|
||||
$tiifile->statuscode = 'pending';
|
||||
if ($DB->update_record('plagiarism_files', $tiifile)) {
|
||||
notify("File reset");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tablecolumns = array('name', 'course', 'file', 'status');
|
||||
$tableheaders = array(get_string('name'),
|
||||
get_string('course'),
|
||||
get_string('file'),
|
||||
get_string('status'));
|
||||
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
$table = new flexible_table('plagiarism-status');
|
||||
|
||||
$table->define_columns($tablecolumns);
|
||||
$table->define_headers($tableheaders);
|
||||
$table->define_baseurl($CFG->wwwroot.'/admin/plagiarism_reports.php');
|
||||
|
||||
$table->sortable(false);
|
||||
$table->collapsible(true);
|
||||
$table->initialbars(false);
|
||||
|
||||
$table->column_suppress('fullname');
|
||||
|
||||
$table->column_class('name', 'name');
|
||||
$table->column_class('course', 'course');
|
||||
$table->column_class('file', 'file');
|
||||
$table->column_class('status', 'status');
|
||||
|
||||
$table->set_attribute('cellspacing', '0');
|
||||
$table->set_attribute('id', 'attempts');
|
||||
$table->set_attribute('class', 'submissions');
|
||||
$table->set_attribute('width', '100%');
|
||||
//$table->set_attribute('align', 'center');
|
||||
|
||||
$table->no_sorting('name');
|
||||
$table->no_sorting('course');
|
||||
$table->no_sorting('file');
|
||||
$table->no_sorting('status');
|
||||
|
||||
$table->setup();
|
||||
|
||||
$sql = "statuscode <>'success' AND statuscode<>'pending' AND statuscode<>'51'";
|
||||
$tiifiles = $DB->get_records_select('plagiarism_files', $sql);
|
||||
$pagesize = 15;
|
||||
$table->pagesize($pagesize, count($tiifiles));
|
||||
$start = $page * $pagesize;
|
||||
$pagtiifiles = array_slice($tiifiles, $start, $pagesize);
|
||||
if (!empty($pagtiifiles)) {
|
||||
foreach($pagtiifiles as $tiifile) {
|
||||
$fs = get_file_storage();
|
||||
$file = $fs->get_file_by_id($tiifile->file);
|
||||
//check file exists
|
||||
if (empty($file)) {
|
||||
$DB->delete_records('plagiarism_files',array('id'=>$tiifile->id));
|
||||
continue;
|
||||
}
|
||||
//should tidy these up - shouldn't need to call so often
|
||||
$reset = $tiifile->statuscode.' <a href="plagiarism_reports.php?reset=1&fileid='.$tiifile->id.'">reset</a>';
|
||||
$user = $DB->get_record('user', array('id'=>$tiifile->userid));
|
||||
$cm = $DB->get_record('course_modules', array('id'=>$tiifile->cm));
|
||||
$course = $DB->get_record('course', array('id'=>$cm->course));
|
||||
$row = array(fullname($user), $course->shortname, $file->get_filename(), $reset);
|
||||
|
||||
|
||||
$table->add_data($row);
|
||||
}
|
||||
}
|
||||
|
||||
$table->print_html();
|
||||
if (!empty($tiifiles)) {
|
||||
echo '<br/><br/><div align="center">';
|
||||
$options["reset"] = "2";
|
||||
echo $OUTPUT->single_button("plagiarism_reports.php", get_string("resetall", "plagiarism"), 'post',$options);
|
||||
echo '</div>';
|
||||
}
|
||||
echo $OUTPUT->footer();
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
$strplagiarism = get_string('plagiarism', 'plagiarism');
|
||||
$strplagiarismreports = get_string('plagiarismreports', 'plagiarism');
|
||||
$strplagiarismdefaults = get_string('plagiarismdefaults', 'plagiarism');
|
||||
|
||||
$tabs = array();
|
||||
$tabs[] = new tabobject('plagiarism', 'plagiarism.php', $strplagiarism, $strplagiarism, false);
|
||||
$tabs[] = new tabobject('plagiarismreports', 'plagiarism_reports.php', $strplagiarismreports, $strplagiarismreports, false);
|
||||
$tabs[] = new tabobject('plagiarismdefaults', 'plagiarism_defaults.php', $strplagiarismdefaults, $strplagiarismdefaults, false);
|
||||
print_tabs(array($tabs), $currenttab);
|
@ -304,7 +304,6 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
|
||||
}
|
||||
}
|
||||
}
|
||||
$ADMIN->add('modsettings', new admin_externalpage('plagiarism',get_string('plagiarism', 'plagiarism'), "$CFG->wwwroot/$CFG->admin/plagiarism/plagiarism.php", 'moodle/site:config'));
|
||||
|
||||
$ADMIN->add('reports', new admin_externalpage('comments', get_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
|
||||
/// Now add reports
|
||||
|
@ -29,7 +29,6 @@ require_once($CFG->libdir.'/filelib.php');
|
||||
require_once($CFG->libdir.'/gradelib.php');
|
||||
require_once($CFG->libdir.'/completionlib.php');
|
||||
require_once($CFG->libdir.'/conditionlib.php');
|
||||
require_once($CFG->libdir.'/plagiarismlib.php');
|
||||
|
||||
$add = optional_param('add', '', PARAM_ALPHA); // module name
|
||||
$update = optional_param('update', 0, PARAM_INT);
|
||||
@ -554,7 +553,6 @@ if ($mform->is_cancelled()) {
|
||||
|
||||
rebuild_course_cache($course->id);
|
||||
grade_regrade_final_grades($course->id);
|
||||
plagiarism_save_form_elements($fromform); //save plagiarism settings
|
||||
|
||||
if (isset($fromform->submitbutton)) {
|
||||
redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$fromform->coursemodule");
|
||||
|
@ -1,76 +0,0 @@
|
||||
<?php
|
||||
$string['plagiarism'] = 'Plagiarism Prevention';
|
||||
$string['plagiarismreports'] = 'Plagiarism Reports';
|
||||
$string['plagiarismdefaults'] = 'Plagiarism Defaults';
|
||||
$string['plagiarismdefaultsdesc'] = 'The following settings are the defaults set when enabling Plagiarism within an Activity Module';
|
||||
$string['tii'] = 'Turnitin';
|
||||
$string['useplagiarism'] ='Use Plagiarism Submission';
|
||||
$string['usetii'] ='Enable Turnitin';
|
||||
$string['tiiapi'] = 'Turnitin API';
|
||||
$string['configtiiapi'] = 'This is the address of the Turnitin API - usually https://api.turnitin.com/api.asp';
|
||||
$string['adminlogin'] = 'Turnitin Admin Login';
|
||||
$string['tiiheading'] = 'Turnitin Submission';
|
||||
$string['tiiexplain'] = 'Turnitin is a commercial product and you must have a paid subscription to use this service; for more information see <a href=\"http://docs.moodle.org/en/Turnitin_administration\">http://docs.moodle.org/en/Turnitin_administration</a>';
|
||||
$string['configusetiimodule'] = 'Enable Turnitin submission.';
|
||||
$string['tiiaccountid'] ='Turnitin Account ID';
|
||||
$string['configtiiaccountid'] ='This is your Account ID as provided from Turnitin.com';
|
||||
$string['tiisecretkey'] ='Turnitin Secret Key';
|
||||
$string['configtiisecretkey'] ='This is normally e-mailed to you on request from your Turnitin.com Account representative';
|
||||
$string['configtiiuserid'] ='Username of the person you want all new classes/assignments in Moodle to be assigned to in the turnitin System - this user should not already exist in the Turnitin system, and should not be changed once the turnitin system is being used.';
|
||||
$string['configtiiemail'] ='Email address of the person you want all new classes/assignments in Moodle to be assigned to in the turnitin System ';
|
||||
$string['configtiifirstname'] ='First name of the person you want all new classes/assignments in Moodle to be assigned to in the turnitin System';
|
||||
$string['configtiilastname'] ='Surname of the person you want all new classes/assignments in Moodle to be assigned to in the turnitin System';
|
||||
$string['tiisenduseremail'] = 'Send User E-mail';
|
||||
$string['config_tiisenduseremail'] = 'Send e-mail to every student created in the TII system with a link to allow login to www.turnitin.com with a temporary password';
|
||||
$string['tiicourseprefix'] = 'Course Prefix';
|
||||
$string['configtiicourseprefix'] = 'This places a prefix before all courses created in the TII system - you MUST do this if you have more than 1 moodle site using turnitin, and they MUST be different on each moodle site.';
|
||||
$string['similarity'] = 'Similarity';
|
||||
$string['studentdisclosuredefault'] ='All files uploaded will be submitted to the plagiarism detection service Turnitin.com';
|
||||
$string['studentdisclosure'] = 'Student Disclosure';
|
||||
$string['configstudentdisclosure'] = 'This text will be displayed to all students on the file upload page.';
|
||||
$string['tiiemailprefix'] ='Student Email prefix';
|
||||
$string['configtiiemailprefix'] ='You must set this if you do not want students to be able to log into the turnitin.com site and view full reports.';
|
||||
$string['showstudentsscore']='Show Plagiarism score to student';
|
||||
$string['showstudentsreport']='Show Plagiarism report to student';
|
||||
$string['showwhenclosed']='When Activity closed';
|
||||
$string['savedconfigsuccess'] = 'Turnitin Settings Saved, and Teacher account created';
|
||||
$string['savedconfigfailure'] = 'Unable to connect/authenticate to Turnitin - you may have an incorrect Secret Key/Account ID combination or this server cannot connect to the API';
|
||||
$string['defaultuse'] = 'Use Default';
|
||||
$string['configdefault'] = 'This is a default setting for the assignment creation page. Only users with the capability moodle/plagiarism:enableturnitin can change this setting for an individual assignment';
|
||||
$string['defaultshowscore'] ='Show Score Default';
|
||||
$string['defaultshowreport'] = 'Show Report Default';
|
||||
$string['tiierror'] = 'TII Error:';
|
||||
$string['tiiexplainerrors'] = 'This page lists any files submitted to Turnitin that are currently in an error state. A list of turnitin Error codes and their description is available here:<a href=\"http://docs.moodle.org/en/Turnitin_errors\">docs.moodle.org/en/Turnitin_errors</a><br/>When files are reset, the cron will attempt to submit the file to turnitin again.<br/>NOTE: files with errors in the range 1000-1999 will not benefit from being reset, and will probably always fail.';
|
||||
$string['resetall'] = 'Reset All';
|
||||
$string['tiierror1007'] = 'Turnitin could not process this file as it is too large';
|
||||
$string['tiierror1008'] = 'An error occured when attempting to send this file to Turnitin';
|
||||
$string['tiierror1009'] = 'Turnitin could not process this file - it is an unsupported file type. Valid file types are MS Word, Acrobat PDF, Postscript, Text, HTML, WordPerfect and Rich Text Format';
|
||||
$string['tiierror1010'] = 'Turnitin could not process this file - it must contain more than 100 non-whitespace characters';
|
||||
$string['tiierror1011'] = 'Turnitin could not process this file - it is incorrectly formatted and there seems to be spaces between each letter.';
|
||||
$string['tiierror1012'] = 'Turnitin could not process this file - it\'s length exceeds the Turnitin limits';
|
||||
$string['tiierror1013'] = 'Turnitin could not process this file - it must contain more than 20 words';
|
||||
$string['tiierror1020'] = 'Turnitin could not process this file - it contains characters from a character set that is not supported';
|
||||
$string['tiierror1023'] = 'Turnitin could not process this pdf - make sure it is not password protected and contains selectable text rather than scanned images';
|
||||
$string['tiierror1024'] = 'Turnitin could not process this file - it does not meet the Turnitin criteria for a legitamate paper';
|
||||
$string['tiierrorpaperfail'] = 'Turnitin could not process this file.';
|
||||
$string['tiierrorpending'] ='File pending submission to Turnitin';
|
||||
$string['tiiconfigerror'] = 'A site configuration error occured when attempting to send this file to Turnitin';
|
||||
$string['submitondraft'] = 'Submit file when first uploaded';
|
||||
$string['submitonfinal'] = 'Submit file when student sends for marking';
|
||||
$string['draftsubmit'] = 'When should the file be submitted to Plagiarism tools';
|
||||
$string['plagiarismcomparestudents'] = 'Compare submitted files with other students files';
|
||||
$string['plagiarismcomparejournals'] = 'Compare submitted files with Journals, periodicals, publications';
|
||||
$string['plagiarismcompareinternet'] = 'Compare submitted files with Internet';
|
||||
$string['plagiarismcompareinstitution'] = 'Compare submitted files with papers submitted within this institution';
|
||||
$string['plagiarismreportgen'] = 'When to generate the Originality Reports';
|
||||
$string['reportgenimmediate'] = 'Immediately (first report is final)';
|
||||
$string['reportgenimmediateoverwrite'] = 'Immediately (can overwrite reports)';
|
||||
$string['reportgenduedate'] = 'On the due date';
|
||||
$string['plagiarismexcludebiblio'] = 'Exclude bibliography';
|
||||
$string['plagiarismexcludequoted'] = 'Exclude quoted material';
|
||||
$string['percentage'] = 'Percentage';
|
||||
$string['wordcount'] = 'Word count';
|
||||
$string['plagiarismexcludematches'] = 'Exclude small matches';
|
||||
$string['plagiarismdefaultupdated'] = 'Plagiarism defaults updated';
|
||||
$string['tiienablegrademark'] = 'Enable Grademark';
|
||||
$string['config_tiienablegrademark'] = 'Grademark is an optional feature within Turnitin - you must have included this in your Turnitin subscription to use it.';
|
@ -1438,33 +1438,6 @@ $capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/plagiarism:enable' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'manager' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/plagiarism:viewsimilarityscore' => array(
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'manager' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/plagiarism:viewfullreport' => array(
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'manager' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/portfolio:export' => array(
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
|
@ -2484,7 +2484,7 @@
|
||||
<INDEX NAME="typeitem_ix" UNIQUE="false" FIELDS="type, itemid"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="backup_ids_template" COMMENT="To store all sort of ids along the backup process. Note this table isn't really used but its temporary counterpart." PREVIOUS="backup_controllers" NEXT="plagiarism_files">
|
||||
<TABLE NAME="backup_ids_template" COMMENT="To store all sort of ids along the backup process. Note this table isn't really used but its temporary counterpart." PREVIOUS="backup_controllers">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="backupid"/>
|
||||
<FIELD NAME="backupid" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="unique id of the backup" PREVIOUS="id" NEXT="itemname"/>
|
||||
@ -2500,34 +2500,5 @@
|
||||
<INDEX NAME="backupid_parentitemid_ix" UNIQUE="false" FIELDS="backupid, itemname, parentitemid"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="plagiarism_files" COMMENT="info about submitted files" PREVIOUS="backup_ids_template" NEXT="plagiarism_config">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="cm"/>
|
||||
<FIELD NAME="cm" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
|
||||
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="cm" NEXT="file"/>
|
||||
<FIELD NAME="file" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="externalid"/>
|
||||
<FIELD NAME="externalid" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="file" NEXT="externalstatus"/>
|
||||
<FIELD NAME="externalstatus" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="externalid" NEXT="statuscode"/>
|
||||
<FIELD NAME="statuscode" TYPE="char" LENGTH="10" NOTNULL="false" SEQUENCE="false" PREVIOUS="externalstatus" NEXT="similarityscore"/>
|
||||
<FIELD NAME="similarityscore" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="statuscode"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="cm"/>
|
||||
<KEY NAME="cm" TYPE="foreign" FIELDS="cm" REFTABLE="course_modules" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="cm"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="plagiarism_config" COMMENT="info about submitted files" PREVIOUS="plagiarism_files">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="cm"/>
|
||||
<FIELD NAME="cm" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
|
||||
<FIELD NAME="name" TYPE="text" LENGTH="small" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="cm" NEXT="value"/>
|
||||
<FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="cm"/>
|
||||
<KEY NAME="cm" TYPE="foreign" FIELDS="cm" REFTABLE="course_modules" REFFIELDS="id" PREVIOUS="primary"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
</XMLDB>
|
||||
|
@ -3643,42 +3643,6 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
|
||||
// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2010042303);
|
||||
}
|
||||
if ($result && $oldversion < 2010042304) { /// Plagiarsim API UPGRADE
|
||||
$table = new XMLDBTable('plagiarism_files');
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null);
|
||||
$table->add_field('cm', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');
|
||||
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');
|
||||
$table->add_field('file', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('externalid', XMLDB_TYPE_TEXT, 'small', null, null, null, null);
|
||||
$table->add_field('externalstatus', XMLDB_TYPE_INTEGER, '10', XMLDB_TYPE_INTEGER, null, null, null);
|
||||
$table->add_field('statuscode', XMLDB_TYPE_CHAR, '10', null, null, null, null);
|
||||
$table->add_field('similarityscore', XMLDB_TYPE_INTEGER, '5', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');
|
||||
|
||||
//keys
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
$table->add_key('cm', XMLDB_KEY_FOREIGN, array('cm'), 'course_modules', array('id'));
|
||||
$table->add_key('userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));
|
||||
if (!$dbman->table_exists($table)) {
|
||||
$dbman->create_table($table);
|
||||
}
|
||||
|
||||
upgrade_main_savepoint($result, 2010042304);
|
||||
}
|
||||
if ($result && $oldversion < 2010042305) { /// Plagiarsim API UPGRADE
|
||||
$table = new XMLDBTable('plagiarism_config');
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null);
|
||||
$table->add_field('cm', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');
|
||||
$table->add_field('name', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('value', XMLDB_TYPE_TEXT, 'small', null, null, null, null);
|
||||
//keys
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
$table->add_key('cm', XMLDB_KEY_FOREIGN, array('cm'), 'course_modules', array('id'));
|
||||
|
||||
if (!$dbman->table_exists($table)) {
|
||||
$dbman->create_table($table);
|
||||
}
|
||||
upgrade_main_savepoint($result, 2010042305);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -6903,7 +6903,6 @@ function get_core_subsystems() {
|
||||
'notes' => 'notes',
|
||||
'pagetype' => NULL,
|
||||
'pix' => NULL,
|
||||
'plagiarism' => 'plagiarism',
|
||||
'portfolio' => 'portfolio',
|
||||
'question' => 'question',
|
||||
'rating' => 'rating',
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
$handlers = array (
|
||||
|
||||
/*
|
||||
* Assignment Events - for plagiarism submission
|
||||
*/
|
||||
'assignment_file_sent' => array (
|
||||
'handlerfile' => '/lib/plagiarismlib.php',
|
||||
'handlerfunction' => 'plagiarism_event_assignment_file_submission',
|
||||
'schedule' => 'cron'
|
||||
),
|
||||
'assignment_finalize_sent' => array (
|
||||
'handlerfile' => '/lib/plagiarismlib.php',
|
||||
'handlerfunction' => 'plagiarism_event_assignment_file_submission',
|
||||
'schedule' => 'cron'
|
||||
),
|
||||
'assignment_mod_created' => array (
|
||||
'handlerfile' => '/lib/plagiarismlib.php',
|
||||
'handlerfunction' => 'plagiarism_event_assignment_mod_created',
|
||||
'schedule' => 'cron'
|
||||
),
|
||||
'assignment_mod_updated' => array (
|
||||
'handlerfile' => '/lib/plagiarismlib.php',
|
||||
'handlerfunction' => 'plagiarism_event_assignment_mod_updated',
|
||||
'schedule' => 'cron'
|
||||
),
|
||||
'assignment_mod_deleted' => array (
|
||||
'handlerfile' => '/lib/plagiarismlib.php',
|
||||
'handlerfunction' => 'plagiarism_event_assignment_mod_deleted',
|
||||
'schedule' => 'cron'
|
||||
),
|
||||
|
||||
);
|
@ -207,7 +207,6 @@ class assignment_base {
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter', 'intro');
|
||||
echo format_module_intro('assignment', $this->assignment, $this->cm->id);
|
||||
echo $OUTPUT->box_end();
|
||||
plagiarism_print_disclosure($this->cm->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -472,9 +471,6 @@ class assignment_base {
|
||||
$result = false;
|
||||
}
|
||||
$mod = $DB->get_field('modules','id',array('name'=>'assignment'));
|
||||
if (! $DB->delete_records('plagiarism_files', array('cm'=>$cm->id))) {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
assignment_grade_item_delete($assignment);
|
||||
|
||||
@ -1085,7 +1081,6 @@ class assignment_base {
|
||||
/* first we check to see if the form has just been submitted
|
||||
* to request user_preference updates
|
||||
*/
|
||||
plagiarism_update_status($this->course, $this->cm);
|
||||
if (isset($_POST['updatepref'])){
|
||||
$perpage = optional_param('perpage', 10, PARAM_INT);
|
||||
$perpage = ($perpage <= 0) ? 10 : $perpage ;
|
||||
@ -1806,8 +1801,6 @@ class assignment_base {
|
||||
$button->set_format_by_file($file);
|
||||
$output .= $button->to_html(PORTFOLIO_ADD_ICON_LINK);
|
||||
}
|
||||
$output .= get_plagiarism_links($userid, $file);
|
||||
$output .= '<br />';
|
||||
}
|
||||
if (count($files) > 1 && $this->portfolio_exportable() && has_capability('mod/assignment:exportownsubmission', $this->context)) {
|
||||
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/locallib.php');
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once($CFG->libdir . '/plagiarismlib.php');
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT); // Course module ID
|
||||
$a = optional_param('a', 0, PARAM_INT); // Assignment ID
|
||||
|
@ -291,7 +291,6 @@ class assignment_upload extends assignment_base {
|
||||
$mimetype = $file->get_mimetype();
|
||||
$path = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/assignment_submission/'.$userid.'/'.$filename);
|
||||
$output .= '<a href="'.$path.'" ><img class="icon" src="'.$OUTPUT->pix_url(file_mimetype_icon($mimetype)).'" alt="'.$mimetype.'" />'.s($filename).'</a> ';
|
||||
$output .= plagiarism_get_links($userid, $file, $this->cm->id, $this->course, $this->assignment);
|
||||
}
|
||||
|
||||
}
|
||||
@ -358,9 +357,6 @@ class assignment_upload extends assignment_base {
|
||||
.'<img title="'.$strdelete.'" src="'.$OUTPUT->pix_url('t/delete') . '" class="iconsmall" alt="" /></a> ';
|
||||
}
|
||||
|
||||
$output .= plagiarism_get_links($userid, $file, $this->cm->id, $this->course, $this->assignment);
|
||||
$output .= '<br />';
|
||||
|
||||
if (has_capability('mod/assignment:exportownsubmission', $this->context)) {
|
||||
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'fileid' => $file->get_id()), '/mod/assignment/locallib.php');
|
||||
$button->set_format_by_file($file);
|
||||
@ -1065,7 +1061,6 @@ class assignment_upload extends assignment_base {
|
||||
$mform->setDefault('var4', 1);
|
||||
|
||||
$course_context = get_context_instance(CONTEXT_COURSE, $COURSE->id);
|
||||
plagiarism_get_form_elements_module($mform, $course_context);
|
||||
|
||||
}
|
||||
|
||||
@ -1132,7 +1127,6 @@ class assignment_upload extends assignment_base {
|
||||
public function download_submissions() {
|
||||
global $CFG,$DB;
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
|
||||
$submissions = $this->get_submissions('','');
|
||||
if (empty($submissions)) {
|
||||
error("there are no submissions to download");
|
||||
@ -1149,6 +1143,12 @@ class assignment_upload extends assignment_base {
|
||||
$groupid = $group->id;
|
||||
$groupname = $group->name.'-';
|
||||
}
|
||||
$fb = get_file_browser();
|
||||
$fileb = $fb->get_file_info($this->context, 'assignment_submission');
|
||||
print_object($fileb);
|
||||
//print_object($fileb->get_params());
|
||||
error('here');
|
||||
|
||||
$filename = str_replace(' ', '_', clean_filename($this->course->shortname.'-'.$this->assignment->name.'-'.$groupname.$this->assignment->id.".zip")); //name of new zip file.
|
||||
foreach ($submissions as $submission) {
|
||||
$a_userid = $submission->userid; //get userid
|
||||
|
@ -23,8 +23,6 @@ class assignment_uploadsingle extends assignment_base {
|
||||
$mimetype = $file->get_mimetype();
|
||||
$path = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/assignment_submission/'.$userid.'/'.$filename);
|
||||
$output .= '<a href="'.$path.'" ><img class="icon" src="'.$OUTPUT->pix_url(file_mimetype_icon($mimetype)).'" alt="'.$mimetype.'" />'.s($filename).'</a><br />';
|
||||
$output .= get_plagiarism_links($userid, $file);
|
||||
$output .='<br/>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,7 +136,7 @@ class assignment_uploadsingle extends assignment_base {
|
||||
}
|
||||
|
||||
function setup_elements(&$mform) {
|
||||
global $CFG, $COURSE, $DB;
|
||||
global $CFG, $COURSE;
|
||||
|
||||
$ynoptions = array( 0 => get_string('no'), 1 => get_string('yes'));
|
||||
|
||||
@ -155,8 +153,6 @@ class assignment_uploadsingle extends assignment_base {
|
||||
$mform->addElement('select', 'maxbytes', get_string('maximumsize', 'assignment'), $choices);
|
||||
$mform->setDefault('maxbytes', $CFG->assignment_maxbytes);
|
||||
|
||||
$course_context = get_context_instance(CONTEXT_COURSE, $COURSE->id);
|
||||
plagiarism_get_form_elements_module($mform, $course_context);
|
||||
}
|
||||
|
||||
function portfolio_exportable() {
|
||||
|
@ -3,7 +3,6 @@
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once($CFG->libdir . '/completionlib.php');
|
||||
require_once($CFG->libdir . '/plagiarismlib.php');
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT); // Course Module ID
|
||||
$a = optional_param('a', 0, PARAM_INT); // Assignment ID
|
||||
|
Loading…
x
Reference in New Issue
Block a user