.
This commit is contained in:
@@ -8,7 +8,7 @@ var marked_answers = {
|
|||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".answer-list li").each(function (index, element) {
|
$(".answer-list li").each(function (index, element) {
|
||||||
$(element).append($("<span class='google-link' title='search for answer with google'><a href='https://www.google.com/search?q="+$(element).text()+"' target='_blank'>G</a></span>"));
|
$(element).append($("<span class='google-link' title='search for answer with google'><a href='https://www.google.com/search?q=" + $(element).text() + "' target='_blank'>G</a></span>"));
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".answer-list span.answer").each(function (index, element) {
|
$(".answer-list span.answer").each(function (index, element) {
|
||||||
@@ -29,9 +29,9 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
prepAnswerData();
|
prepAnswerData();
|
||||||
|
|
||||||
if($(".post-form").length > 0) {
|
if ($(".post-form").length > 0) {
|
||||||
$(".post-form").get(0).addEventListener("submit", function (e) {
|
$(".post-form").get(0).addEventListener("submit", function (e) {
|
||||||
if($(".not-marked").length > 0 && e.submitter.name != "skip") {
|
if ($(".not-marked").length > 0 && e.submitter.name != "skip") {
|
||||||
e.preventDefault(); // before the code
|
e.preventDefault(); // before the code
|
||||||
alert("Ensure all answers are marked first");
|
alert("Ensure all answers are marked first");
|
||||||
}
|
}
|
||||||
@@ -39,95 +39,97 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if($("#dicom-image").length) {
|
if ($("#dicom-image").length) {
|
||||||
|
|
||||||
console.log("Dicom element found ", $("#dicom-image"));
|
console.log("Dicom element found ", $("#dicom-image"));
|
||||||
|
|
||||||
$('#dicom-image').bind('contextmenu', function(e) {
|
$('#dicom-image').bind('contextmenu', function (e) {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
cornerstoneBase64ImageLoader.external.cornerstone = cornerstone;
|
cornerstoneBase64ImageLoader.external.cornerstone = cornerstone;
|
||||||
cornerstoneWebImageLoader.external.cornerstone = cornerstone;
|
cornerstoneWebImageLoader.external.cornerstone = cornerstone;
|
||||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
|
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
|
||||||
|
|
||||||
cornerstoneTools.init();
|
cornerstoneTools.init();
|
||||||
const PanTool = cornerstoneTools.PanTool;
|
const PanTool = cornerstoneTools.PanTool;
|
||||||
const ZoomTool = cornerstoneTools.ZoomTool;
|
const ZoomTool = cornerstoneTools.ZoomTool;
|
||||||
const ZoomMouseWheelTool = cornerstoneTools.ZoomMouseWheelTool;
|
const ZoomMouseWheelTool = cornerstoneTools.ZoomMouseWheelTool;
|
||||||
const WwwcTool = cornerstoneTools.WwwcTool;
|
const WwwcTool = cornerstoneTools.WwwcTool;
|
||||||
const WwwcRegionTool = cornerstoneTools.WwwcRegionTool;
|
const WwwcRegionTool = cornerstoneTools.WwwcRegionTool;
|
||||||
const RotateTool = cornerstoneTools.RotateTool;
|
const RotateTool = cornerstoneTools.RotateTool;
|
||||||
const StackScrollTool = cornerstoneTools.StackScrollTool;
|
const StackScrollTool = cornerstoneTools.StackScrollTool;
|
||||||
const MagnifyTool = cornerstoneTools.MagnifyTool;
|
const MagnifyTool = cornerstoneTools.MagnifyTool;
|
||||||
const ArrowAnnotateTool = cornerstoneTools.ArrowAnnotateTool;
|
const ArrowAnnotateTool = cornerstoneTools.ArrowAnnotateTool;
|
||||||
|
|
||||||
|
|
||||||
const element = document.getElementById('dicom-image');
|
const element = document.getElementById('dicom-image');
|
||||||
const imageId = element.dataset.url;
|
const imageId = element.dataset.url;
|
||||||
|
|
||||||
cornerstone.enable(element);
|
console.log("Dicom - load imageId: ", imageId);
|
||||||
cornerstone.loadAndCacheImage(imageId).then(function(image) {
|
|
||||||
cornerstone.displayImage(element, image);
|
|
||||||
|
|
||||||
cornerstoneTools.addTool(PanTool);
|
cornerstone.enable(element);
|
||||||
cornerstoneTools.addTool(ZoomTool);
|
cornerstone.loadAndCacheImage(imageId).then(function (image) {
|
||||||
cornerstoneTools.addTool(ZoomMouseWheelTool);
|
cornerstone.displayImage(element, image);
|
||||||
cornerstoneTools.addTool(WwwcTool);
|
|
||||||
cornerstoneTools.addTool(WwwcRegionTool);
|
|
||||||
cornerstoneTools.addTool(RotateTool);
|
|
||||||
cornerstoneTools.addTool(StackScrollTool);
|
|
||||||
cornerstoneTools.addTool(MagnifyTool);
|
|
||||||
|
|
||||||
cornerstoneTools.addTool(ArrowAnnotateTool, {
|
cornerstoneTools.addTool(PanTool);
|
||||||
configuration: {
|
cornerstoneTools.addTool(ZoomTool);
|
||||||
getTextCallback: () => {},
|
cornerstoneTools.addTool(ZoomMouseWheelTool);
|
||||||
changeTextCallback: () => {},
|
cornerstoneTools.addTool(WwwcTool);
|
||||||
allowEmptyLabel: true,
|
cornerstoneTools.addTool(WwwcRegionTool);
|
||||||
renderDashed: false,
|
cornerstoneTools.addTool(RotateTool);
|
||||||
drawHandles: false,
|
cornerstoneTools.addTool(StackScrollTool);
|
||||||
drawHandlesOnHover: true,
|
cornerstoneTools.addTool(MagnifyTool);
|
||||||
},
|
|
||||||
});
|
cornerstoneTools.addTool(ArrowAnnotateTool, {
|
||||||
|
configuration: {
|
||||||
|
getTextCallback: () => { },
|
||||||
|
changeTextCallback: () => { },
|
||||||
|
allowEmptyLabel: true,
|
||||||
|
renderDashed: false,
|
||||||
|
drawHandles: false,
|
||||||
|
drawHandlesOnHover: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Enable our tools
|
// Enable our tools
|
||||||
// Avoid incorrect aspect ratio
|
// Avoid incorrect aspect ratio
|
||||||
cornerstoneTools.setToolActive("Pan", { mouseButtonMask: 1 });
|
cornerstoneTools.setToolActive("Pan", { mouseButtonMask: 1 });
|
||||||
cornerstoneTools.setToolActive("Wwwc", { mouseButtonMask: 2 });
|
cornerstoneTools.setToolActive("Wwwc", { mouseButtonMask: 2 });
|
||||||
cornerstoneTools.setToolActive("ZoomMouseWheel", { mouseButtonMask: 3 });
|
cornerstoneTools.setToolActive("ZoomMouseWheel", { mouseButtonMask: 3 });
|
||||||
cornerstoneTools.setToolActive("Zoom", { mouseButtonMask: 4 });
|
cornerstoneTools.setToolActive("Zoom", { mouseButtonMask: 4 });
|
||||||
|
|
||||||
if (element.dataset.edit_annotation == "true") {
|
if (element.dataset.edit_annotation == "true") {
|
||||||
cornerstoneTools.setToolActive("ArrowAnnotate", { mouseButtonMask: 2 });
|
cornerstoneTools.setToolActive("ArrowAnnotate", { mouseButtonMask: 2 });
|
||||||
} else {
|
} else {
|
||||||
cornerstoneTools.setToolEnabled("ArrowAnnotate");
|
cornerstoneTools.setToolEnabled("ArrowAnnotate");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.dataset.annotations) {
|
if (element.dataset.annotations) {
|
||||||
loadJsonToolStateOnCurrentImage(element.dataset.annotations)
|
loadJsonToolStateOnCurrentImage(element.dataset.annotations)
|
||||||
}
|
}
|
||||||
|
|
||||||
cornerstone.resize(element);
|
cornerstone.resize(element);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($("#question-mark-list").length) {
|
if ($("#question-mark-list").length) {
|
||||||
$(".show-all-button").click(() => {
|
$(".show-all-button").click(() => {
|
||||||
$("#question-mark-list li").show();
|
$("#question-mark-list li").show();
|
||||||
});
|
});
|
||||||
$(".show-unmarked-button").click(() => {
|
$(".show-unmarked-button").click(() => {
|
||||||
console.log("TESTIG");
|
console.log("TESTIG");
|
||||||
$("#question-mark-list li").each((n, el) => {
|
$("#question-mark-list li").each((n, el) => {
|
||||||
console.log(el);
|
console.log(el);
|
||||||
if (el.dataset.markcount < 1) { $(el).hide(); }
|
if (el.dataset.markcount < 1) { $(el).hide(); }
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ def exam_question_detail(request, pk, sk):
|
|||||||
|
|
||||||
pos = exam.get_question_index(question) + 1
|
pos = exam.get_question_index(question) + 1
|
||||||
|
|
||||||
|
print(question.exams.through.sort_value)
|
||||||
|
|
||||||
previous = -1
|
previous = -1
|
||||||
if sk > 0:
|
if sk > 0:
|
||||||
previous = sk - 1
|
previous = sk - 1
|
||||||
|
|||||||
Reference in New Issue
Block a user