<form class="choicegroup capa_inputtype" id="inputtype_${id}">
    <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 == 'partially-correct':
                    correctness = 'partially-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', 'partially-correct', 'incorrect') and not show_correctness=='never':
            <span class="sr status">${choice_description|h} - ${status.display_name}</span>
            % endif
            % endif
        </label>
        % endfor
        <span id="answer_${id}"></span>
    </fieldset>
    <div class="indicator-container">
        % if input_type == 'checkbox' or not value:
            <span class="status ${status.classname if show_correctness != 'never' else 'unanswered'}" id="status_${id}" aria-describedby="inputtype_${id}" data-tooltip="${status.display_tooltip}">
                <span class="sr">
                    %for choice_id, choice_description in choices:
                        % if choice_id in value:
                            ${choice_description}, 
                        %endif
                    %endfor
                    -
                    ${status.display_name}
                </span>
            </span>
        % endif
    </div>
    % if show_correctness == "never" and (value or status not in ['unsubmitted']):
    <div class="capa_alert">${submitted_message}</div>
    %endif
    % if msg:
    <span class="message">${msg|n}</span>
    % endif
</form>