<% doinline = "inline" if inline else "" %>

<div id="inputtype_${id}" class="${'text-input-dynamath' if do_math else ''} capa_inputtype ${doinline} textline" >

    % if preprocessor is not None:
    <div class="text-input-dynamath_data ${doinline}" data-preprocessor="${preprocessor['class_name']}"/>
    <div class="script_placeholder" data-src="${preprocessor['script_src']}"/>
    % endif

    % if status in ('unsubmitted', 'correct', 'incorrect', 'incomplete'):
    <div class="${status_class} ${doinline}" id="status_${id}">
    % endif
    % if hidden:
      <div style="display:none;" name="${hidden}" inputid="input_${id}" />
    % endif

  <input type="text" name="input_${id}" id="input_${id}" aria-label="${label}" aria-describedby="answer_${id}" value="${value|h}"
        % if do_math:
            class="math"
        % endif
        % if size:
            size="${size}"
        % endif
        % if hidden:
            style="display:none;"
        % endif
   />
   ${trailing_text | h}

      <p class="status" 
         %if status != 'unsubmitted':
         aria-hidden="true"
         %endif
         aria-describedby="input_${id}">
        %if value:
        ${value|h}
        % else:
        ${label}
        %endif
        -
        ${status_display}
      </p>

      <p id="answer_${id}" class="answer" aria-hidden="true"></p>

      % if do_math:
      <div id="display_${id}" class="equation">`{::}`</div>
      <textarea style="display:none" id="input_${id}_dynamath" name="input_${id}_dynamath"></textarea>

      % endif

% if status in ('unsubmitted', 'correct', 'incorrect', 'incomplete'):
</div>
% endif

  % if msg:
      <span class="message">${msg|n}</span>
  % endif

</div>
