{% extends 'TopxiaWebBundle:CourseLessonManage:homework-layout.html.twig' %}

{% block homework_heading_content %}

      <div class="testpaper-titlebar clearfix">
        <h1 class="testpaper-title">{{course.title}} <br><small class="text-sm"></small></h1>

      </div>

        <div class="testpaper-description">{{course.title}}<span style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-weight:bold;background-color:#FFFFFF;">作业说明</span>
        </div>

		  <div class="testpaper-metas">
			{{ homework.description }}
		  </div>

	  <div id="testpaper-navbar" class="testpaper-navbar affix-top" data-spy="affix" data-offset-top="200">
	    <ul class="nav nav navbar-nav nav-pills">
		    {% for type in types %}

		      <li><a href="#homework-questions-{{type}}">{{dict('questionType')[type]}}</a></li>

			{% endfor %}
	      </ul>
	</div>
{% endblock %}

{% block homework_body_content %}

<div class="row">
  <div class="col-md-9">
    <div class="testpaper-body">
    {% if not role|default(null) == 'teacher' %}

		{% set materialFlag = 0 %}
		{% set single_choice_questions  = questions['single_choice']|default(null) %}
		{% set choice_questions  = questions['choice']|default(null) %}
		{% set uncertain_choice  = questions['uncertain_choice']|default(null) %}
		{% set fill_questions  = questions['fill']|default(null) %}
		{% set determine_questions  = questions['determine']|default(null) %}
		{% set essay_questions  = questions['essay']|default(null) %}
		{% set material_questions  = questions['material']|default(null) %}


		{% for type,question in questions %}

		{# {% include 'TopxiaWebBundle:CourseLessonManage:homework-question-'~type~'.html.twig' %} #}
			{% if type in ['single_choice', 'choice', 'uncertain_choice'] %}
						
					{% include 'TopxiaWebBundle:CourseLessonManage:homework-question-single_choice.html.twig' %}

					  {% elseif type == 'fill' %} 
					  		{% include 'TopxiaWebBundle:CourseLessonManage:homework-question-fill.html.twig' %}
					  {% elseif  type == 'determine'  %}
					    	{% include 'TopxiaWebBundle:CourseLessonManage:homework-question-determine.html.twig' %}
					  {% elseif  type == 'essay'  %} 
						  {% for subQuestion in question %} 	
						    {% include 'TopxiaWebBundle:CourseLessonManage:homework-question-essay.html.twig' %}
						     {% endfor %}
					  {% elseif  type == 'material'  %}  	

					      {% include 'TopxiaWebBundle:CourseLessonManage:homework-question-material.html.twig' %}
				      
			{% endif %}

		{% endfor %}

    {% endif %}

    </div>
  </div>

{% include 'TopxiaWebBundle:CourseLessonManage:homework-question-card.html.twig' %}


</div>


{% endblock %}
