From 0377be474b46e38b26e3e11575c7555ff6db68e1 Mon Sep 17 00:00:00 2001 From: ericsonga Date: Wed, 8 Jun 2016 14:30:47 -0400 Subject: [PATCH 1/3] Changes to short answer to improve the user interface Made the save button green and change the feedback text to tell you if you need to save or have saved. --- runestone/shortanswer/js/shortanswer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 () { From 3e9c52c45dfe97cd08b248fd9b2ee0fa25074fd3 Mon Sep 17 00:00:00 2001 From: ericsonga Date: Wed, 8 Jun 2016 15:06:59 -0400 Subject: [PATCH 2/3] Fix to not ask if you want to submit when you run out of time The timed exam was asking if you wanted to submit when you had run out of time. I changed it to tell you that you ran out of time and your answers have been saved. It still asks if you want to submit if you clicked the button to finish the exam. --- runestone/assess/js/timed.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runestone/assess/js/timed.js b/runestone/assess/js/timed.js index d2cdcb610..a54da88df 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); @@ -455,6 +457,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 +509,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 +525,6 @@ Timed.prototype.finishAssessment = function () { $(this.timedDiv).hide(); $(this.pauseBtn).hide(); } - } }; Timed.prototype.submitTimedProblems = function (logFlag) { From 7e61a15e22df3fa6adea254234e0fa5670a6479b Mon Sep 17 00:00:00 2001 From: ericsonga Date: Wed, 8 Jun 2016 15:44:58 -0400 Subject: [PATCH 3/3] Try to solve the problem of people accidentally clicking the next page or previous page button during a timed exam Once a timed exam starts hide the next and previous page arrows and show them again after you finish the timed exam. --- runestone/assess/js/timed.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runestone/assess/js/timed.js b/runestone/assess/js/timed.js index a54da88df..a8855e3ee 100644 --- a/runestone/assess/js/timed.js +++ b/runestone/assess/js/timed.js @@ -363,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) { @@ -525,6 +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) {