{% extends "manage.html" %}

{% block title %} Quiz results {% endblock title %}

{% block meta %} <meta http-equiv="refresh" content="30"/> {% endblock meta %}

{% block css %}
<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> 
{% endblock %}
{% block subtitle %}
  {% if not quizzes and not quiz %}
	Quiz Results
  {% endif %}
  {% if quizzes %}
	Available Quizzes
  {% endif %}
  {% if quiz %}
	{{ quiz.description }} Results
  {% endif %}
{% endblock %}
{% block manage %}
  {% if not quizzes and not quiz %}
    <center><h5> No quizzes available. </h5></center>
  {% endif %}

{# ############################################################### #}
{# This is rendered when we are just viewing exam/monitor #}
{% if quizzes %}
<ul>
{% for q in quizzes %}
<li><a href="{{URL_ROOT}}/exam/manage/monitor/{{q.id}}/">{{ q.quiz.description }}</a></li>
{% endfor %}
</ul>
{% endif %}

{# ############################################################### #}
{# This is rendered when we are just viewing exam/monitor/quiz_num #}
{% if quiz %}

{% if papers %}
{# <p> Quiz: {{ quiz_name }}</p> #}
<p>Number of papers: {{ papers|length }} </p>
<table border="1" cellpadding="3">
    <tr>
    <th> Name </th>
    <th> Username </th>
    <th> Roll number </th>  
    <th> Institute </th>
    <th> Questions answered </th> 
    <th> Marks obtained </th>
    <th> Attempts </th>
    </tr>
    {% for paper in papers %}
    <tr> 
        <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.username}}">{{ paper.user.get_full_name.title }}</a> </td>
        <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.username}}">{{ paper.user.username }}</a> </td>
        <td> {{ paper.profile.roll_number }} </td>
        <td> {{ paper.profile.institute }} </td>
        <td> {{ paper.get_answered_str }} </td> 
        <td> {{ paper.marks_obtained }} </td>
        <td> {{ paper.answers.count }} </td>
    </tr>
    {% endfor %}
</table>
{% else %}
<p> No answer papers so far. </p>
{% endif %} {# if papers #}
{% endif %}
{% endblock %}
