Refactor exam scores user template to enhance viewer block structure and improve question display functionality
This commit is contained in:
@@ -50,6 +50,8 @@
|
|||||||
<button class="btn btn-sm btn-outline-secondary" id="hide-viewer">Hide</button>
|
<button class="btn btn-sm btn-outline-secondary" id="hide-viewer">Hide</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
|
<div class="viewer-block">
|
||||||
|
<div class="viewer-body overflow-auto p-3" style="max-height: calc(100vh - 160px);">
|
||||||
<div>Question <span class="question-number">No question loaded</span></div>
|
<div>Question <span class="question-number">No question loaded</span></div>
|
||||||
<div id="question-title" class="fw-bold my-2"></div>
|
<div id="question-title" class="fw-bold my-2"></div>
|
||||||
<div id="question-question" class="mb-2"></div>
|
<div id="question-question" class="mb-2"></div>
|
||||||
@@ -57,6 +59,8 @@
|
|||||||
<div class="answers small text-muted">Answers: </div>
|
<div class="answers small text-muted">Answers: </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,6 +74,7 @@
|
|||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.anatomy .card.sticky-top { min-width: 600px; }
|
.anatomy .card.sticky-top { min-width: 600px; }
|
||||||
}
|
}
|
||||||
|
.anatomy .viewer-block .viewer-body { overflow: auto; }
|
||||||
.dicom-viewer, .dicom-viewer .canvas-panel, .dicom-viewer .cornerstone-element { max-width: 100%; box-sizing: border-box; }
|
.dicom-viewer, .dicom-viewer .canvas-panel, .dicom-viewer .cornerstone-element { max-width: 100%; box-sizing: border-box; }
|
||||||
.dicom-viewer canvas { max-width: 100% !important; width: 100% !important; height: auto !important; display: block; }
|
.dicom-viewer canvas { max-width: 100% !important; width: 100% !important; height: auto !important; display: block; }
|
||||||
#single-dicom-viewer { width: 100%; }
|
#single-dicom-viewer { width: 100%; }
|
||||||
@@ -81,7 +86,7 @@
|
|||||||
{% if exam.publish_results %}
|
{% if exam.publish_results %}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#hide-viewer").on('click', function(){ $('.question-display-block .inner-display-block').toggle(); });
|
$("#hide-viewer").on('click', function(){ $('.viewer-block .viewer-body').toggle(); });
|
||||||
|
|
||||||
$(".view-question-link").on("click", function (e) {
|
$(".view-question-link").on("click", function (e) {
|
||||||
question_number = e.currentTarget.dataset.qn;
|
question_number = e.currentTarget.dataset.qn;
|
||||||
@@ -98,12 +103,12 @@
|
|||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
let event = new CustomEvent('loadDicomViewerUrls', { "detail": { "images": data.images, "annotations": data.annotations } });
|
let event = new CustomEvent('loadDicomViewerUrls', { "detail": { "images": data.images, "annotations": data.annotations } });
|
||||||
window.dispatchEvent(event);
|
window.dispatchEvent(event);
|
||||||
$(".question-display-block .answers").empty().append(data.answers.toString());
|
$(".viewer-block .answers").empty().append(data.answers.toString());
|
||||||
$("#question-title").empty().append(data.title);
|
$("#question-title").empty().append(data.title);
|
||||||
$("#question-question").empty().append(data.question);
|
$("#question-question").empty().append(data.question);
|
||||||
n = parseInt(question_number) + 1
|
n = parseInt(question_number) + 1
|
||||||
$(".question-display-block .question-number").empty().append(n);
|
$(".viewer-block .question-number").empty().append(n);
|
||||||
$(".inner-display-block").show();
|
$(".viewer-block .viewer-body").show();
|
||||||
})
|
})
|
||||||
.always(function () { console.log('[Done]'); });
|
.always(function () { console.log('[Done]'); });
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user