{% extends "base-mobile.html" %} 
{% load i18n %} 
{% load display_functions %} 
{% block extra_scripts %}
	<script type="text/javascript">
		function load(url){
			window.location.href = url + "?username={{ user.username }}&api_key={{ user.key }}";
		}
	</script>
{% endblock extra_scripts %}
{% block content %}
<h2>{{ course.title|title_lang:LANGUAGE_CODE }}<br/>{{ cohort.description }}</h2>

{% if participants %}
<div id="monitormenu">
	<ul>
		<li><a onclick="load('{% url 'oppia_monitor_cohort_progress' cohort.id course.id %}');"> {% trans 'Progress' %}</a></li>
		<li><a onclick="load('{% url 'oppia_monitor_cohort_quizzes' cohort.id course.id %}');">{% trans 'Quizzes' %}</a></li>
		<li><a onclick="load('{% url 'oppia_monitor_cohort_media' cohort.id course.id %}');">{% trans 'Media' %}</a></li>
	</ul>
</div>

	<div class="listheader">
		<div class="listname">{% trans 'Student' %}</div>
		<div class="listprogress">{% trans 'Quizzes' %}</div>
		<div style='clear:both'></div>
	</div>
	{% for p in participants.object_list %}
		<div class="list">
			<div class="listname">{{ p.user.first_name }} {{ p.user.last_name }}</div>
			<div class="listprogress">
				{% for q in p.quizzes %}
					<div class="progress-box  
					{% if q.completed %}
						p-box-completed
					{% elif q.started > 0 %}
						p-box-started
					{% else %}
						p-box-not-started
					{% endif %}
						" title="{{ q.quiz.section.title|title_lang:LANGUAGE_CODE }} - {{ q.quiz.title|title_lang:LANGUAGE_CODE }}"></div>
				{% endfor %}
			</div>
			<div style='clear:both'></div>
		</div>
	{% endfor %}
	
	{% include "oppia/mobile/includes/page-nav.html" %}
	
	<div class="legend">
		<div class="progress-box p-box-completed">{% trans 'Completed'%}</div> 
		<div class="progress-box p-box-started">{% trans 'Attempted'%}</div> 
		<div class="progress-box p-box-not-started">{% trans 'Not attempted'%}</div> 
	</div>
	
{% else %}
	{% blocktrans %}<p>There are no students in this cohort.</p>{% endblocktrans %}
{% endif %}

{% endblock %} 