<form class="choicegroup capa_inputtype" id="inputtype_${id}">
    <div class="indicator_container">
    % if input_type == 'checkbox' or not value:
        <span class="status ${status_class if show_correctness != 'never' else 'unanswered'}"
            id="status_${id}"
            aria-describedby="inputtype_${id}">
            <span class="sr">
                %for choice_id, choice_description in choices:
                % if choice_id in value:
                    ${choice_description}, 
                %endif
                %endfor
                -
                ${status_display}
            </span>
        </span>
    % endif
    </div>

    <fieldset role="${input_type}group" aria-label="${label}">

        % for choice_id, choice_description in choices:
        <label for="input_${id}_${choice_id}"
            ## If the student has selected this choice...
            % 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':
                    correctness = 'incorrect'
                else:
                    correctness = None
            %>
            % if correctness and not show_correctness=='never':
            class="choicegroup_${correctness}"
            % endif
            % endif
            >
            <input type="${input_type}" name="input_${id}${name_array_suffix}" id="input_${id}_${choice_id}" aria-role="radio" aria-describedby="answer_${id}" value="${choice_id}"
            ## If the student selected this choice...
            % if input_type == 'radio' and ( (isinstance(value, basestring) and (choice_id == value))  or  (not isinstance(value, basestring) and choice_id in value) ):
            checked="true"
            % elif input_type != 'radio' and choice_id in value:
            checked="true"
            % endif
            % if input_type != 'radio':
            aria-multiselectable="true"
            % endif

            /> ${choice_description}

            % if input_type == 'radio' and ( (isinstance(value, basestring) and (choice_id == value))  or  (not isinstance(value, basestring) and choice_id in value) ):
            % if status in ('correct', 'incorrect') and not show_correctness=='never':
            <span class="sr status">${choice_description|h} - ${status_display}</span>
            % endif
            % endif
        </label>
        % endfor
        <span id="answer_${id}"></span>
    </fieldset>

    % if show_correctness == "never" and (value or status not in ['unsubmitted']):
    <div class="capa_alert">${submitted_message}</div>
    %endif
</form>
