Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34559 accessibility compliance for grade: Add forform input text …

…and select tag
  • Loading branch information...
commit 0c12ac81eeb0e1f98b33b37b4a3e955bcf36bbe6 1 parent f2ddce9
rwijaya rwijaya authored
1  grade/edit/tree/calculation.php
View
@@ -177,6 +177,7 @@ function get_grade_tree(&$gtree, $element, $current_itemid=null, $errors=null) {
$name .= '<div class="error"><span class="error">' . $errors[$grade_item->id].'</span><br />'."\n";
$closingdiv = "</div>\n";
}
+ $name .= '<label class="accesshide" for="id_idnumber_' . $grade_item->id . '">' . get_string('gradeitems', 'grades') .'</label>';
$name .= '<input class="idnumber" id="id_idnumber_'.$grade_item->id.'" type="text" name="idnumbers['.$grade_item->id.']" />' . "\n";
$name .= $closingdiv;
}
2  grade/edit/tree/index.php
View
@@ -343,8 +343,8 @@
if (!$moving && count($grade_edit_tree->categories) > 1) {
echo '<br /><br />';
echo '<input type="hidden" name="bulkmove" value="0" id="bulkmoveinput" />';
- echo get_string('moveselectedto', 'grades') . ' ';
$attributes = array('id'=>'menumoveafter');
+ echo html_writer::label(get_string('moveselectedto', 'grades'), 'menumoveafter', false, array('class' => 'accesshide'));
echo html_writer::select($grade_edit_tree->categories, 'moveafter', '', array(''=>'choosedots'), $attributes);
$OUTPUT->add_action_handler(new component_action('change', 'submit_bulk_move'), 'menumoveafter');
echo '<div id="noscriptgradetreeform" class="hiddenifjs">
3  grade/edit/tree/lib.php
View
@@ -666,7 +666,8 @@ public function get_category_cell($category, $levelclass, $params) {
} else {
$attributes = array();
$attributes['id'] = 'aggregation_'.$category->id;
- $aggregation = html_writer::select($options, 'aggregation_'.$category->id, $category->aggregation, null, $attributes);
+ $aggregation = html_writer::label(get_string('aggregation', 'grades'), 'aggregation_'.$category->id, false, array('class' => 'accesshide'));
+ $aggregation .= html_writer::select($options, 'aggregation_'.$category->id, $category->aggregation, null, $attributes);
$action = new component_action('change', 'update_category_aggregation', array('courseid' => $params['id'], 'category' => $category->id, 'sesskey' => sesskey()));
$OUTPUT->add_action_handler($action, 'aggregation_'.$category->id);
}
7 grade/grading/form/rubric/renderer.php
View
@@ -164,7 +164,8 @@ public function level_template($mode, $options, $elementname = '{NAME}', $criter
$leveltemplate .= html_writer::start_tag('div', array('class' => 'level-wrapper'));
if ($mode == gradingform_rubric_controller::DISPLAY_EDIT_FULL) {
$definition = html_writer::tag('textarea', htmlspecialchars($level['definition']), array('name' => '{NAME}[criteria][{CRITERION-id}][levels][{LEVEL-id}][definition]', 'cols' => '10', 'rows' => '4'));
- $score = html_writer::empty_tag('input', array('type' => 'text', 'name' => '{NAME}[criteria][{CRITERION-id}][levels][{LEVEL-id}][score]', 'size' => '3', 'value' => $level['score']));
+ $score = html_writer::label(get_string('criterionempty', 'gradingform_rubric'), '{NAME}criteria{CRITERION-id}levels{LEVEL-id}', false, array('class' => 'accesshide'));
+ $score .= html_writer::empty_tag('input', array('type' => 'text','id' => '{NAME}criteria{CRITERION-id}levels{LEVEL-id}', 'name' => '{NAME}[criteria][{CRITERION-id}][levels][{LEVEL-id}][score]', 'size' => '3', 'value' => $level['score']));
} else {
if ($mode == gradingform_rubric_controller::DISPLAY_EDIT_FROZEN) {
$leveltemplate .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => '{NAME}[criteria][{CRITERION-id}][levels][{LEVEL-id}][definition]', 'value' => $level['definition']));
@@ -290,7 +291,7 @@ protected function rubric_edit_options($mode, $options) {
switch ($option) {
case 'sortlevelsasc':
// Display option as dropdown
- $html .= html_writer::tag('span', get_string($option, 'gradingform_rubric'), array('class' => 'label'));
+ $html .= html_writer::label(get_string($option, 'gradingform_rubric'), $attrs['id'], false, array('class' => 'label'));
$value = (int)(!!$value); // make sure $value is either 0 or 1
if ($mode == gradingform_rubric_controller::DISPLAY_EDIT_FULL) {
$selectoptions = array(0 => get_string($option.'0', 'gradingform_rubric'), 1 => get_string($option.'1', 'gradingform_rubric'));
@@ -448,7 +449,7 @@ public function display_instance(gradingform_rubric_instance $instance, $idx, $c
public function display_regrade_confirmation($elementname, $changelevel, $value) {
$html = html_writer::start_tag('div', array('class' => 'gradingform_rubric-regrade'));
if ($changelevel<=2) {
- $html .= get_string('regrademessage1', 'gradingform_rubric');
+ $html .= html_writer::label(get_string('regrademessage1', 'gradingform_rubric'), 'menu' . $elementname . 'regrade');
$selectoptions = array(
0 => get_string('regradeoption0', 'gradingform_rubric'),
1 => get_string('regradeoption1', 'gradingform_rubric')
2  grade/lib.php
View
@@ -380,7 +380,7 @@ function print_grade_plugin_selector($plugin_info, $active_type, $active_plugin,
// finally print/return the popup form
if ($count > 1) {
$select = new url_select($menu, $active, null, 'choosepluginreport');
-
+ $select->set_label(get_string('gradereport', 'grades'), array('class' => 'accesshide'));
if ($return) {
return $OUTPUT->render($select);
} else {
3  grade/report/grader/lib.php
View
@@ -951,7 +951,8 @@ public function get_right_rows() {
}
$itemcell->text .= '<input type="hidden" id="oldgrade_'.$userid.'_'.$item->id.'" name="oldgrade_'.$userid.'_'.$item->id.'" value="'.$oldval.'"/>';
$attributes = array('tabindex' => $tabindices[$item->id]['grade'], 'id'=>'grade_'.$userid.'_'.$item->id);
- $itemcell->text .= html_writer::select($scaleopt, 'grade_'.$userid.'_'.$item->id, $gradeval, array(-1=>$nogradestr), $attributes);;
+ $itemcell->text .= html_writer::label(get_string('typescale', 'grades'), $attributes['id'], false, array('class' => 'accesshide'));
+ $itemcell->text .= html_writer::select($scaleopt, 'grade_'.$userid.'_'.$item->id, $gradeval, array(-1=>$nogradestr), $attributes);
} elseif(!empty($scale)) {
$scales = explode(",", $scale->scale);
Please sign in to comment.
Something went wrong with that request. Please try again.