forked from danmarsden/moodle-plagiarism_new
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplagiarism_form.php
More file actions
114 lines (105 loc) · 7.76 KB
/
plagiarism_form.php
File metadata and controls
114 lines (105 loc) · 7.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
require_once($CFG->dirroot.'/lib/formslib.php');
class plagiarism_setup_form extends moodleform {
// Define the form
function definition () {
global $CFG;
$mform =& $this->_form;
// todo write this correctly
//$mform->setDefault('mcopyfind_enabled', get_string('true','plagiarism_mcopyfind'));
$mform->addElement('html', get_string('mcopyfindexplain', 'plagiarism_mcopyfind'));
$mform->addElement('checkbox', 'mcopyfind_use', get_string('usemcopyfind', 'plagiarism_mcopyfind'));
//comparison settings should be course specific
//settings should be an object to give the runcomparison class
// needs to be loaded before the document is loaded
$mform->addElement('textarea', 'mcopyfind_student_disclosure', get_string('studentdisclosure','plagiarism_mcopyfind'),'wrap="virtual" rows="6" cols="50"');
$mform->addHelpButton('mcopyfind_student_disclosure', 'studentdisclosure', 'plagiarism_mcopyfind');
$mform->setDefault('mcopyfind_student_disclosure', get_string('studentdisclosuredefault','plagiarism_mcopyfind'));
$this->add_action_buttons(false);
}
}
/**
*
** global $CFG;
*
* $mform = & $this->_form;
*
* //initial variables
* $languageoptions = array(0 => get_string('english', 'plagiarism_mcopyfind'), 1 => get_string('german', 'plagiarism_mcopyfind'), 2 => get_string('spanish', 'plagiarism_mcopyfind'), 3 => get_string('french', 'plagiarism_mcopyfind'));
* $emailoptions = array(0 => get_string('email_policy_never', 'plagiarism_mcopyfind'), 1 => get_string('email_policy_always', 'plagiarism_mcopyfind'), 2 => get_string('email_policy_ifred', 'plagiarism_mcopyfind'));
* $dataoptions = array(0 => get_string('noone', 'plagiarism_mcopyfind'), 1 => get_string('noonedocs', 'plagiarism_mcopyfind'), 2 => get_string('myinstitution', 'plagiarism_mcopyfind'), 3 => get_string('generaldatabase', 'plagiarism_mcopyfind'));
* $autostartoptions = array(0 => get_string('no'), 1 => get_string('yes'));
* $autodel = array(0 => get_string('week', 'plagiarism_mcopyfind'), 1 => get_string('weeks', 'plagiarism_mcopyfind'), 2 => get_string('months', 'plagiarism_mcopyfind'), 3 => get_string('neverdelete', 'plagiarism_mcopyfind'));
* $docx = array(0 => get_string('docxemail', 'plagiarism_mcopyfind'),
* 1 => get_string('docxgenerate', 'plagiarism_mcopyfind'),
* 2 => get_string('docxnone', 'plagiarism_mcopyfind'));
* $accountsopts = array(0 => get_string('singleaccount', 'plagiarism_mcopyfind'),
* 1 => get_string('individualaccounts', 'plagiarism_mcopyfind'));
*
* //build form
* $mform->addElement('html', "<div style='margin-left: 10%;margin-right: 30%;'><img style='margin-left:32%;' src='images/logo-new.png'/> <br /><div style='margin-left: 15%;'>" . get_string('mcopyfindexplain', 'plagiarism_mcopyfind') . "</div><br />");
*
* $mform->addElement('html', "<div>");
*
* $mform->addElement('checkbox', 'mcopyfind_use', get_string('usemcopyfind', 'plagiarism_mcopyfind'));
*
*
* $mform->addElement('select', 'mcopyfind_language', get_string("api_language", "plagiarism_mcopyfind"), $languageoptions);
* $mform->addHelpButton('mcopyfind_language', 'api_language', 'plagiarism_mcopyfind');
* $mform->setDefault('mcopyfind_language', '0');
*
* $mform->addElement('select', 'mcopyfind_email_policy', get_string("email_policy", "plagiarism_mcopyfind"), $emailoptions);
* $mform->setDefault('mcopyfind_email_policy', '0');
*
*
*
* $mform->addElement('selectyesno', 'mcopyfind_studentpermission', get_string('mcopyfind_studentpermission', 'plagiarism_mcopyfind'), 0);
*
* $mform->addElement('textarea', 'mcopyfind_student_disclosure', get_string('studentdisclosure', 'plagiarism_mcopyfind'), 'wrap="virtual" rows="6" cols="50"');
* $mform->addHelpButton('mcopyfind_student_disclosure', 'studentdisclosure', 'plagiarism_mcopyfind');
* $mform->setDefault('mcopyfind_student_disclosure', get_string('studentdisclosuredefault', 'plagiarism_mcopyfind'));
*
* $mform->addElement('text', 'mcopyfind_groups', get_string('allowgroups', 'plagiarism_mcopyfind'), array('size' => '40', 'style' => 'height: 33px'));
* $mform->addHelpButton('mcopyfind_groups', 'allowgroups', 'plagiarism_mcopyfind');
* $mform->setType('mcopyfind_groups', PARAM_TEXT);
*
* $mform->addElement('text', 'mcopyfind_nondisclosure_notice_email', get_string('mcopyfind_nondisclosure_notice_email', 'plagiarism_mcopyfind'), array('style' => 'height: 33px', 'placeholder' => get_string('mcopyfind_nondisclosure_notice_email_desc', 'plagiarism_mcopyfind')));
* $mform->addHelpButton('mcopyfind_nondisclosure_notice_email', 'mcopyfind_nondisclosure_notice_email', 'plagiarism_mcopyfind');
* $mform->setType('mcopyfind_nondisclosure_notice_email', PARAM_TEXT);
*
*
*
*
* // Think about how to secure the reports or rather how to show them, hpw to clear them
* // $wipe_user_url = new moodle_url('/plagiarism/mcopyfind/wipe_mcopyfind_user_cache.php');
* // $mform->addElement('html', html_writer::link($wipe_user_url, get_string('wipe_mcopyfind_user_cache_link', 'plagiarism_mcopyfind'))
* // . ' <a class="btn btn-link p-a-0" role="button" data-container="body" data-toggle="popover" data-placement="right"'
* // . 'data-content="'.get_string('wipe_mcopyfind_user_cache_help', 'plagiarism_mcopyfind').'<div style=\'color:red;\'>'.get_string('wipe_mcopyfind_user_cache_alert', 'plagiarism_mcopyfind').'</div>" data-html="true" tabindex="0" data-trigger="focus">'
* // . '<i class="icon fa fa-question-circle text-info fa-fw " aria-hidden="true" title="" aria-label=""></i>'
* // . '</a><br/>');
*
*
* $mform->addElement('html', "</br></br>");
* $mform->addElement('header', 'mcopyfind_assignment_defaults', get_string('mcopyfind_assignment_defaults_header', 'plagiarism_mcopyfind'));
* $mform->addElement('html', get_string('mcopyfind_assignment_defaults_explain', 'plagiarism_mcopyfind')
* . "<br /><br />");
*
* $showstudentsopt = array(\plagiarism_plugin_mcopyfind::SHOWSTUDENTS_NEVER => get_string('show_to_students_never', 'plagiarism_mcopyfind'),
* \plagiarism_plugin_mcopyfind::SHOWSTUDENTS_ALWAYS => get_string('show_to_students_always', 'plagiarism_mcopyfind'),
* \plagiarism_plugin_mcopyfind::SHOWSTUDENTS_ACTCLOSED => get_string('show_to_students_actclosed', 'plagiarism_mcopyfind'));
*
* $showstudentslinks = array(\plagiarism_plugin_mcopyfind::SHOWS_ONLY_PLVL => get_string('show_to_students_plvl', 'plagiarism_mcopyfind'),
* \plagiarism_plugin_mcopyfind::SHOWS_LINKS => get_string('show_to_students_links', 'plagiarism_mcopyfind'));
*
*
* $mform->addElement('select', 'mcopyfind_defaults_show_to_students', get_string("show_to_students", "plagiarism_mcopyfind"), $showstudentsopt);
* $mform->addHelpButton('mcopyfind_defaults_show_to_students', 'show_to_students', 'plagiarism_mcopyfind');
* $mform->setDefault('mcopyfind_defaults_show_to_students', \plagiarism_plugin_mcopyfind::SHOWSTUDENTS_NEVER);
*
* $mform->addElement('select', 'mcopyfind_defaults_show_students_links', get_string("show_to_students_opt2", "plagiarism_mcopyfind"), $showstudentslinks);
* $mform->addHelpButton('mcopyfind_defaults_show_students_links', 'show_to_students_opt2', 'plagiarism_mcopyfind');
* $mform->setDefault('mcopyfind_defaults_show_students_links', \plagiarism_plugin_mcopyfind::SHOWS_ONLY_PLVL);
* $mform->disabledIf('mcopyfind_defaults_show_students_links', 'mcopyfind_defaults_show_to_students', 'eq', 0);
* $mform->setExpanded('mcopyfind_assignment_defaults', false);
*
*/