Skip to content
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
6 changes: 4 additions & 2 deletions runestone/assess/js/fitb.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ FITB.prototype.checkLocalStorage = function () {
$(this.blankArray[i]).attr("value", arr[i]);
}
if (this.useRunestoneServices) {
this.logBookEvent({"event": "fillb", "act": "submitFITB", "answer": storedData.answer.join(","), "correct": storedData.correct, "div_id": this.divid});
var answer = storedData.answer.join(",")
this.logBookEvent({"event": "fillb", "act": answer, "answer": answer, "correct": storedData.correct, "div_id": this.divid});
this.enableCompareButton();
}
}
Expand Down Expand Up @@ -250,7 +251,8 @@ FITB.prototype.startEvaluation = function (logFlag) {
this.evaluateAnswers();
this.renderFITBFeedback();
if (logFlag) { // Sometimes we don't want to log the answer--for example, when timed exam questions are re-loaded
this.logBookEvent({"event": "fillb", "act": "submitFITB", "answer": this.given_arr.join(","), "correct": (this.correct ? "T" : "F"), "div_id": this.divid});
var answer = this.given_arr.join(",");
this.logBookEvent({"event": "fillb", "act": answer, "answer":answer, "correct": (this.correct ? "T" : "F"), "div_id": this.divid});
}
if (this.useRunestoneServices) {
this.enableCompareButton();
Expand Down
6 changes: 4 additions & 2 deletions runestone/assess/js/mchoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ MultipleChoice.prototype.scoreMCMASubmission = function () {
MultipleChoice.prototype.logMCMAsubmission = function (data) {
var answer = data.answer;
var correct = data.correct;
this.logBookEvent({"event": "mChoice", "act": "submitMC", "answer": answer, "correct": correct, "div_id": this.divid});
var logAnswer = "answer:" + answer + ":" + (correct == "T" ? "correct" : "no");
this.logBookEvent({"event": "mChoice", "act": logAnswer, "answer":answer, "correct": correct, "div_id": this.divid});
};


Expand Down Expand Up @@ -439,7 +440,8 @@ MultipleChoice.prototype.scoreMCMFSubmission = function () {
MultipleChoice.prototype.logMCMFsubmission = function () {
var answer = this.givenArray[0];
var correct = (this.givenArray[0] == this.correctIndexList[0] ? "T" : "F");
this.logBookEvent({"event": "mChoice", "act": "submitMC", "answer": answer, "correct": correct, "div_id": this.divid});
var logAnswer = "answer:" + answer + ":" + (correct == "T" ? "correct" : "no"); // backward compatible
this.logBookEvent({"event": "mChoice", "act": logAnswer, "answer": answer, "correct": correct, "div_id": this.divid});
};

MultipleChoice.prototype.renderMCMFFeedback = function (correct, feedbackText) {
Expand Down
4 changes: 2 additions & 2 deletions runestone/common/js/runestonebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RunestoneBase.prototype.logBookEvent = function (eventInfo) {
if (eBookConfig.useRunestoneServices && eBookConfig.logLevel > 0) {
jQuery.get(eBookConfig.ajaxURL + 'hsblog', eventInfo); // Log the run event
}
console.log("logging event " + eventInfo);
console.log("logging event " + JSON.stringify(eventInfo));
};

RunestoneBase.prototype.logRunEvent = function (eventInfo) {
Expand All @@ -18,7 +18,7 @@ RunestoneBase.prototype.logRunEvent = function (eventInfo) {
if (eBookConfig.useRunestoneServices && eBookConfig.logLevel > 0) {
jQuery.post(eBookConfig.ajaxURL + 'runlog', eventInfo); // Log the run event
}
console.log("running " + eventInfo);
console.log("running " + JSON.stringify(eventInfo));
};

/* Checking/loading from storage */
Expand Down
6 changes: 4 additions & 2 deletions runestone/dragndrop/js/dragndrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ DragNDrop.prototype.dragEval = function (logFlag) {
this.setLocalStorage({"correct": (this.correct ? "T" : "F")});
this.renderFeedback();
if (logFlag) // Sometimes we don't want to log the answers--for example, on re-load of a timed exam
this.logBookEvent({"event": "dragNdrop", "act": "submitDND", "answer": this.pregnantIndexArray.join(";"), "minHeight": this.minheight, "div_id": this.divid, "correct": this.correct});
var answer = this.pregnantIndexArray.join(";");
this.logBookEvent({"event": "dragNdrop", "act": answer, "answer":answer, "minHeight": this.minheight, "div_id": this.divid, "correct": this.correct});
};

DragNDrop.prototype.renderFeedback = function () {
Expand Down Expand Up @@ -374,7 +375,8 @@ DragNDrop.prototype.checkLocalStorage = function () {
this.pregnantIndexArray = storedObj.answer.split(";");
if (this.useRunestoneServices) {
// store answer in database
this.logBookEvent({"event": "dragNdrop", "act": "submitDND", "answer": this.pregnantIndexArray.join(";"), "minHeight": this.minheight, "div_id": this.divid, "correct": storedObj.correct});
var answer = this.pregnantIndexArray.join(";");
this.logBookEvent({"event": "dragNdrop", "act": answer, "answer":answer, "minHeight": this.minheight, "div_id": this.divid, "correct": storedObj.correct});
}
}
}
Expand Down