.
This commit is contained in:
@@ -275,6 +275,9 @@ class Exam(models.Model):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse("anatomy:exam_overview", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
def get_exam_name(self):
|
def get_exam_name(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -94,6 +94,9 @@ class Question(models.Model):
|
|||||||
if self.e:
|
if self.e:
|
||||||
self.e = self.e.strip()
|
self.e = self.e.strip()
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse("physics:question_detail", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
def get_answers(self):
|
def get_answers(self):
|
||||||
return (self.a_answer, self.b_answer, self.c_answer, self.d_answer, self.e_answer)
|
return (self.a_answer, self.b_answer, self.c_answer, self.d_answer, self.e_answer)
|
||||||
|
|
||||||
@@ -127,12 +130,15 @@ class Exam(models.Model):
|
|||||||
def get_exam_name(self):
|
def get_exam_name(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def get_json_url(self):
|
#def get_json_url(self):
|
||||||
return reverse("anatomy:exam_json", args=(self.pk,))
|
# return reverse("anatomy:exam_json", args=(self.pk,))
|
||||||
|
|
||||||
def get_question_index(self, question):
|
def get_question_index(self, question):
|
||||||
return list(self.exam_questions.all()).index(question)
|
return list(self.exam_questions.all()).index(question)
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse("physics:exam_overview", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
|
|
||||||
class CidUserAnswer(models.Model):
|
class CidUserAnswer(models.Model):
|
||||||
"""User answers by candidate"""
|
"""User answers by candidate"""
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<link rel="stylesheet" href="{% static 'css/anatomy.css' %}">
|
<link rel="stylesheet" href="{% static 'css/anatomy.css' %}">
|
||||||
<link rel="stylesheet" href="{% static 'css/toastr.min.css' %}">
|
<link rel="stylesheet" href="{% static 'css/toastr.min.css' %}">
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
|
||||||
<script src="{% static 'js/toastr.min.js' %}"></script>
|
<script src="{% static 'js/toastr.min.js' %}"></script>
|
||||||
<script src="{% static 'js/cornerstone/hammer.js' %}"></script>
|
<script src="{% static 'js/cornerstone/hammer.js' %}"></script>
|
||||||
<script src="{% static 'js/cornerstone/cornerstone.min.js' %}"></script>
|
<script src="{% static 'js/cornerstone/cornerstone.min.js' %}"></script>
|
||||||
|
|||||||
@@ -14,7 +14,9 @@
|
|||||||
Publish results: <input type="checkbox" id="exam-publish-results-switch" {% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will be available on this site]</span>
|
Publish results: <input type="checkbox" id="exam-publish-results-switch" {% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will be available on this site]</span>
|
||||||
</div>
|
</div>
|
||||||
<!--<p><button><a href="{% url 'anatomy:exam_take' pk=exam.pk sk=0 %}">Click here to start</a></button></p>-->
|
<!--<p><button><a href="{% url 'anatomy:exam_take' pk=exam.pk sk=0 %}">Click here to start</a></button></p>-->
|
||||||
|
This exam will be available to take <a href="{% url 'physics:exam_take' pk=exam.pk %}">here</a>.
|
||||||
|
|
||||||
|
{% autoescape off %}
|
||||||
<ol id="full-question-list">
|
<ol id="full-question-list">
|
||||||
{% for question in questions.all %}
|
{% for question in questions.all %}
|
||||||
|
|
||||||
@@ -37,10 +39,12 @@
|
|||||||
{{ question.e }}: {{ question.e_answer }}
|
{{ question.e }}: {{ question.e_answer }}
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
Category: {{ question.category }}, <a href="{% url 'physics:question_detail' pk=question.pk %}">View</a>
|
Category: {{ question.category }}, <a href="{% url 'physics:question_detail' pk=question.pk %}">View</a> <a href="{% url 'admin:physics_question_change' question.id %}">Edit</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
|
{% endautoescape %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<div class="date">
|
<div class="date">
|
||||||
Created: {{ question.created_date }}
|
Created: {{ question.created_date }}
|
||||||
</div>
|
</div>
|
||||||
|
{% autoescape off %}
|
||||||
<h2>{{question.stem}}</h2>
|
<h2>{{question.stem}}</h2>
|
||||||
<div>
|
<div>
|
||||||
<ol>
|
<ol>
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
<li>{{ question.e }}: {{ question.e_answer }}</li>
|
<li>{{ question.e }}: {{ question.e_answer }}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
{% endautoescape %}
|
||||||
<div>
|
<div>
|
||||||
Examinations: {% for exam in question.exams.all %}
|
Examinations: {% for exam in question.exams.all %}
|
||||||
<a href="{% url 'physics:exam_overview' pk=exam.pk %}">{{ exam.name }}</a>
|
<a href="{% url 'physics:exam_overview' pk=exam.pk %}">{{ exam.name }}</a>
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<title>Penra Courses</title>
|
<title>Penra Courses</title>
|
||||||
<link rel="stylesheet" href="{% static 'css/anatomy.css' %}">
|
<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="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user