MDL-54838 workshop: Differentiate labels for each comment field.

In a Workshop activity, comment fields on Assessment forms do not properly link to the corresponding Aspect.
So screen reader users may find it difficult to complete the Assessment forms.
There should be a hidden label text for each comment field.
This commit is contained in:
An Pham Van 2016-07-25 15:06:23 +07:00
parent 90a8bdbfc0
commit d0207fdc06
11 changed files with 28 additions and 10 deletions

View File

@ -75,14 +75,14 @@ class workshop_accumulative_assessment_form extends workshop_assessment_form {
$mform->addElement('html', $desc);
// grade for this aspect
$label = get_string('dimensiongrade', 'workshopform_accumulative');
$label = get_string('dimensiongradefor', 'workshopform_accumulative', $dimtitle);
$options = make_grades_menu($fields->{'grade__idx_' . $i});
$options = array('-1' => get_string('choosedots')) + $options;
$mform->addElement('select', 'grade__idx_' . $i, $label, $options);
$mform->addRule(array('grade__idx_' . $i, 'minusone') , get_string('mustchoosegrade', 'workshopform_accumulative'), 'compare', 'gt');
// comment
$label = get_string('dimensioncomment', 'workshopform_accumulative');
$label = get_string('dimensioncommentfor', 'workshopform_accumulative', $dimtitle);
//$mform->addElement('editor', 'peercomment__idx_' . $i, $label, null, array('maxfiles' => 0));
$mform->addElement('textarea', 'peercomment__idx_' . $i, $label, array('cols' => 60, 'rows' => 5));
}

View File

@ -0,0 +1,2 @@
dimensioncomment,workshopform_accumulative
dimensiongrade,workshopform_accumulative

View File

@ -26,9 +26,9 @@
$string['absent'] = 'Absent';
$string['addmoredimensions'] = 'Blanks for {$a} more aspects';
$string['correct'] = 'Correct';
$string['dimensioncomment'] = 'Comment';
$string['dimensioncommentfor'] = 'Comment for {$a}';
$string['dimensiondescription'] = 'Description';
$string['dimensiongrade'] = 'Grade';
$string['dimensiongradefor'] = 'Grade for {$a}';
$string['dimensionmaxgrade'] = 'Best possible grade / Scale to use';
$string['dimensionnumber'] = 'Aspect {$a}';
$string['dimensionweight'] = 'Weight';
@ -47,3 +47,7 @@ $string['scalename4'] = 'Excellent/Very poor (4 point)';
$string['scalename5'] = 'Excellent/Very poor (5 point)';
$string['scalename6'] = 'Excellent/Very poor (7 point)';
$string['verypoor'] = 'Very poor';
// Deprecated since Moodle 3.1.
$string['dimensioncomment'] = 'Comment';
$string['dimensiongrade'] = 'Grade';

View File

@ -69,7 +69,7 @@ class workshop_comments_assessment_form extends workshop_assessment_form {
$mform->addElement('html', $desc);
// comment
$label = get_string('dimensioncomment', 'workshopform_comments');
$label = get_string('dimensioncommentfor', 'workshopform_comments', $dimtitle);
//$mform->addElement('editor', 'peercomment__idx_' . $i, $label, null, array('maxfiles' => 0));
$mform->addElement('textarea', 'peercomment__idx_' . $i, $label, array('cols' => 60, 'rows' => 10));
$mform->addRule('peercomment__idx_' . $i, null, 'required', null, 'client');

View File

@ -0,0 +1 @@
dimensioncomment,workshopform_comments

View File

@ -24,7 +24,10 @@
*/
$string['addmoredimensions'] = 'Blanks for {$a} more aspects';
$string['dimensioncomment'] = 'Comment';
$string['dimensioncommentfor'] = 'Comment for {$a}';
$string['dimensiondescription'] = 'Description';
$string['dimensionnumber'] = 'Aspect {$a}';
$string['pluginname'] = 'Comments';
// Deprecated since Moodle 3.1.
$string['dimensioncomment'] = 'Comment';

View File

@ -73,11 +73,11 @@ class workshop_numerrors_assessment_form extends workshop_assessment_form {
$mform->addGroup(array(
$mform->createElement('radio', 'grade__idx_' . $i, '', $fields->{'grade0__idx_'.$i}, -1),
$mform->createElement('radio', 'grade__idx_' . $i, '', $fields->{'grade1__idx_'.$i}, 1),
), 'group_grade__idx_' . $i, get_string('yourassessment', 'workshop'), '<br />', false);
), 'group_grade__idx_' . $i, get_string('yourassessmentfor', 'workshop', $dimtitle), '<br />', false);
$mform->addRule('group_grade__idx_' . $i, get_string('required'), 'required');
// comment
$label = get_string('dimensioncomment', 'workshopform_numerrors');
$label = get_string('dimensioncommentfor', 'workshopform_numerrors', $dimtitle);
$mform->addElement('textarea', 'peercomment__idx_' . $i, $label, array('cols' => 60, 'rows' => 5));
}
$this->set_data($current);

View File

@ -0,0 +1 @@
dimensioncomment,workshopform_numerrors

View File

@ -26,7 +26,7 @@
$string['addmoredimensions'] = 'Blanks for {$a} more assertions';
$string['configgrade0'] = 'The default word describing the negative assessment of an assertion.';
$string['configgrade1'] = 'The default word describing the positive assessment of an assertion.';
$string['dimensioncomment'] = 'Comment';
$string['dimensioncommentfor'] = 'Comment for {$a}';
$string['dimensiondescription'] = 'Description';
$string['dimensiongrade'] = 'Grade';
$string['dimensionnumber'] = 'Assertion {$a}';
@ -40,3 +40,6 @@ $string['maperror'] = 'Weighted number of errors is less than or equals';
$string['mapgrade'] = 'Grade for submission';
$string['percents'] = '{$a} %';
$string['pluginname'] = 'Number of errors';
// Deprecated since Moodle 3.1.
$string['dimensioncomment'] = 'Comment';

View File

@ -0,0 +1 @@
yourassessment,mod_workshop

View File

@ -347,6 +347,9 @@ $string['workshop:viewauthornames'] = 'View author names';
$string['workshop:viewauthorpublished'] = 'View authors of published submissions';
$string['workshop:viewpublishedsubmissions'] = 'View published submissions';
$string['workshop:viewreviewernames'] = 'View reviewer names';
$string['yourassessment'] = 'Your assessment';
$string['yourassessmentfor'] = 'Your assessment for {$a}';
$string['yourgrades'] = 'Your grades';
$string['yoursubmission'] = 'Your submission';
// Deprecated since Moodle 3.1.
$string['yourassessment'] = 'Your assessment';