fix questions
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2020-11-26 17:30
|
||||||
|
|
||||||
|
import anatomy.models
|
||||||
|
import django.core.files.storage
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('anatomy', '0004_auto_20201123_1619'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='structure',
|
||||||
|
old_name='bodypart',
|
||||||
|
new_name='structure',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='exam',
|
||||||
|
name='recreate_json',
|
||||||
|
),
|
||||||
|
#migrations.AddField(
|
||||||
|
# model_name='anatomyquestion',
|
||||||
|
# name='open_access',
|
||||||
|
# field=models.BooleanField(default=True, help_text='If an question should be freely available to browse'),
|
||||||
|
#),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='anatomyquestion',
|
||||||
|
name='image',
|
||||||
|
field=models.ImageField(storage=django.core.files.storage.FileSystemStorage(base_url='http://161.35.163.87//media/anatomy/', location='/home/ross/scripts/sites/rad/media//anatomy/'), upload_to=anatomy.models.image_directory_path),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='exam',
|
||||||
|
name='exam_questions',
|
||||||
|
field=models.ManyToManyField(blank='true', related_name='exams', to='anatomy.AnatomyQuestion'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+3
-3
@@ -37,10 +37,10 @@ class BodyPart(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class Structure(models.Model):
|
class Structure(models.Model):
|
||||||
bodypart = models.CharField(max_length=200)
|
structure = models.CharField(max_length=200)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.bodypart
|
return self.structure
|
||||||
|
|
||||||
|
|
||||||
class Modality(models.Model):
|
class Modality(models.Model):
|
||||||
@@ -193,7 +193,7 @@ class Answer(models.Model):
|
|||||||
class Exam(models.Model):
|
class Exam(models.Model):
|
||||||
name = models.CharField(max_length=200)
|
name = models.CharField(max_length=200)
|
||||||
exam_questions = models.ManyToManyField(AnatomyQuestion,
|
exam_questions = models.ManyToManyField(AnatomyQuestion,
|
||||||
related_name="exams")
|
related_name="exams", blank="true")
|
||||||
|
|
||||||
active = models.BooleanField(help_text="If an exam should be available",
|
active = models.BooleanField(help_text="If an exam should be available",
|
||||||
default=True)
|
default=True)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{% extends 'anatomy/exams.html' %}
|
{% extends 'anatomy/exams.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
{% load thumbnail %}
|
||||||
<div class="anatomy">
|
<div class="anatomy">
|
||||||
<h1>Exam: {{ exam.name }}</h1>
|
<h1>Exam: {{ exam.name }}</h1>
|
||||||
This exam has {{question_number}} questions.
|
This exam has {{question_number}} questions.
|
||||||
@@ -9,7 +11,8 @@
|
|||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
{% for question in questions.all %}
|
{% for question in questions.all %}
|
||||||
<li>{{ question }}</lid>
|
|
||||||
|
<li>{{ question }}<img src="{{ question.image|thumbnail_url:'exam-list' }}" alt="thumbail" /><img src="{{ question.image.url }}" alt="thumbail" /></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
<a href="{% url 'anatomy:exam_json' pk=exam.pk %}">JSON</a>
|
<a href="{% url 'anatomy:exam_json' pk=exam.pk %}">JSON</a>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
{% for exam in exams %}
|
{% for exam in exams %}
|
||||||
<div class="anatomy">
|
<div class="anatomy">
|
||||||
<h1><a href="{% url 'anatomy:exam_overview' pk=exam.pk %}">Exam {{ forloop.counter }} </a></h1>
|
<h1><a href="{% url 'anatomy:exam_overview' pk=exam.pk %}">Exam: {{ exam.name }} </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: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 %}
|
{% if request.user.is_staff %}<a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user