display answers on a failed sumbit

This commit is contained in:
Ross
2021-01-04 10:45:35 +00:00
parent 5310cd6dd0
commit c21bf8806a
+15
View File
@@ -61,6 +61,21 @@ export function postAnswers(ans) {
} }
} else { } else {
alert(`Error submitting answers: ${data.error}`); alert(`Error submitting answers: ${data.error}`);
var docHeight = $(document).height();
$("body").append(`<div id='overlay'><p>A copy of your answers are displayed below. Please refresh this page to continue.</p>${ans}</div>`);
$("#overlay")
.height(docHeight)
.css({
'opacity' : 0.4,
'position': 'absolute',
'top': 0,
'left': 0,
'background-color': 'black',
'width': '100%',
'z-index': 5000
});
} }
}); });
// $.post( "http://localhost:8000/submit_answers", JSON.stringify(ans)); // $.post( "http://localhost:8000/submit_answers", JSON.stringify(ans));