This commit is contained in:
Ross
2020-10-20 11:42:15 +01:00
4 changed files with 123 additions and 13 deletions
+8 -4
View File
@@ -15,12 +15,16 @@ function submitAnswers() {
* @param {*} ans - json representation of answers
*/
function postAnswers(ans) {
console.log(ans);
$("#progress").html(`Submitting answers...`);
// ans = {"test" : 1}
$.post("http://localhost:8000/submit_answers", JSON.stringify(ans)).done(
$.post(window.config.exam_submit_url, JSON.stringify(ans)).done(
(data) => {
console.log(data);
console.log(data)
if (data.success) {
alert("Answers sucessfully submitted.");
} else {
alert(`Error submitting answers: ${data.error}`);
}
);
});
// $.post( "http://localhost:8000/submit_answers", JSON.stringify(ans));
}