" + this.feedbackTitle + "
";
var html = "
Question " + question.index + " " + this.feedbackTitle + "
";
// if this is an MC question then get specific feeback for answer
if (question.queries[0].getQueryTypeForARGA() == "multiple choice") {
html += question.queries[0].correct_incorrect_feedback(null, is_correct);
}
// include correct feedback if there and the answer is correct
if (is_correct && question.md.feedback_correct) {
if (question.queries[0].getQueryTypeForARGA() == "multiple choice") {
html += "
" + question.md.feedback_correct + " The answer is " + question.queries[0].choice_ids[question.queries[0].correct_answer_index] + ".
";
}
else {
html += "
" + question.md.feedback_correct + "
";
}
}
// include incorrect or hint feedback if there and the answer is incorrect
if (!is_correct) {
var found_feedback_string = false;
// if user gets to try again...
if (try_again) {
// check for feedback_conditional's
if (question.md.feedback_conditional.length > 0) {
for (var i in question.md.feedback_conditional) {
var fbc = question.check_conditional(question.md.feedback_conditional[i]);
if (fbc != "") {
html += "
" + fbc + "
";
found_feedback_string = true;
break;
}
}
}
// if we didn't find a feedback string to use above, check
// for feedback_hint
/*
if (!found_feedback_string && question.md.feedback_hint) {
html += "
" + question.md.feedback_hint + "
";
found_feedback_string = true;
}
*/
}
// if we didn't find a feedback string to use above, check for
// feedback_incorrect
if (!found_feedback_string && question.md.feedback_incorrect) {
if (question.queries[0].getQueryTypeForARGA() == "multiple choice") {
html += "
" + question.md.feedback_incorrect + " The correct answer is " + question.queries[0].choice_ids[question.queries[0].correct_answer_index] /*+ ". You answered " + question.queries[0].choice_ids[question.queries[0].user_answer_index]*/ + ".
";
}
else {
html += "
" + question.md.feedback_incorrect + "
";
}
}
}
// include general feedback if there
if (question.md.feedback) {
html += "
" + question.md.feedback + "
";
}
// brb: Do we need to display points?
//html += player.activity.get_points_awarded_html(question.index);
// close question_feedback div
html += "
";
// brb: use display_feedback_mesg to add feedback to question
// append the div, then fade it in
/*
$("#question_action_div_" + question.index).prepend(html);
$("#question_feedback_" + question.index).fadeIn("fast", function() {
//$(this).css("display", "table");
});
*/
question.display_feedback_mesg(html);
},
submit_question: function(question_index){
safe_log("submit_question");
// the arg may be a number or an event object; in the latter case...
if (typeof question_index == "object") {
// extract the question_index from the object
question_index = question_index.data.question_index;
}
var question = player.activity.questions[question_index];
//force all queries to be answered before doing anything
for (var i=0; i < player.activity.questions[question_index].queries.length; i++) {
var query = player.activity.questions[question_index].queries[i];
var answered = query.user_has_answered();
if (!answered) {
question.display_alert_mesg();
return false;
}
}
safe_log("all queries have been answered");
// if we made it here then remove any alert messages
question.remove_alert_mesg();
this._super(question_index);
// set focus on feedback
var $fb_div = $("#question_" + question_index + "_fb_mesg");
if ($fb_div) {
$fb_div.attr("role","alert");
$fb_div.focus();
}
return false;
// brb: hide submit button
//player.activity.hide_submit_button(question_index);
},
hide_submit_button: function(q_idx) {
var $submit_button = $("#question_submit_button_" + q_idx);
$submit_button.attr('aria-disabled','true').attr('disabled','disabled').addClass('visually-hidden');
$submit_button.parent().addClass('visually-hidden');
},
ARGA_initialization_final: function(decision) {
this._super();
Standard_Dialog.close();
},
/* brb: need to override this method so we can remove the grade percentage
from the completed message pop-up */
ARGA_initialization_alert: function() {
// This overrides the standard ARGA initialization message, which doesn't
// tell the user he/she can resubmit (or tell him his grade)
// brb: get the correct arga grade (also, see first "if" below)
//var grade = Get_ARGA_Grade();
var grade = Get_Correct_ARGA_Grade();
var due_date_passed = (Get_ARGA_Data("due_date_has_passed") == "1");
var msg = "";
var buttons;
due_date_passed = false;
// brb: first comparison must use strict equality otherwise "" is converted
// to 0 which will return false if grade is actually 0
if (grade !== "" && grade != null && grade >= 0) {
// if resubmissions are allowed...
if (player.md.allow_resubmission == "true") {
// if due date has not passed, give the student the option of resubmitting or reviewing
if (!due_date_passed) {
msg = "You have completed this activity, and your grade (" + grade + "%) has been submitted. Would you like to:
You have completed this activity, and your grade (" + grade + "%) has been submitted. Since the due date for the activity has now passed, you cannot re-submit answers to the activity questions.
"
buttons = [ {text:"OK", click: player.activity.ARGA_initialization_final} ];
}
// resubmissions are not allowed
} else {
// brb: Don't show grade percentage in this message since the
// instructor may have manually changed the grade in the grade
// book and we currently have no way of knowing what it is.
msg = "You have completed this activity.
"
;
buttons = [ {text:"OK", click: player.activity.ARGA_initialization_final} ];
}
// grade has not been submitted
} else {
// if due date has passed, tell the user "tough luck". Otherwise show nothing.
if (due_date_passed) {
msg = "The due date for this activity has passed. You can still review the activity, but no answers will be submitted and no grade will be recorded.
"
;
buttons = [ {text:"OK", click: player.activity.ARGA_initialization_final} ];
}
}
// if we need a message, show it in a jquery UI dialog
if (msg != "") {
//msg = "