MDL-38603 Reorganise Workshop settings form

Example submissions settings moved into a dedicated section.
Self-assessment setting moved to the assessment section. There is no
need for the dedicated Workshop features section any more. All Workshop
feedback settings moved into a dedicated section.

Reorganised grading settings - the grading strategy put into the top
place as it is the essential setting. All other three settings are
related to calculating actual grades.

No advanced setting fields in the Workshop form. Mixing collapsible
sections with advanced fields (that are not even marked as "advanced"
any more) does not work well.

AMOS BEGIN
 CPY [feedback,mod_assign],[feedbacksettings,mod_workshop]
AMOS END
This commit is contained in:
David Mudrák 2013-04-17 11:34:55 +02:00
parent d34ea7dc33
commit 9e31e23d60
2 changed files with 33 additions and 45 deletions

View file

@ -24,7 +24,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
$string['accesscontrol'] = 'Access control';
$string['aggregategrades'] = 'Re-calculate grades'; $string['aggregategrades'] = 'Re-calculate grades';
$string['aggregation'] = 'Grades aggregation'; $string['aggregation'] = 'Grades aggregation';
$string['allocate'] = 'Allocate submissions'; $string['allocate'] = 'Allocate submissions';
@ -129,6 +128,7 @@ $string['feedbackauthor'] = 'Feedback for the author';
$string['feedbackauthorattachment'] = 'Attachment'; $string['feedbackauthorattachment'] = 'Attachment';
$string['feedbackby'] = 'Feedback by {$a}'; $string['feedbackby'] = 'Feedback by {$a}';
$string['feedbackreviewer'] = 'Feedback for the reviewer'; $string['feedbackreviewer'] = 'Feedback for the reviewer';
$string['feedbacksettings'] = 'Feedback';
$string['formataggregatedgrade'] = '{$a->grade}'; $string['formataggregatedgrade'] = '{$a->grade}';
$string['formataggregatedgradeover'] = '<del>{$a->grade}</del><br /><ins>{$a->over}</ins>'; $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>'; $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_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['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['latesubmissionsallowed'] = 'Late submissions are allowed';
$string['maxbytes'] = 'Maximum file size'; $string['maxbytes'] = 'Maximum submission attachment size';
$string['miscellaneoussettings'] = 'Miscellaneous settings';
$string['modulename'] = 'Workshop'; $string['modulename'] = 'Workshop';
$string['modulename_help'] = 'The workshop activity module enables the collection, review and peer assessment of students\' work. $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['nullgrade'] = '-';
$string['overallfeedback'] = 'Overall feedback'; $string['overallfeedback'] = 'Overall feedback';
$string['overallfeedbackfiles'] = 'Maximum number of overall feedback attachments'; $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'] = 'Overall feedback mode';
$string['overallfeedbackmode_0'] = 'Disabled'; $string['overallfeedbackmode_0'] = 'Disabled';
$string['overallfeedbackmode_1'] = 'Enabled and optional'; $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:addinstance'] = 'Add a new workshop';
$string['workshop:allocate'] = 'Allocate submissions for review'; $string['workshop:allocate'] = 'Allocate submissions for review';
$string['workshop:editdimensions'] = 'Edit assessment forms'; $string['workshop:editdimensions'] = 'Edit assessment forms';
$string['workshopfeatures'] = 'Workshop features';
$string['workshop:ignoredeadlines'] = 'Ignore time restrictions'; $string['workshop:ignoredeadlines'] = 'Ignore time restrictions';
$string['workshop:manageexamples'] = 'Manage example submissions'; $string['workshop:manageexamples'] = 'Manage example submissions';
$string['workshopname'] = 'Workshop name'; $string['workshopname'] = 'Workshop name';

View file

