Merge branch 'MDL-38603-workshop-form' of git://github.com/mudrd8mz/moodle
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['accesscontrol'] = 'Access control';
|
||||
$string['aggregategrades'] = 'Re-calculate grades';
|
||||
$string['aggregation'] = 'Grades aggregation';
|
||||
$string['allocate'] = 'Allocate submissions';
|
||||
@@ -129,6 +128,7 @@ $string['feedbackauthor'] = 'Feedback for the author';
|
||||
$string['feedbackauthorattachment'] = 'Attachment';
|
||||
$string['feedbackby'] = 'Feedback by {$a}';
|
||||
$string['feedbackreviewer'] = 'Feedback for the reviewer';
|
||||
$string['feedbacksettings'] = 'Feedback';
|
||||
$string['formataggregatedgrade'] = '{$a->grade}';
|
||||
$string['formataggregatedgradeover'] = '<del>{$a->grade}</del><br /><ins>{$a->over}</ins>';
|
||||
$string['formatpeergrade'] = '<span class="grade">{$a->grade}</span> <span class="gradinggrade">({$a->gradinggrade})</span>';
|
||||
@@ -162,8 +162,7 @@ $string['latesubmissions'] = 'Late submissions';
|
||||
$string['latesubmissions_desc'] = 'Allow submissions after the deadline';
|
||||
$string['latesubmissions_help'] = 'If enabled, an author may submit their work after the submissions deadline or during the assessment phase. Late submissions cannot be edited though.';
|
||||
$string['latesubmissionsallowed'] = 'Late submissions are allowed';
|
||||
$string['maxbytes'] = 'Maximum file size';
|
||||
$string['miscellaneoussettings'] = 'Miscellaneous settings';
|
||||
$string['maxbytes'] = 'Maximum submission attachment size';
|
||||
$string['modulename'] = 'Workshop';
|
||||
$string['modulename_help'] = 'The workshop activity module enables the collection, review and peer assessment of students\' work.
|
||||
|
||||
@@ -189,7 +188,7 @@ $string['noyoursubmission'] = 'You have not submitted your work yet';
|
||||
$string['nullgrade'] = '-';
|
||||
$string['overallfeedback'] = 'Overall feedback';
|
||||
$string['overallfeedbackfiles'] = 'Maximum number of overall feedback attachments';
|
||||
$string['overallfeedbackmaxbytes'] = 'Maximum file size';
|
||||
$string['overallfeedbackmaxbytes'] = 'Maximum overall feedback attachment size';
|
||||
$string['overallfeedbackmode'] = 'Overall feedback mode';
|
||||
$string['overallfeedbackmode_0'] = 'Disabled';
|
||||
$string['overallfeedbackmode_1'] = 'Enabled and optional';
|
||||
@@ -296,7 +295,6 @@ $string['withoutsubmission'] = 'Reviewer without own submission';
|
||||
$string['workshop:addinstance'] = 'Add a new workshop';
|
||||
$string['workshop:allocate'] = 'Allocate submissions for review';
|
||||
$string['workshop:editdimensions'] = 'Edit assessment forms';
|
||||
$string['workshopfeatures'] = 'Workshop features';
|
||||
$string['workshop:ignoredeadlines'] = 'Ignore time restrictions';
|
||||
$string['workshop:manageexamples'] = 'Manage example submissions';
|
||||
$string['workshopname'] = 'Workshop name';
|
||||
|
||||
@@ -77,7 +77,7 @@ function workshop_add_instance(stdclass $workshop) {
|
||||
$workshop->timecreated = time();
|
||||
$workshop->timemodified = $workshop->timecreated;
|
||||
$workshop->useexamples = (int)!empty($workshop->useexamples);
|
||||
$workshop->usepeerassessment = (int)!empty($workshop->usepeerassessment);
|
||||
$workshop->usepeerassessment = 1;
|
||||
$workshop->useselfassessment = (int)!empty($workshop->useselfassessment);
|
||||
$workshop->latesubmissions = (int)!empty($workshop->latesubmissions);
|
||||
$workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment);
|
||||
@@ -138,7 +138,7 @@ function workshop_update_instance(stdclass $workshop) {
|
||||
$workshop->timemodified = time();
|
||||
$workshop->id = $workshop->instance;
|
||||
$workshop->useexamples = (int)!empty($workshop->useexamples);
|
||||
$workshop->usepeerassessment = (int)!empty($workshop->usepeerassessment);
|
||||
$workshop->usepeerassessment = 1;
|
||||
$workshop->useselfassessment = (int)!empty($workshop->useselfassessment);
|
||||
$workshop->latesubmissions = (int)!empty($workshop->latesubmissions);
|
||||
$workshop->phaseswitchassessment = (int)!empty($workshop->phaseswitchassessment);
|
||||
|
||||
@@ -101,7 +101,7 @@ class workshop {
|
||||
/** @var bool optional feature: students practise evaluating on example submissions from teacher */
|
||||
public $useexamples;
|
||||
|
||||
/** @var bool optional feature: students perform peer assessment of others' work */
|
||||
/** @var bool optional feature: students perform peer assessment of others' work (deprecated, consider always enabled) */
|
||||
public $usepeerassessment;
|
||||
|
||||
/** @var bool optional feature: students perform self assessment of their own work */
|
||||
@@ -2284,7 +2284,7 @@ class workshop {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->usepeerassessment and has_capability('mod/workshop:peerassess', $this->context, $userid)) {
|
||||
if (has_capability('mod/workshop:peerassess', $this->context, $userid)) {
|
||||
if (!empty($gradebook->items[1]->grades)) {
|
||||
$assessmentgrade = reset($gradebook->items[1]->grades);
|
||||
if (!is_null($assessmentgrade->grade)) {
|
||||
@@ -2661,8 +2661,7 @@ class workshop_user_plan implements renderable {
|
||||
$phase = new stdclass();
|
||||
$phase->title = get_string('phasesubmission', 'workshop');
|
||||
$phase->tasks = array();
|
||||
if (($workshop->usepeerassessment or $workshop->useselfassessment)
|
||||
and has_capability('moodle/course:manageactivities', $workshop->context, $userid)) {
|
||||
if (has_capability('moodle/course:manageactivities', $workshop->context, $userid)) {
|
||||
$task = new stdclass();
|
||||
$task->title = get_string('taskinstructreviewers', 'workshop');
|
||||
$task->link = $workshop->updatemod_url();
|
||||
@@ -2844,7 +2843,7 @@ class workshop_user_plan implements renderable {
|
||||
}
|
||||
}
|
||||
unset($a);
|
||||
if ($workshop->usepeerassessment and $numofpeers) {
|
||||
if ($numofpeers) {
|
||||
$task = new stdclass();
|
||||
if ($numofpeerstodo == 0) {
|
||||
$task->completed = true;
|
||||
|
||||
+30
-45
@@ -78,26 +78,14 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
// Introduction
|
||||
$this->add_intro_editor(false, get_string('introduction', 'workshop'));
|
||||
|
||||
// Workshop features ----------------------------------------------------------
|
||||
$mform->addElement('header', 'workshopfeatures', get_string('workshopfeatures', 'workshop'));
|
||||
|
||||
$label = get_string('useexamples', 'workshop');
|
||||
$text = get_string('useexamples_desc', 'workshop');
|
||||
$mform->addElement('checkbox', 'useexamples', $label, $text);
|
||||
$mform->addHelpButton('useexamples', 'useexamples', 'workshop');
|
||||
|
||||
$label = get_string('usepeerassessment', 'workshop');
|
||||
$text = get_string('usepeerassessment_desc', 'workshop');
|
||||
$mform->addElement('checkbox', 'usepeerassessment', $label, $text);
|
||||
$mform->addHelpButton('usepeerassessment', 'usepeerassessment', 'workshop');
|
||||
|
||||
$label = get_string('useselfassessment', 'workshop');
|
||||
$text = get_string('useselfassessment_desc', 'workshop');
|
||||
$mform->addElement('checkbox', 'useselfassessment', $label, $text);
|
||||
$mform->addHelpButton('useselfassessment', 'useselfassessment', 'workshop');
|
||||
|
||||
// Grading settings -----------------------------------------------------------
|
||||
$mform->addElement('header', 'gradingsettings', get_string('gradingsettings', 'workshop'));
|
||||
$mform->setExpanded('gradingsettings');
|
||||
|
||||
$label = get_string('strategy', 'workshop');
|
||||
$mform->addElement('select', 'strategy', $label, workshop::available_strategies_list());
|
||||
$mform->setDefault('strategy', $workshopconfig->strategy);
|
||||
$mform->addHelpButton('strategy', 'strategy', 'workshop');
|
||||
|
||||
$grades = workshop::available_maxgrades_list();
|
||||
$gradecategories = grade_get_categories_menu($this->course->id);
|
||||
@@ -118,18 +106,12 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('gradinggrade', $workshopconfig->gradinggrade);
|
||||
$mform->addHelpButton('gradinggradegroup', 'gradinggrade', 'workshop');
|
||||
|
||||
$label = get_string('strategy', 'workshop');
|
||||
$mform->addElement('select', 'strategy', $label, workshop::available_strategies_list());
|
||||
$mform->setDefault('strategy', $workshopconfig->strategy);
|
||||
$mform->addHelpButton('strategy', 'strategy', 'workshop');
|
||||
|
||||
$options = array();
|
||||
for ($i=5; $i>=0; $i--) {
|
||||
$options[$i] = $i;
|
||||
}
|
||||
$label = get_string('gradedecimals', 'workshop');
|
||||
$mform->addElement('select', 'gradedecimals', $label, $options);
|
||||
$mform->setAdvanced('gradedecimals');
|
||||
$mform->setDefault('gradedecimals', $workshopconfig->gradedecimals);
|
||||
|
||||
// Submission settings --------------------------------------------------------
|
||||
@@ -155,7 +137,6 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
$text = get_string('latesubmissions_desc', 'workshop');
|
||||
$mform->addElement('checkbox', 'latesubmissions', $label, $text);
|
||||
$mform->addHelpButton('latesubmissions', 'latesubmissions', 'workshop');
|
||||
$mform->setAdvanced('latesubmissions');
|
||||
|
||||
// Assessment settings --------------------------------------------------------
|
||||
$mform->addElement('header', 'assessmentsettings', get_string('assessmentsettings', 'workshop'));
|
||||
@@ -164,13 +145,20 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
$mform->addElement('editor', 'instructreviewerseditor', $label, null,
|
||||
workshop::instruction_editors_options($this->context));
|
||||
|
||||
$label = get_string('useselfassessment', 'workshop');
|
||||
$text = get_string('useselfassessment_desc', 'workshop');
|
||||
$mform->addElement('checkbox', 'useselfassessment', $label, $text);
|
||||
$mform->addHelpButton('useselfassessment', 'useselfassessment', 'workshop');
|
||||
|
||||
// Feedback -------------------------------------------------------------------
|
||||
$mform->addElement('header', 'feedbacksettings', get_string('feedbacksettings', 'workshop'));
|
||||
|
||||
$mform->addElement('select', 'overallfeedbackmode', get_string('overallfeedbackmode', 'mod_workshop'), array(
|
||||
0 => get_string('overallfeedbackmode_0', 'mod_workshop'),
|
||||
1 => get_string('overallfeedbackmode_1', 'mod_workshop'),
|
||||
2 => get_string('overallfeedbackmode_2', 'mod_workshop')));
|
||||
$mform->addHelpButton('overallfeedbackmode', 'overallfeedbackmode', 'mod_workshop');
|
||||
$mform->setDefault('overallfeedbackmode', 1);
|
||||
$mform->setAdvanced('overallfeedbackmode');
|
||||
|
||||
$options = array();
|
||||
for ($i = 7; $i >= 0; $i--) {
|
||||
@@ -178,55 +166,52 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
}
|
||||
$mform->addElement('select', 'overallfeedbackfiles', get_string('overallfeedbackfiles', 'workshop'), $options);
|
||||
$mform->setDefault('overallfeedbackfiles', 0);
|
||||
$mform->setAdvanced('overallfeedbackfiles');
|
||||
$mform->disabledIf('overallfeedbackfiles', 'overallfeedbackmode', 'eq', 0);
|
||||
|
||||
$options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes);
|
||||
$mform->addElement('select', 'overallfeedbackmaxbytes', get_string('overallfeedbackmaxbytes', 'workshop'), $options);
|
||||
$mform->setAdvanced('overallfeedbackmaxbytes');
|
||||
$mform->setDefault('overallfeedbackmaxbytes', $workshopconfig->maxbytes);
|
||||
$mform->disabledIf('overallfeedbackmaxbytes', 'overallfeedbackmode', 'eq', 0);
|
||||
$mform->disabledIf('overallfeedbackmaxbytes', 'overallfeedbackfiles', 'eq', 0);
|
||||
|
||||
$label = get_string('examplesmode', 'workshop');
|
||||
$options = workshop::available_example_modes_list();
|
||||
$mform->addElement('select', 'examplesmode', $label, $options);
|
||||
$mform->setDefault('examplesmode', $workshopconfig->examplesmode);
|
||||
$mform->disabledIf('examplesmode', 'useexamples');
|
||||
$mform->setAdvanced('examplesmode');
|
||||
|
||||
// Miscellaneous settings
|
||||
$mform->addElement('header', 'miscellaneoussettings', get_string('miscellaneoussettings', 'workshop'));
|
||||
|
||||
$label = get_string('conclusion', 'workshop');
|
||||
$mform->addElement('editor', 'conclusioneditor', $label, null,
|
||||
workshop::instruction_editors_options($this->context));
|
||||
$mform->addHelpButton('conclusioneditor', 'conclusion', 'workshop');
|
||||
|
||||
// Access control -------------------------------------------------------------
|
||||
$mform->addElement('header', 'accesscontrol', get_string('accesscontrol', 'workshop'));
|
||||
// Example submissions --------------------------------------------------------
|
||||
$mform->addElement('header', 'examplesubmissionssettings', get_string('examplesubmissions', 'workshop'));
|
||||
|
||||
$label = get_string('useexamples', 'workshop');
|
||||
$text = get_string('useexamples_desc', 'workshop');
|
||||
$mform->addElement('checkbox', 'useexamples', $label, $text);
|
||||
$mform->addHelpButton('useexamples', 'useexamples', 'workshop');
|
||||
|
||||
$label = get_string('examplesmode', 'workshop');
|
||||
$options = workshop::available_example_modes_list();
|
||||
$mform->addElement('select', 'examplesmode', $label, $options);
|
||||
$mform->setDefault('examplesmode', $workshopconfig->examplesmode);
|
||||
$mform->disabledIf('examplesmode', 'useexamples');
|
||||
|
||||
// Availability ---------------------------------------------------------------
|
||||
$mform->addElement('header', 'accesscontrol', get_string('availability', 'core'));
|
||||
|
||||
$label = get_string('submissionstart', 'workshop');
|
||||
$mform->addElement('date_time_selector', 'submissionstart', $label, array('optional' => true));
|
||||
$mform->setAdvanced('submissionstart');
|
||||
|
||||
$label = get_string('submissionend', 'workshop');
|
||||
$mform->addElement('date_time_selector', 'submissionend', $label, array('optional' => true));
|
||||
$mform->setAdvanced('submissionend');
|
||||
|
||||
$label = get_string('submissionendswitch', 'mod_workshop');
|
||||
$mform->addElement('checkbox', 'phaseswitchassessment', $label);
|
||||
$mform->setAdvanced('phaseswitchassessment');
|
||||
$mform->disabledIf('phaseswitchassessment', 'submissionend[enabled]');
|
||||
$mform->addHelpButton('phaseswitchassessment', 'submissionendswitch', 'mod_workshop');
|
||||
|
||||
$label = get_string('assessmentstart', 'workshop');
|
||||
$mform->addElement('date_time_selector', 'assessmentstart', $label, array('optional' => true));
|
||||
$mform->setAdvanced('assessmentstart');
|
||||
|
||||
$label = get_string('assessmentend', 'workshop');
|
||||
$mform->addElement('date_time_selector', 'assessmentend', $label, array('optional' => true));
|
||||
$mform->setAdvanced('assessmentend');
|
||||
|
||||
$coursecontext = context_course::instance($this->course->id);
|
||||
plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_workshop');
|
||||
|
||||
Reference in New Issue
Block a user