{% extends "base.html" %}
{% load i18n %}
{% load display_functions %}
{% block extra_scripts %}
	<script type="text/javascript" src="{{ STATIC_URL }}oppia/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="{{ STATIC_URL }}oppia/js/jquery-ui-1.10.3.custom.min.js"></script>
	<script type="text/javascript">
		function init(){
			$('div[name=attemptlist]').each(function(i){
				$('#detail'+$(this).attr('id')).toggle();
				$(this).click(function() {
					$('#detail'+$(this).attr('id')).toggle("blind", 1000 );
				});
				}
			);
		}
	</script>
{% endblock extra_scripts %}
{% block extra_body %}
onload="init();"
{% endblock extra_body %}
{% block content %}

<h2><a href="{% url 'oppia_recent_activity' course.id %}">{{ course.title|title_lang:LANGUAGE_CODE }}</a>
&gt; <a href="{% url 'oppia_course_quiz' course.id %}">{% trans 'title_quizzes' %}</a>
&gt; {{ quiz.title }} </h2>

{% if page.object_list.count > 0 %}
	{% include "oppia/includes/page_navigator.html" %}
	<div class="tableheader">
		<div class='tabletitle'>{% trans 'table_header_attempt_date' %}</a></div>
		<div class='tabletitle'>{% trans 'table_header_attempt_name' %}</div>
		<div class='tablecell'>{% trans 'table_header_attempt_score' %}</div>
		<div style='clear:both'></div>
	</div>
	{% for a in page.object_list %}
		<div id='{{ a.id }}' class='tablelist' name='attemptlist'>
			<div class='tabletitle'>{{ a.attempt_date }}</div>
			<div class='tabletitle'>{{ a.user.first_name }} {{ a.user.last_name }}</div>
			<div class='tablecell'>{{ a.get_score_percent }} %</div>
			<div style='clear:both'></div>
		
			<div id='detail{{ a.id }}'>
			{% for r in a.responses %}
				<div class='tablelist'>
					<div class='tabletitle'>{{ r.question.title }}</div>
					<div class='tabletitle'>{{ r.text }}</div>
					<div class='tablecell'>{{ r.get_score_percent }} %</div>
					<div style='clear:both'></div>
				</div>
			{% endfor %}
			</div>
		</div>
	{% endfor %}
	{% include "oppia/includes/page_navigator.html" %}
{% else %}
	<p>{% trans 'No attempts yet' %}</p>
{% endif %}


{% endblock content %}