Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40505

Inaccessible matching questions: definition of the problem + solution

XMLWordPrintable

    • MOODLE_23_STABLE

      NB: All of the tracker issues, posted by 'accessible_for_vip', are based on the theme 'Accessible for VIP' (https://moodle.org/plugins/view.php?plugin=theme_accessible_for_vip) which is developed for people who are blind or have a low vision. All of the (code)solutions are based on the files which belong to this specific theme and are only usable with this theme at this moment (but it is also possible to include the solution in general source code).

      The matching questions were not accessible for two reasons:
      1. The number of the sub question was not always clear.
      2. When you are in the combobox behind a sub question, there was no clearness about the question (no repetition of the question by activating the combobox with answers).
      For both problems is a solution that is shown below.

      To create clarity about the number of the sub question that you are in, we added a accesshide text that give clarity about the number of that sub question (theme/accessible_for_vip/lang/en/theme_accessible_for_vip.php):

      $string['subquestion-x'] = '<span class="accesshide">Subquestion {$a}</span>';
      

      To make the combobox with answers more accessible so that there is a repetition of the sub question by activating the combobox, we added an aria-labelledby attribute with a reference to the id of that sub question (theme/accessible_for_vip/renderers.php):

      class theme_accessible_for_vip_qtype_match_renderer extends qtype_match_renderer {
      	public function formulation_and_controls(question_attempt $qa,
      		question_display_options $options) {
      		......
      		
      			$result .= html_writer::tag('td', get_string('subquestion-x', 'theme_accessible_for_vip', $i) . $question->format_text(
      				$question->stems[$stemid], $question->stemformat[$stemid],
      				$qa, 'qtype_match', 'subquestion', $stemid),
      				array('class' => 'text', 'id' => 'subquestion' . $i));
      				
      			......
      			
      			html_writer::select($choices, $qa->get_qt_field_name('sub' . $key), $selected,
      				array('0' => 'choose'), array('disabled' => $options->readonly, 'aria-labelledby' => 'subquestion' . $i))
      			
      			......
      	}
      }
      

            Unassigned Unassigned
            accessible_for_vip Larissa Klaassen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.