@ -78,21 +78,14 @@ class mod_workshop_mod_form extends moodleform_mod {
// Introduction // Introduction
$this->add_intro_editor(false, get_string('introduction', 'workshop')); $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('useselfassessment', 'workshop');
$text = get_string('useselfassessment_desc', 'workshop');
$mform->addElement('checkbox', 'useselfassessment', $label, $text);
$mform->addHelpButton('useselfassessment', 'useselfassessment', 'workshop');
// Grading settings ----------------------------------------------------------- // Grading settings -----------------------------------------------------------
$mform->addElement('header', 'gradingsettings', get_string('gradingsettings', 'workshop')); $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(); $grades = workshop::available_maxgrades_list();
$gradecategories = grade_get_categories_menu($this->course->id); $gradecategories = grade_get_categories_menu($this->course->id);
@ -113,18 +106,12 @@ class mod_workshop_mod_form extends moodleform_mod {
$mform->setDefault('gradinggrade', $workshopconfig->gradinggrade); $mform->setDefault('gradinggrade', $workshopconfig->gradinggrade);
$mform->addHelpButton('gradinggradegroup', 'gradinggrade', 'workshop'); $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(); $options = array();
for ($i=5; $i>=0; $i--) { for ($i=5; $i>=0; $i--) {
$options[$i] = $i; $options[$i] = $i;
} }
$label = get_string('gradedecimals', 'workshop'); $label = get_string('gradedecimals', 'workshop');
$mform->addElement('select', 'gradedecimals', $label, $options); $mform->addElement('select', 'gradedecimals', $label, $options);
$mform->setAdvanced('gradedecimals');
$mform->setDefault('gradedecimals', $workshopconfig->gradedecimals); $mform->setDefault('gradedecimals', $workshopconfig->gradedecimals);
// Submission settings -------------------------------------------------------- // Submission settings --------------------------------------------------------
@ -150,7 +137,6 @@ class mod_workshop_mod_form extends moodleform_mod {
$text = get_string('latesubmissions_desc', 'workshop'); $text = get_string('latesubmissions_desc', 'workshop');
$mform->addElement('checkbox', 'latesubmissions', $label, $text); $mform->addElement('checkbox', 'latesubmissions', $label, $text);
$mform->addHelpButton('latesubmissions', 'latesubmissions', 'workshop'); $mform->addHelpButton('latesubmissions', 'latesubmissions', 'workshop');
$mform->setAdvanced('latesubmissions');
// Assessment settings -------------------------------------------------------- // Assessment settings --------------------------------------------------------
$mform->addElement('header', 'assessmentsettings', get_string('assessmentsettings', 'workshop')); $mform->addElement('header', 'assessmentsettings', get_string('assessmentsettings', 'workshop'));
@ -159,13 +145,20 @@ class mod_workshop_mod_form extends moodleform_mod {
$mform->addElement('editor', 'instructreviewerseditor', $label, null, $mform->addElement('editor', 'instructreviewerseditor', $label, null,
workshop::instruction_editors_options($this->context)); 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( $mform->addElement('select', 'overallfeedbackmode', get_string('overallfeedbackmode', 'mod_workshop'), array(
0 => get_string('overallfeedbackmode_0', 'mod_workshop'), 0 => get_string('overallfeedbackmode_0', 'mod_workshop'),
1 => get_string('overallfeedbackmode_1', 'mod_workshop'), 1 => get_string('overallfeedbackmode_1', 'mod_workshop'),
2 => get_string('overallfeedbackmode_2', 'mod_workshop'))); 2 => get_string('overallfeedbackmode_2', 'mod_workshop')));
$mform->addHelpButton('overallfeedbackmode', 'overallfeedbackmode', 'mod_workshop'); $mform->addHelpButton('overallfeedbackmode', 'overallfeedbackmode', 'mod_workshop');
$mform->setDefault('overallfeedbackmode', 1); $mform->setDefault('overallfeedbackmode', 1);
$mform->setAdvanced('overallfeedbackmode');
$options = array(); $options = array();
for ($i = 7; $i >= 0; $i--) { for ($i = 7; $i >= 0; $i--) {
@ -173,55 +166,52 @@ class mod_workshop_mod_form extends moodleform_mod {
} }
$mform->addElement('select', 'overallfeedbackfiles', get_string('overallfeedbackfiles', 'workshop'), $options); $mform->addElement('select', 'overallfeedbackfiles', get_string('overallfeedbackfiles', 'workshop'), $options);
$mform->setDefault('overallfeedbackfiles', 0); $mform->setDefault('overallfeedbackfiles', 0);
$mform->setAdvanced('overallfeedbackfiles');
$mform->disabledIf('overallfeedbackfiles', 'overallfeedbackmode', 'eq', 0); $mform->disabledIf('overallfeedbackfiles', 'overallfeedbackmode', 'eq', 0);
$options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes); $options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes);
$mform->addElement('select', 'overallfeedbackmaxbytes', get_string('overallfeedbackmaxbytes', 'workshop'), $options); $mform->addElement('select', 'overallfeedbackmaxbytes', get_string('overallfeedbackmaxbytes', 'workshop'), $options);
$mform->setAdvanced('overallfeedbackmaxbytes');
$mform->setDefault('overallfeedbackmaxbytes', $workshopconfig->maxbytes); $mform->setDefault('overallfeedbackmaxbytes', $workshopconfig->maxbytes);
$mform->disabledIf('overallfeedbackmaxbytes', 'overallfeedbackmode', 'eq', 0); $mform->disabledIf('overallfeedbackmaxbytes', 'overallfeedbackmode', 'eq', 0);
$mform->disabledIf('overallfeedbackmaxbytes', 'overallfeedbackfiles', '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'); $label = get_string('conclusion', 'workshop');
$mform->addElement('editor', 'conclusioneditor', $label, null, $mform->addElement('editor', 'conclusioneditor', $label, null,
workshop::instruction_editors_options($this->context)); workshop::instruction_editors_options($this->context));
$mform->addHelpButton('conclusioneditor', 'conclusion', 'workshop'); $mform->addHelpButton('conclusioneditor', 'conclusion', 'workshop');
// Access control ------------------------------------------------------------- // Example submissions --------------------------------------------------------
$mform->addElement('header', 'accesscontrol', get_string('accesscontrol', 'workshop')); $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'); $label = get_string('submissionstart', 'workshop');
$mform->addElement('date_time_selector', 'submissionstart', $label, array('optional' => true)); $mform->addElement('date_time_selector', 'submissionstart', $label, array('optional' => true));
$mform->setAdvanced('submissionstart');
$label = get_string('submissionend', 'workshop'); $label = get_string('submissionend', 'workshop');
$mform->addElement('date_time_selector', 'submissionend', $label, array('optional' => true)); $mform->addElement('date_time_selector', 'submissionend', $label, array('optional' => true));
$mform->setAdvanced('submissionend');
$label = get_string('submissionendswitch', 'mod_workshop'); $label = get_string('submissionendswitch', 'mod_workshop');
$mform->addElement('checkbox', 'phaseswitchassessment', $label); $mform->addElement('checkbox', 'phaseswitchassessment', $label);
$mform->setAdvanced('phaseswitchassessment');
$mform->disabledIf('phaseswitchassessment', 'submissionend[enabled]'); $mform->disabledIf('phaseswitchassessment', 'submissionend[enabled]');
$mform->addHelpButton('phaseswitchassessment', 'submissionendswitch', 'mod_workshop'); $mform->addHelpButton('phaseswitchassessment', 'submissionendswitch', 'mod_workshop');
$label = get_string('assessmentstart', 'workshop'); $label = get_string('assessmentstart', 'workshop');
$mform->addElement('date_time_selector', 'assessmentstart', $label, array('optional' => true)); $mform->addElement('date_time_selector', 'assessmentstart', $label, array('optional' => true));
$mform->setAdvanced('assessmentstart');
$label = get_string('assessmentend', 'workshop'); $label = get_string('assessmentend', 'workshop');
$mform->addElement('date_time_selector', 'assessmentend', $label, array('optional' => true)); $mform->addElement('date_time_selector', 'assessmentend', $label, array('optional' => true));
$mform->setAdvanced('assessmentend');
$coursecontext = context_course::instance($this->course->id); $coursecontext = context_course::instance($this->course->id);
plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_workshop'); plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_workshop');