This commit is contained in:
Ross
2021-10-02 15:58:45 +01:00
parent fc09097958
commit 686fb2bd35
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -1,3 +1,4 @@
import json
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.utils import timezone
@@ -256,6 +257,15 @@ class AnatomyQuestion(models.Model):
return json
def get_image_url(self):
return "https://www.penracourses.org.uk{}".format(self.image.url)
def get_image_url_array(self):
return json.dumps(["https://www.penracourses.org.uk{}".format(self.image.url)])
def get_image_annotations(self):
return json.dumps([self.image_annotations])
@reversion.register
class Answer(models.Model):
+1 -1
View File
@@ -5,7 +5,7 @@
<a href="{% url 'anatomy:question_detail' question.id %}" title="View the Question">View</a> <a href="{% url 'anatomy:anatomy_question_update' question.id %}" title="Edit the Question">Edit</a> <a href="{% url 'admin:anatomy_anatomyquestion_change' question.id %}" title="Edit the Question using the admin interface">Admin Edit</a>
<h3>{{ question.question_type }}</h3>
<div id="single-dicom-viewer" class="marking-dicom" data-images="https://www.penracourses.org.uk{{ question.image.url}}" data-annotations='{{question.get_annotations}}'>
<div id="single-dicom-viewer" class="marking-dicom" data-images="{{ question.get_image_url_array }}" data-annotations='{{question.get_image_annotations}}'>
</div>
<div class="marking">
<form method="POST" class="post-form">{% csrf_token %}