This commit is contained in:
Ross
2021-02-01 12:20:48 +00:00
parent 7d3abd0680
commit 1fbc3b4bb8
8 changed files with 62 additions and 76 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<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="dicom-image" class="marking-dicom dicom-image" data-url="http://penracourses.org.uk{{ question.image.url}}" data-annotations='{{question.image_annotations}}'>
<div id="single-dicom-viewer" class="marking-dicom" data-images="http://penracourses.org.uk{{ question.image.url}}" data-annotations='{{question.get_annotations}}'>
</div>
<div class="marking">
<form method="POST" class="post-form">{% csrf_token %}
+39 -15
View File
@@ -5,24 +5,26 @@
{% if exam %}
<div>
{% if previous > -1 %}
<a href="{% url 'anatomy:exam_question_detail' exam.id previous %}">Previous question</a>
{% endif %}
This question is part of exam: {{exam.name}} [{{pos}}/{{exam_length}}]
{% if next %}
<a href="{% url 'anatomy:exam_question_detail' exam.id next %}">Next question</a>
{% endif %}
{% if previous > -1 %}
<a href="{% url 'anatomy:exam_question_detail' exam.id previous %}">Previous question</a>
{% endif %}
This question is part of exam: {{exam.name}} [{{pos}}/{{exam_length}}]
{% if next %}
<a href="{% url 'anatomy:exam_question_detail' exam.id next %}">Next question</a>
{% endif %}
</div>
{% endif %}
<button id="save-annotations">Save Annotations</button>
<div id="dicom-image" class="dicom-image" data-url="http://penracourses.org.uk{{ question.image.url}}" data-annotations='{{question.image_annotations}}' data-edit_annotation=true></div>
<!-- testing -->
<div id="dicom-image" class="dicom-image" data-url="http://penracourses.org.uk{{ question.image.url}}"
data-annotations='{{question.image_annotations}}' data-edit_annotation=true></div>
<!-- testing -->
<!--<div id="dicom-image" data-url="http://localhost:8000/static/abdoct.jpg"
data-annotations='{{question.image_annotations}}' data-edit_annotation=true></div>-->
<div class="question">
<a href="{% url 'anatomy:anatomy_question_update' question.id %}" title="Edit the Question">Edit</a>
<a href="{% url 'anatomy:question_clone' question.id %}" title="Clone the Question">Clone</a>
<a href="{% url 'admin:anatomy_anatomyquestion_change' question.id %}" title="Edit the Question using the admin interface">Admin Edit</a>
<a href="{% url 'anatomy:anatomy_question_update' question.id %}" title="Edit the Question">Edit</a>
<a href="{% url 'anatomy:question_clone' question.id %}" title="Clone the Question">Clone</a>
<a href="{% url 'admin:anatomy_anatomyquestion_change' question.id %}"
title="Edit the Question using the admin interface">Admin Edit</a>
<div class="date">
Created: {{ question.created_date }}
</div>
@@ -53,14 +55,16 @@
</div>
<div>
Author: {% for user in question.author.all %}
{{ author }},
{% endfor %}
{{ author }},
{% endfor %}
</div>
<div>
Open access: {{ question.open_access }}
</div>
<div>
<span id="annotation-json-toggle">Annotation JSON (+/-):</span> <span id="annotation-json-content"><pre>{{ question.image_annotations }}</pre></span>
<span id="annotation-json-toggle">Annotation JSON (+/-):</span> <span id="annotation-json-content">
<pre>{{ question.image_annotations }}</pre>
</span>
</div>
</div>
<script type="text/javascript">
@@ -96,5 +100,25 @@
})
})
});
function getJsonToolStateNoId() {
const el = document.getElementById("dicom-image");
const c = cornerstone.getEnabledElement(el);
const toolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager;
const image_id = c.image.imageId;
const state_with_id = toolStateManager.saveToolState()
const json_tool_state = JSON.stringify(state_with_id[image_id]);
return json_tool_state;
}
</script>
{% endblock %}