Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions runestone/assess/js/timed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion runestone/shortanswer/js/shortanswer.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,17 @@ 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"));

this.buttonDiv = document.createElement("div");
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 () {
Expand Down Expand Up @@ -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 () {
Expand Down