diff --git a/js/interact.js b/js/interact.js index c0346e2..0a9222c 100644 --- a/js/interact.js +++ b/js/interact.js @@ -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}`); } diff --git a/js/main.js b/js/main.js index 6304da5..7bf5c09 100644 --- a/js/main.js +++ b/js/main.js @@ -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( - $( - `
Session paused
You have ${time_remaining} remaining.
` - ).click(() => { - $("#pause").hide(); - timer.start(); - }) - ); - $("#pause").show(); - }); + $("#pause").empty(); + $("#pause").append( + $( + `
Session paused
You have ${time_remaining} remaining.
` + ).click(() => { + $("#pause").hide(); + timer.start(); + }) + ); + $("#pause").show(); + }); + } // //const t = 2; // let display = document.querySelector("#timer"); diff --git a/js/viewer.js b/js/viewer.js index b756a35..ee18992 100644 --- a/js/viewer.js +++ b/js/viewer.js @@ -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;