From 1d6ffc0b718c460d5f9647c9263f047b5e0f470c Mon Sep 17 00:00:00 2001
From: Ross ' +
display_n +
- '.3Principle Diagnosis
' +
@@ -656,7 +656,10 @@ function loadQuestion(n, section = 1, force_reload = false) {
.eq(parseInt(answer.qidn) - 1)
.text(answer.ans);
}
- // markAnswer(qid, "anatomy");
+ // We only want to mark once...
+ if (qidn_count == 5) {
+ markAnswer(qid, current_question);
+ }
})
.catch(function (error) {
console.log(error);
@@ -773,7 +776,7 @@ function createQuestionListPanel() {
* @param {number} qidn - question section number
* @return {*} el - element that has been created
*/
- function appendReviewItem(n, qidn) {
+ function appendQuestionListItem(n, qidn) {
const qn = n - 1;
const el = $(
'"
+ );
+
+ const model_answers = window.questions[qid].answers;
+
+ const titles = [
+ "Observations",
+ "Interpretation",
+ "Principal Diagnosis",
+ "Differential Diagnosis",
+ "Management",
+ ];
+
+ let user_li = $(
+ `#review-answer-${qid} span .user-review-answer-list`
+ );
+ let model_li = $(
+ `#review-answer-${qid} span .model-review-answer-list`
+ );
+
+ user_li.append("
" + title + "
" + user_answer
+ );
+ model_li.append(
+ `` +
+ title +
+ "
" +
+ model_answers[0][title.toLowerCase()]
+ );
+ });
+
+ return;
+ }
db.user_answers
.get({ qid: qid })
.then(function (answers) {
@@ -1385,8 +1435,6 @@ function reviewQuestions() {
* @param {*} current_question -
*/
function markAnswer(qid, current_question) {
- console.log("mark", qid);
-
const type = current_question.type;
let option = null;
@@ -1407,9 +1455,20 @@ function markAnswer(qid, current_question) {
}
// If answer is normal we have nothing else to add.
addFeedback(current_question);
+ return;
}
}
+ if (type == "long") {
+ // For long cases we simple disable the texareas and append the
+ // model answers
+ const model_answers = current_question.answers[0];
+ for (let key of Object.keys(model_answers)) {
+ $("textarea[name*='" + key + "' i]").after(model_answers[key]);
+ }
+ return;
+ }
+
$(".answer-panel").append(
"