adds in aria attributes and semantic status content for choicegroup problems

This commit is contained in:
Brian Talbot
2013-06-07 11:23:50 -04:00
committed by Giulio Gratta
parent 832e05341b
commit a84dab0feb

View File

@@ -3,7 +3,7 @@
% if input_type == 'checkbox' or not value:
% if status == 'unsubmitted' or show_correctness == 'never':
<span class="unanswered" style="display:inline-block;" id="status_${id}"></span>
% elif status == 'correct':
% elif status == 'correct':
<span class="correct" id="status_${id}"></span>
% elif status == 'incorrect':
<span class="incorrect" id="status_${id}"></span>
@@ -18,7 +18,7 @@
% for choice_id, choice_description in choices:
<label for="input_${id}_${choice_id}"
% if input_type == 'radio' and ( (isinstance(value, basestring) and (choice_id == value)) or (not isinstance(value, basestring) and choice_id in value) ):
<%
<%
if status == 'correct':
correctness = 'correct'
elif status == 'incorrect':
@@ -28,12 +28,13 @@
%>
% if correctness and not show_correctness=='never':
class="choicegroup_${correctness}"
<span class="sr" aria-describedby="input_${id}_${choice_id}">Status: ${correctness}</span>
% endif
% endif
>
<input type="${input_type}" name="input_${id}${name_array_suffix}" id="input_${id}_${choice_id}" value="${choice_id}"
<input type="${input_type}" name="input_${id}${name_array_suffix}" id="input_${id}_${choice_id}" aria-describedby="answer_${id}" value="${choice_id}"
% if input_type == 'radio' and ( (isinstance(value, basestring) and (choice_id == value)) or (not isinstance(value, basestring) and choice_id in value) ):
checked="true"
checked="true"
% elif input_type != 'radio' and choice_id in value:
checked="true"
% endif