Start
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{% extends 'blog/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Answer</h1>
|
||||
<form method="POST" class="post-form">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="save btn btn-default">Save</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Question</h1>
|
||||
<p>{{ question.question_type.first }}</p>
|
||||
<img src="/media/anatomy/{{ question.image|linebreaksbr }}" />
|
||||
|
||||
<form method="POST" class="post-form">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="save btn btn-default" formaction="/test">Previous</button>
|
||||
<button type="submit" class="save btn btn-default" formaction="/previous">Next</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,32 @@
|
||||
{% load static %}
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Anatomy Quiz</title>
|
||||
<link rel="stylesheet" href="{% static 'css/anatomy.css' %}">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="{% static 'js/anatomy.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'js/dwv/i18next.min.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'js/dwv/dwv.min.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'js/dwv/appgui.js' %}"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page-header">
|
||||
{% if request.user.is_staff %}<span id="admin-link"><a
|
||||
href="{% url 'admin:index' %}">Admin</a></span>{% endif %}
|
||||
</div>
|
||||
<div class="content container">
|
||||
{% block navigation %}
|
||||
{% endblock %}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#flagged-button").click(function () {
|
||||
|
||||
$.ajax({
|
||||
url: "{% url 'anatomy:flag_question' %}",
|
||||
data: {
|
||||
'pk': {{ question.pk }}
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
console.log(data.flagged);
|
||||
if (data.flagged) {
|
||||
$("#flagged-button").text("Flagged");
|
||||
$("#flagged-button").attr("class", "flagged");
|
||||
|
||||
} else {
|
||||
$("#flagged-button").text("Not Flagged");
|
||||
$("#flagged-button").attr("class", "not-flagged");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
$("#id_answer").keyup(function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
$(".btn-default").click();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<h1>Question {{question_details.current}} of {{question_details.total}}</h1>
|
||||
<p>{{ question.question_type.first }}</p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class=dwv-container data-url="{{ question.image.url}}" />
|
||||
</div>
|
||||
|
||||
<form method="POST" class="post-form">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
{% if question_details.current > 1 %}
|
||||
<button type="submit" name="previous" class="btn btn-previous">Previous</button>
|
||||
{% endif %}
|
||||
{% if question_details.current >= question_details.total %}
|
||||
<button type="submit" name="save" class="save btn btn-default">Save</button>
|
||||
{% else %}
|
||||
<button type="submit" name="next" class="save btn btn-default">Next</button>
|
||||
{% endif %}
|
||||
<button id=flagged-button type="button"
|
||||
class={% if answer.flagged == True %}flagged{% else %}not-flagged{% endif %}>{% if answer.flagged == True %}Flagged{% else %}Not
|
||||
Flagged{% endif %}</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<div class=exam-navigation />
|
||||
<ul id=question-list>
|
||||
{% for question in questions %}
|
||||
<li><a class={% if question.pk in answered_questions %}answered{% else %}unanswered{% endif %}
|
||||
href="{% url 'exam' pk=exam.pk sk=forloop.counter0 %}">{{ forloop.counter }}{% if question.pk in flagged_questions %}!{% endif %}</a>
|
||||
</li>
|
||||
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% for exam in exams %}
|
||||
<div class="anatomy">
|
||||
<h1><a href="{% url 'anatomy:exam_overview' pk=exam.pk %}">{{exam.name}}</a></h1>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="anatomy">
|
||||
<h1>{{ exam.name }}</h1>
|
||||
This exam has {{question_number}} questions.
|
||||
<p><button><a href="{% url 'anatomy:exam' pk=exam.pk sk=0 %}">Click here to start</a></button></p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,40 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="anatomy">
|
||||
<h2>{{ exam.name }}</h2>
|
||||
{% for user, value in user_answers_marks.items %}
|
||||
<h3>Candidate: {{ user_names|get_item:user }}</h3>
|
||||
<!-- Answers: {{ user_answers_and_marks|get_item:user }}-->
|
||||
Answers: {% for ans, score in user_answers_and_marks|get_item:user %}
|
||||
{{ans}} ({{score}}),
|
||||
{% endfor %}
|
||||
<br /> Total mark: {{ user_scores|get_item:user }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="stats-block">
|
||||
<h2>Stats</h2>
|
||||
Mean: {{mean}}, Median {{median}}, Mode {{mode}}
|
||||
<h3>Distribution of results</h3>
|
||||
<div id="stats-plot">{{plot|safe}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Candidate ID</th>
|
||||
<th>Score</th>
|
||||
</tr>
|
||||
{% for user, value in user_answers_marks.items %}
|
||||
<tr>
|
||||
<td>{{user}}</td>
|
||||
<td>{{user_scores|get_item:user}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block navigation %}
|
||||
<a href="{% url 'anatomy:exam_list' %}">Exams</a> <a href="{% url 'anatomy:mark_overview' pk=exam.pk %}">Marking
|
||||
overview</a> <a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% for exam in exams %}
|
||||
<div class="anatomy">
|
||||
<h1><a href="{% url 'anatomy:exam_overview' pk=exam.pk %}">Exam {{ forloop.counter }} </a></h1>
|
||||
{% if request.user.is_staff %}<a href="{% url 'anatomy:mark' pk=exam.pk sk=0 %}">Mark answers</a>{% endif %}
|
||||
{% if request.user.is_staff %}<a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,47 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Marking question {{question_details.current}} of {{question_details.total}}</h2>
|
||||
<p>{{ question.question_type }}</p>
|
||||
|
||||
<form method="POST" class="post-form">{% csrf_token %}
|
||||
<div class="marking-list">Marked:
|
||||
<ul id="marked-answer-list" class="answer-list">
|
||||
{% for answer in question.answers.all %}
|
||||
<li class="correct">{{ answer }} </li>
|
||||
{% endfor %}
|
||||
{% for answer in question.half_mark_answers.all %}
|
||||
<li class="half-correct">{{ answer }} </li>
|
||||
{% endfor %}
|
||||
{% for answer in question.incorrect_answers.all %}
|
||||
<li class="incorrect">{{ answer }} </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
Unmarked:
|
||||
<ul id="new-answer-list" class="answer-list">
|
||||
{% for answer in user_answers %}
|
||||
<li class="not-marked">{{ answer }} </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="answer-list key">Key: <span class="correct">2 Marks</span>, <span class="half-correct">1
|
||||
Mark</span>, <span class="incorrect">0 Marks</span></div>
|
||||
{% if question_details.current > 1 %}
|
||||
<button type="submit" name="previous" class="save btn btn-default">Previous</button>
|
||||
{% endif %}
|
||||
<button type="submit" name="save" class="save btn btn-default">Save</button>
|
||||
{% if question_details.current >= question_details.total %}
|
||||
{% else %}
|
||||
<button type="submit" name="next" class="save btn btn-default">Next</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class=hide>
|
||||
{{ form.as_p }}
|
||||
</span>
|
||||
</form>
|
||||
<div class=dwv-container data-url="/media/anatomy/{{ question.image}}" />
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block navigation %}
|
||||
<a href="{% url 'anatomy:exam_list' %}">Exams</a> <a href="{% url 'anatomy:mark_overview' pk=exam.pk %}">Marking
|
||||
overview</a> <a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="anatomy">
|
||||
<h2>{{ exam.name }}</h2>
|
||||
|
||||
<ul>
|
||||
{% for question in questions.all %}
|
||||
<li><a href="{% url 'anatomy:mark' pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter }}:
|
||||
{{ question }}</a><br /> {{ question.GetUnmarkedAnswersString }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><button><a href="{% url 'anatomy:mark' pk=exam.pk sk=0 %}">Click here to start marking</a></button></p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block navigation %}
|
||||
<a href="{% url 'anatomy:exam_list' %}">Exams</a> <a href="{% url 'anatomy:mark_overview' pk=exam.pk %}">Marking
|
||||
overview</a> <a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,14 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="question">
|
||||
<div class="date">
|
||||
{{ question.created_date }}
|
||||
</div>
|
||||
<h1>{% for answer in question.answers.all %}
|
||||
{{ answer }},
|
||||
{% endfor %}</h1>
|
||||
<p>{{ question.question_type.first|linebreaksbr }}</p>
|
||||
<img src="/media/anatomy/{{ question.image|linebreaksbr }}" />
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends 'anatomy/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% for question in questions %}
|
||||
<div class="anatomy">
|
||||
<div class="date">
|
||||
{{ question.created_date }}
|
||||
</div>
|
||||
<h1><a href="{% url 'anatomy:question_detail' pk=question.pk %}">{% for answer in question.answers.all %}
|
||||
{{ answer }},
|
||||
{% endfor %}
|
||||
</a></h1>
|
||||
<p>{{ question.question_type.first|linebreaksbr }}</p>
|
||||
<img src="/media/anatomy/{{ question.image|linebreaksbr }}" />
|
||||
<a href="{% url 'anatomy:answer_question' pk=question.pk %}">ANSWER</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{$ black navigation %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends '../anatomy/base.html' %}
|
||||
|
||||
{% block title %}Login{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Login</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user