--- /dev/null
+{% extends "teleforma/base.html" %}
+{% load i18n %}
+
--- /dev/null
+{% load i18n %}
+{% if previous.answers %}
+
+ {% if user_was_incorrect %}
+ <div class="alert alert-error">
+ <strong>{% trans "You answered the above question incorrectly" %}</strong>
+ </div>
+ {% endif %}
+
+ <table class="table table-striped table-bordered">
+ <tbody>
+ {% for answer in previous.answers %}
+ {% if answer.correct %}
+ <tr class="success">
+ <td>{{ answer.content }}</td>
+ <td><strong>{% trans "This is the correct answer" %}</strong></td>
+ {% else %}
+ <tr>
+ <td>{{ answer.content }}</td>
+ <td>
+ {% if previous.question_type.MCQuestion %}
+ {% if answer.id|add:"0" == previous.previous_answer|add:"0" %}
+ {% trans "This was your answer." %}
+ {% endif %}
+ {% endif %}
+ </td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+{% endif %}
--- /dev/null
+{% extends "base.html" %}
+{% load i18n %}
+
+{% load quiz_tags %}
+
+{% block title %} {% trans "Progress Page" %} {% endblock %}
+{% block description %} {% trans "User Progress Page" %} {% endblock %}
+
+{% block content %}
+
+ {% if cat_scores %}
+
+ <h1>{% trans "Question Category Scores" %}</h1>
+
+ <table class="table table-bordered table-striped">
+
+ <thead>
+ <tr>
+ <th>{% trans "Category" %}</th>
+ <th>{% trans "Correctly answererd" %}</th>
+ <th>{% trans "Incorrect" %}</th>
+ <th>%</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ {% for cat, value in cat_scores.items %}
+ <tr>
+ <td>{{ cat }}</td>
+ <td>{{ value.0 }}</td>
+ <td>{{ value.1 }}</td>
+ <td>{{ value.2 }}</td>
+ </tr>
+
+ {% endfor %}
+
+ </tbody>
+
+ </table>
+
+
+ {% endif %}
+
+ {% if exams %}
+
+ <hr>
+
+ <h1>{% trans "Previous exam papers" %}</h1>
+ <p class="lead">
+ {% trans "Below are the results of exams that you have sat." %}
+ </p>
+
+ <table class="table table-bordered table-striped">
+
+ <thead>
+ <tr>
+ <th>{% trans "Quiz Title" %}</th>
+ <th>{% trans "Score" %}</th>
+ <th>{% trans "Possible Score" %}</th>
+ <th>%</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+ {% for exam in exams %}
+
+ <tr>
+ <td>{{ exam.quiz.title }}</td>
+ <td>{{ exam.current_score }}</td>
+ <td>{{ exam.get_max_score }}</td>
+ <td>{{ exam.get_percent_correct }}</td>
+ </tr>
+
+ {% endfor %}
+
+ </tbody>
+
+ </table>
+
+ {% endif %}
+
+
+{% endblock %}
--- /dev/null
+{% extends "teleforma/base.html" %}
+{% load i18n%}
+
+{% load quiz_tags %}
+
+{% block title %} {{ quiz.title }} {% endblock %}
+{% block description %} {{ quiz.title }} - {{ quiz.description }} {% endblock %}
+
+{% block content %}
+
+{% if previous.answers %}
+
+ <p class="muted"><small>{% trans "The previous question" %}:</small></p>
+ <p>{{ previous.previous_question }}</p>
+
+ {% if previous.previous_outcome %}
+ <div class="alert alert-success">
+ {% else %}
+ <div class="alert alert-warning">
+ {% endif %}
+ <p><small>
+ {% trans "Your answer was" %} </small>
+ <strong>
+ {{ previous.previous_outcome|yesno:"correct,incorrect" }}
+ </strong>
+ </p>
+
+ </div>
+
+ {% include 'correct_answer.html' %}
+
+ <p><strong>{% trans "Explanation" %}:</strong></p>
+ <div class="well " style="background-color: #fcf8e3;">
+ <p>{{ previous.previous_question.explanation }}</p>
+ </div>
+
+ <hr>
+
+{% endif %}
+
+<br />
+
+{% if question %}
+
+{% if progress %}
+<div style="float: right;">
+{% trans "Question" %} {{ progress.0|add:1 }} {% trans "of" %} {{ progress.1 }}
+</div>
+{% endif %}
+
+<p>
+ <small class="muted">{% trans "Question category" %}:</small>
+ <strong>{{ question.category }}</strong>
+</p>
+
+<p class="lead">{{ question.content }}</p>
+
+{% if question.figure %}
+ <img src="{{ question.figure.url }}" alt="{{ question.content }}" />
+{% endif %}
+
+<form action="" method="POST">{% csrf_token %}
+ <input type=hidden name="question_id" value="{{ question.id }}">
+
+ <ul class="list-group">
+
+ {% for answer in form.answers %}
+ <li class="list-group-item">
+ {{ answer }}
+ </li>
+ {% endfor %}
+
+ </ul>
+ <input type="submit" value={% trans "Check" %} class="btn btn-large btn-block btn-warning" >
+</form>
+
+{% endif %}
+
+<hr>
+
+
+{% endblock %}
--- /dev/null
+{% extends 'base.html' %}
+{% load i18n %}
+{% block title %}{% trans "All Quizzes" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "Category list" %}</h2>
+
+<ul>
+ {% for cat in category_list %}
+ <li>
+ <a href="{% url 'quiz_category_list_matching' category_name=cat.category %}">
+ {{ cat.category }}
+ </a>
+ </li>
+ {% endfor %}
+</ul>
+
+{% endblock %}
--- /dev/null
+{% extends 'base.html' %}
+{% load i18n %}
+{% block title %}
+{{ quiz.title }}
+{% endblock %}
+
+{% block content %}
+<h2>{{ quiz.title }}</h2>
+<h3>{% trans "Category" %}: {{ quiz.category }}</h3>
+{% if quiz.single_attempt %}
+ <h4>{% trans "You will only get one attempt at this quiz" %}.</h4>
+{% endif %}
+<p>{{ quiz.description }}</p>
+<p>
+ <a href="{% url 'quiz_question' quiz_name=quiz.url %}">
+ {% trans "Start quiz" %}
+ </a>
+</p>
+{% endblock %}
--- /dev/null
+{% extends 'teleforma/base.html' %}
+{% load i18n %}
+{% block title %}{% trans "All Quizzes" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "List of quizzes" %}</h2>
+ {% if quiz_list %}
+ <table class="table table-bordered table-striped">
+
+ <thead>
+ <tr>
+ <th>{% trans "Title" %}</th>
+ <th>{% trans "Category" %}</th>
+ <th>{% trans "Exam" %}</th>
+ <th>{% trans "Single attempt" %}</th>
+ <th></th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+ {% for quiz in quiz_list %}
+
+ <tr>
+ <td>{{ quiz.title }}</td>
+ <td>{{ quiz.category }}</td>
+ <td>{{ quiz.exam_paper }}</td>
+ <td>{{ quiz.single_attempt }}</td>
+ <td>
+ <a href="{% url 'quiz_start_page' slug=quiz.url %}">
+ {% trans "View details" %}
+ </a>
+ </tr>
+
+ {% endfor %}
+ </tbody>
+
+ </table>
+
+ {% else %}
+ <p>{% trans "There are no available quizzes" %}.</p>
+ {% endif %}
+{% endblock %}
--- /dev/null
+{% extends 'base.html' %}
+{% load i18n %}
+{% load quiz_tags %}
+{% block title %}
+{% trans "Result of" %} {{ sitting.quiz.title }} {% trans "for" %} {{ sitting.user }}
+{% endblock %}
+
+{% block content %}
+<h2>{% trans "Quiz title" %}: {{ sitting.quiz.title }}</h2>
+<h3>{% trans "Category" %}: {{ sitting.quiz.category }}</h3>
+<p>{{ sitting.quiz.description }}</p>
+<hr>
+<p>{% trans "User" %}: {{ sitting.user }}</p>
+<p>{% trans "Completed" %}: {{ sitting.end|date }}</p>
+<p>{% trans "Score" %}: {{ sitting.get_percent_correct }}%</p>
+
+<table class="table table-bordered table-striped">
+
+ <thead>
+ <tr>
+ <th>{% trans "Question" %}</th>
+ <th>{% trans "User answer" %}</th>
+ <th></th>
+ <th></th>
+ </tr>
+ </thead>
+
+ <tbody>
+{% for question in questions %}
+
+ <tr>
+ <td>
+ {{ question.content }}
+ {% if question.figure %}
+ <div style="max-width: 100px;"><img src="{{ question.figure.url }}" alt="{{ question.figure }}"/></div>
+ {% endif %}
+ </td>
+ <td>{{ question|answer_choice_to_string:question.user_answer }}</td>
+ <td>
+ {% if question.id in sitting.get_incorrect_questions %}
+ <p>{% trans "incorrect" %}</p>
+ {% else %}
+ <p>{% trans "Correct" %}</p>
+ {% endif %}
+ </td>
+ <td>
+ <form action="" method="POST">{% csrf_token %}
+ <input type=hidden name="qid" value="{{ question.id }}">
+ <button type="submit" class="btn btn-warning">{% trans "Toggle whether correct" %}</button>
+ </form>
+ </td>
+ </tr>
+
+{% endfor %}
+
+ </tbody>
+
+</table>
+{% endblock %}
--- /dev/null
+{% extends 'base.html' %}
+{% load i18n %}
+{% block title %}{% trans "All Quizzes" %}{% endblock %}
+
+{% block content %}
+<h2>{% trans "List of complete exams" %}</h2>
+ {% if sitting_list %}
+
+ <table class="table table-bordered table-striped">
+
+ <thead>
+ <tr>
+ <th>{% trans "User" %}</th>
+ <th>{% trans "Quiz" %}</th>
+ <th>{% trans "Completed" %}</th>
+ <th>{% trans "Score" %}(%)</th>
+ <th></th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+ <form action="" method="GET">
+ <td><input type="text" name="user_filter" /></td>
+ <td><input type="text" name="quiz_filter" /></td>
+ <td></td>
+ <td></td>
+ <td><button type="submit" class="btn btn-default">{% trans "Filter"%}</button></td>
+ </form>
+ </tr>
+
+
+ {% for sitting in sitting_list %}
+
+ <tr>
+ <td>{{ sitting.user }}</td>
+ <td>{{ sitting.quiz }}</td>
+ <td>{{ sitting.end|date }}</td>
+ <td>{{ sitting.get_percent_correct }}</td>
+ <td>
+ <a href="{% url 'quiz_marking_detail' pk=sitting.id %}">
+ {% trans "View details" %}
+ </a>
+ </tr>
+
+ {% endfor %}
+
+ </tbody>
+
+ </table>
+ {% else %}
+ <p>{% trans "There are no matching quizzes" %}.</p>
+ {% endif %}
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+{% load i18n %}
+
+{% load quiz_tags %}
+
+{% block title %} {{ quiz.title}} {% endblock %}
+{% block description %} {% trans "Exam Results for" %} {{ quiz.title }} {% endblock %}
+
+{% block content %}
+
+ {% if previous.answers %}
+
+ <p class="muted"><small>{% trans "The previous question" %}:</small></p>
+ <p>{{ previous.previous_question }}</p>
+ <p>Your answer was
+ <strong>
+ {{ previous.previous_outcome|yesno:"correct,incorrect" }}
+ </strong>
+ </p>
+ {% include 'correct_answer.html' %}
+ <p><strong>{% trans "Explanation" %}:</strong></p>
+ <div class="well " style="background-color: #fcf8e3;">
+ <p>{{ previous.previous_question.explanation }}</p>
+ </div>
+ <hr>
+
+ {% endif %}
+
+ {% if max_score %}
+
+ <div>
+ <h2>{% trans "Exam results" %}</h2>
+ <p>
+ <small class="muted">{% trans "Exam title" %}: </small>
+ <strong>{{ quiz.title }}</strong></p>
+
+ <p class="lead">
+ {% trans "You answered" %} {{ score }} {% trans "questions correctly out of" %} {{ max_score }}, {% trans "giving you" %} {{ percent }} {% trans "percent correct" %}
+ </p>
+
+ {% if quiz.pass_mark %}
+ <hr>
+ <p class="lead">{{ sitting.result_message }}</p>
+ <hr>
+
+ {% endif %}
+
+ <p>{% trans "Review the questions below and try the exam again in the future"%}.</p>
+
+ {% if user.is_authenticated %}
+
+ <p>{% trans "The result of this exam will be stored in your progress section so you can review and monitor your progression" %}.</p>
+
+ {% endif %}
+ </div>
+
+
+ {% endif %}
+
+
+ <hr>
+
+ {% if possible %}
+
+ <p class="lead">
+ {% trans "Your session score is" %} {{ session }} {% trans "out of a possible" %} {{ possible }}
+ </p>
+
+ <hr>
+
+ {% endif %}
+
+ {% if questions %}
+
+ {% for question in questions %}
+
+ <p class="lead">
+ {{ question.content }}
+ </p>
+
+ {% correct_answer_for_all question %}
+
+ {% if question.user_answer %}
+ <p>{% trans "Your answer" %}: {{ question|answer_choice_to_string:question.user_answer }}</p>
+ {% endif %}
+
+ <p><strong>{% trans "Explanation" %}:</strong></p>
+ <div class="well " style="background-color: #fcf8e3;">
+ <p>{{ question.explanation }}</p>
+ </div>
+
+ <hr>
+
+ {% endfor %}
+
+ {% endif %}
+
+
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+{% load i18n %}
+
+{% load quiz_tags %}
+
+{% block title %} {{ quiz.title }} {% endblock %}
+{% block description %} {{ quiz.title }} - {{ quiz.description }} {% endblock %}
+
+{% block content %}
+
+
+{% if user.is_authenticated %}
+ <p>{% trans "You have already sat this exam and only one sitting is permitted" %}.</p>
+{% else %}
+ <p>{% trans "This exam is only accessible to signed in users" %}.</p>
+{% endif %}
+
+{% endblock %}
--- /dev/null
+{% extends 'base.html' %}
+{% load i18n %}
+{% block title %}{% trans "Quizzes related to" %} {{ category.category }}{% endblock %}
+
+{% block content %}
+<h1>{% trans "Quizzes in the" %} <strong>{{ category.category }} </strong>{% trans "category" %}</h1>
+
+ {% with object_list as quizzes %}
+ {% if quizzes %}
+ <ul>
+ {% for quiz in quizzes %}
+ <li>
+ <a href="{% url 'quiz_question' quiz_name=quiz.url %}">
+ {{ quiz.title }}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p>{% trans "There are no quizzes" %}</p>
+ {% endif %}
+ {% endwith %}
+{% endblock %}
<tbody>
<tr>
<td class="border-top" width="35%">
- <a href="{% url teleforma-quiz seminar.id quiz.id %}">{{ quiz.title }}</a></td>
+ {% if seminar.quiz %}
+ <a href="{% url teleforma-quiz seminar.id seminar.quiz.url %}">{{ seminar.quiz.title }}</a>
+ {% endif %}
+ </td>
<td class="border-top" width="60%">
{% if question|submitted:user and not question|validated:user %}
{% trans "submitted on" %} {{ question|submitted:user }}
{% endif %}
</td>
</tr>
- {% endfor %}
</tbody>
</table>
# Evaluations
url(r'^forms/', include('forms_builder.forms.urls')),
url(r'^desk/seminars/(?P<pk>.*)/form/$', evaluation_form_detail, name="teleforma-seminar-form"),
- url(r'^desk/seminars/(?P<pk>.*)/quiz/$', QuizTake.as_view(), name="teleforma-quiz"),
+ url(r'^desk/seminars/(?P<pk>.*)/quiz/(?P<quiz_name>[\w-]+)/$', QuizTake.as_view(), name="teleforma-quiz"),
# Testimonial
url(r'^desk/seminars/(?P<pk>.*)/testimonial/$', TestimonialView.as_view(),