diff --git a/runestone/assess/js/timed.js b/runestone/assess/js/timed.js index d2cdcb610..a8855e3ee 100644 --- a/runestone/assess/js/timed.js +++ b/runestone/assess/js/timed.js @@ -260,7 +260,9 @@ Timed.prototype.renderSubmitButton = function () { }); this.finishButton.textContent = "Finish Exam"; this.finishButton.addEventListener("click", function () { - this.finishAssessment(); + if (window.confirm("Clicking OK means you are ready to submit your answers and are finished with this assessment.")) { + this.finishAssessment(); + } }.bind(this), false); this.buttonContainer.appendChild(this.finishButton); @@ -361,6 +363,8 @@ Timed.prototype.handlePrevAssessment = function () { Timed.prototype.startAssessment = function () { if (!this.taken) { + $("#relations-next").hide(); // hide the next page button for now + $("#relations-prev").hide(); // hide the previous button for now $(this.startBtn).hide(); $(this.pauseBtn).attr("disabled", false); if (this.running === 0 && this.paused === 0) { @@ -455,6 +459,7 @@ Timed.prototype.increment = function () { // increments the timer this.done = 1; if (this.taken === 0) { this.taken = 1; + window.alert("Sorry, but you ran out of time. Your current answers have been saved"); this.finishAssessment(); } } @@ -506,7 +511,6 @@ Timed.prototype.tookTimedExam = function () { }; Timed.prototype.finishAssessment = function () { - if (window.confirm("Clicking OK means you are ready to submit your answers and are finished with this assessment.")) { this.findTimeTaken(); this.running = 0; this.done = 1; @@ -523,7 +527,8 @@ Timed.prototype.finishAssessment = function () { $(this.timedDiv).hide(); $(this.pauseBtn).hide(); } - } + $("#relations-next").show(); // show the next page button for now + $("#relations-prev").show(); // show the previous button for now }; Timed.prototype.submitTimedProblems = function (logFlag) { diff --git a/runestone/shortanswer/js/shortanswer.js b/runestone/shortanswer/js/shortanswer.js index 936462025..53a68d9f3 100644 --- a/runestone/shortanswer/js/shortanswer.js +++ b/runestone/shortanswer/js/shortanswer.js @@ -86,6 +86,9 @@ ShortAnswer.prototype.renderHTML = function() { this.jTextArea.rows = 4; this.jTextArea.cols = 50; this.jLabel.appendChild(this.jTextArea); + this.jTextArea.oninput = function () { + this.feedbackDiv.innerHTML = "Your answer has not been saved yet!"; + }.bind(this); this.fieldSet.appendChild(document.createElement("br")); @@ -93,7 +96,7 @@ ShortAnswer.prototype.renderHTML = function() { this.fieldSet.appendChild(this.buttonDiv); this.submitButton = document.createElement("button"); - $(this.submitButton).addClass("btn btn-default"); + $(this.submitButton).addClass("btn btn-success"); this.submitButton.type = "button"; this.submitButton.textContent = "Save"; this.submitButton.onclick = function () { @@ -134,6 +137,7 @@ ShortAnswer.prototype.submitJournal = function () { console.log(data.message); }); */ this.logBookEvent({'event': 'shortanswer', 'act': JSON.stringify(value), 'div_id': this.divid}); + this.feedbackDiv.innerHTML = "Your answer has been saved, but the instructor has not had a chance to provide a comment yet."; }; ShortAnswer.prototype.loadJournal = function () {