small fixes

This commit is contained in:
Ross
2020-12-05 18:27:19 +00:00
parent b10a45599b
commit 09239f98fa
3 changed files with 26 additions and 21 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ export function postAnswers(ans) {
(data) => {
console.log(data)
if (data.success) {
alert("Answers sucessfully submitted.");
alert(`${data.question_count} answers sucessfully submitted.`);
} else {
alert(`Error submitting answers: ${data.error}`);
}
+17 -14
View File
@@ -1748,22 +1748,25 @@ $(".start-packet-button").click(function (evt) {
window.timer = timer;
$("#timer").click(() => {
window.timer.pause();
// If we are not in an exam we can pause the session
if (!window.exam_mode) {
$("#timer").click(() => {
window.timer.pause();
let time_remaining = window.timer.getTimeValues().toString();
let time_remaining = window.timer.getTimeValues().toString();
$("#pause").empty();
$("#pause").append(
$(
`<div id="pause-text">Session paused<div id="pause-time-remaining">You have ${time_remaining} remaining.</div></div><button id="resume-exam-button" class="navigation dialog-yes">Click to resume</button>`
).click(() => {
$("#pause").hide();
timer.start();
})
);
$("#pause").show();
});
$("#pause").empty();
$("#pause").append(
$(
`<div id="pause-text">Session paused<div id="pause-time-remaining">You have ${time_remaining} remaining.</div></div><button id="resume-exam-button" class="navigation dialog-yes">Click to resume</button>`
).click(() => {
$("#pause").hide();
timer.start();
})
);
$("#pause").show();
});
}
// //const t = 2;
// let display = document.querySelector("#timer");
+8 -6
View File
@@ -20,7 +20,11 @@ export function loadMainImage(image, stack) {
cornerstoneTools.addToolState(element, "stack", stack);
cornerstoneTools.addTool(PanTool);
cornerstoneTools.addTool(ZoomTool);
cornerstoneTools.addTool(ZoomTool, {
configuration: {
invert: true,
},
});
cornerstoneTools.addTool(WwwcTool);
cornerstoneTools.addTool(RotateTool);
cornerstoneTools.addTool(StackScrollTool);
@@ -503,11 +507,7 @@ export function openMainImage(current_question, t, source) {
} else if (data_url.startsWith("data:application/dicom")) {
// stack = stack.split(";")[1];
const dfile = await urltoFile(
data_url,
"dicom",
"application/dicom"
);
const dfile = await urltoFile(data_url, "dicom", "application/dicom");
const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(
dfile
@@ -535,6 +535,8 @@ export function openMainImage(current_question, t, source) {
if (open_figure != undefined) {
// No full size figure / dicom loaded yet
if (figure_to_load == open_figure) {
// Scroll to the image if it is already open
document.getElementById("dicom-image").scrollIntoView();
return;
} else {
let el;