<div class="testpaper-question testpaper-question-choice  js-testpaper-question {% if setting('magic.testpaper_watermark') %}js-testpaper-watermark{% endif %}" data-watermark-url="{{ path('cloud_testpaper_watermark') }}" id="question{{ question.id }}">
	{% set keys = [] %}
	{% set keys_answer = [] %}
	<div class="testpaper-question-body">
    {% include 'question/part/question-stem.html.twig' %}

		<ul class="testpaper-question-choices js-testpaper-question-list">
			{% for key, choice in question.metas.choices|default() %}
			  {% set itemClass =  ((paperResult.status|default(null) in ['reviewing', 'finished']) and (key in question.answer)) ? 'testpaper-question-choice-right' : '' %}
			  {% set choiceIndex = (65+key)|chr %}

				<li class="{{ itemClass }}"><span class="testpaper-question-choice-index">{{ choiceIndex }}.</span> {{ choice|bbCode2Html|raw }}</li>
				{% if key in question.answer %}
					{% set keys = keys|merge([choiceIndex]) %}
				{% endif  %}
				{% if key in question.testResult.answer|default([]) %}
					{% set keys_answer = keys_answer|merge([choiceIndex]) %}
				{% endif %}
			{% endfor %}
		</ul>
	</div>
	{% if (paperResult.status|default(null) in ['reviewing', 'finished'] and setting('questions.testpaper_answers_show_mode','submitted') == 'submitted') or (setting('questions.testpaper_answers_show_mode','submitted') == 'reviewed'  and paperResult.status|default(null) == 'finished') %}
		<div class="testpaper-question-footer clearfix">
		  <div class="testpaper-question-result">
		  	{{'正确答案是'|trans}} <strong class="color-success">{{ keys|join(',') }}</strong>，
				{% if question.testResult.status|default('noAnswer') == 'right' %}
					{{'回答正确'|trans}}
				{% elseif question.testResult.status|default('noAnswer') == 'partRight' %}
					{{'你的答案是'|trans}} <strong class="color-danger">{{ keys_answer|join(',') }}</strong>
					{{'。回答部分正确。'|trans}}
					{% if showScore|default(1) %}
						{{'得分：%testResult.score%分'|trans({'%testResult.score%': question.testResult.score})}}
					{% endif %}
				{% elseif question.testResult.status|default('noAnswer') == 'wrong' %}
				{{'你的答案是'|trans}} <strong class="color-danger">{{ keys_answer|join(',') }}</strong>。{{'你答错了'|trans}}
				{% elseif question.testResult.status|default('noAnswer') == 'noAnswer' %}
				  {{'你未答题'|trans}}
				{% endif %}
		  </div>

			<div class="testpaper-question-actions pull-right mts">
				{% include 'question/part/flag.html.twig' with { flags:['favorite', 'analysis'] } %}
			</div>
		</div>
		{% include 'question/part/show-analysis.html.twig' with {showAnalysis:1} %}

	{% else %}
		<div class="testpaper-question-footer clearfix">

		  <div class="testpaper-question-choice-inputs js-testpaper-question-label">
				{% for key, choice in question.metas.choices|default() %}
					{% set choiceIndex = (65+key)|chr %}

					<label class="{% if question.type == 'single_choice' %}radio{% else %}checkbox{% endif %}-inline {% if choiceIndex in keys_answer %}active{% endif %}">
						<input type="{% if question.type == 'single_choice' %}radio{% else %}checkbox{% endif %}" data-type="{{ question.type }}" name="{{ question.id }}" value="{{ key }}" {% if choiceIndex in keys_answer %}checked{% endif %} >
						{{ choiceIndex }}
					</label>
				{% endfor %}
		  </div>

		  <div class="testpaper-question-actions pull-right mts">
				{% include 'question/part/flag.html.twig' with { flags:['mark', 'favorite'],resultStatus:paperResult.status|default(null) } %}
		  </div>
		</div>

		{% if showAnswer|default(0) %}
			<div class="testpaper-preview-answer clearfix mtl mbl">
				<div class="testpaper-question-result">
				{{'正确答案是'|trans}} <strong class="color-success">{{ keys|join(',') }}</strong>
				</div>
			</div>
		{% endif %}
	{% endif %}

	{% include 'question/part/show-analysis.html.twig' with {showAnalysis:showAnalysis|default(0)} %}
</div>