.
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user