diff --git a/js/interact.js b/js/interact.js index 2fffba3..cefee76 100644 --- a/js/interact.js +++ b/js/interact.js @@ -61,7 +61,25 @@ export function postAnswers(ans) { } } else { alert(`Error submitting answers: ${data.error}`); - } - }); - // $.post( "http://localhost:8000/submit_answers", JSON.stringify(ans)); + var docHeight = $(document).height(); + + $("body").append(`

An error has occured when submit your answers. A copy of your answers are displayed below, you may wish to save a copy. Please refresh this page to continue.

${JSON.stringify(ans)}
`); + + $("#overlay") + .height(docHeight) + .css({ + 'opacity' : 0.9, + 'position': 'absolute', + 'top': 0, + 'left': 0, + 'background-color': 'black', + 'width': '100%', + 'user-select': 'text', + '-moz-user-select': 'text', + '-webkit-user-select': 'text', + 'z-index': 5000 + }); + } + }); + // $.post( "http://localhost:8000/submit_answers", JSON.stringify(ans)); } diff --git a/js/main.js b/js/main.js index 7183492..9990670 100644 --- a/js/main.js +++ b/js/main.js @@ -53,13 +53,13 @@ function retrievePacketList() { url = window.config.exam_query_url; } - $.getJSON(url, function (data) { + $.ajax({dataType: "json", cache: false, url: url, success : function (data) { if (data.hasOwnProperty("exams")) { loadExamList(data); } else { loadPacketList(data); } - }) + },}) .done(function () {}) .fail(function () { $.getJSON("packets/packets.json", function (data) {