MC_Query = MC_Query.extend({ // mode should be "delivery" or "review"; "delivery" is assumed getHTML: function (mode) { // initialize imagemap elements if (this.imagemap_initialized === false) { var question_jq = this.jq.parent(); this.im_init(question_jq); this.imagemap_initialized = true; } // start with the query text, if there var html = this.query_text_html(); // wrap answers in a p tag html += "
"; // Build answer selection var is_correct = false; for (var z = 0; z < this.choices.length; z++) { var index = this.choice_order[z]; // if this is review mode... var checked = ""; var disabled = ""; var radio_style = "query_mc_other_choice"; if (mode == 'review' || mode == 'review_correct_incorrect' || mode == 'preview') { // if it's the correct choice, it should be marked in green if (index == this.correct_answer_index) { // but only if we're *not* in review_correct_incorrect mode or this is the user's choice if (mode != 'review_correct_incorrect' || index == this.user_answer_index) { radio_style = "query_mc_correct_choice"; } // if this is what the user chose, he got it correct if (index == this.user_answer_index) { is_correct = true; } // else if it's the user's choice (and this.md.no_correct_answer is not true), it should be marked in red } else if (index == this.user_answer_index && this.md.no_correct_answer != "true") { radio_style = "query_mc_incorrect_user_choice"; } // and the input should be disabled, unless we're in review_correct_incorrect mode if (mode != "review_correct_incorrect") { disabled = "disabled"; } } // if this is the choice the user clicked, it's checked (regardless of mode) if (index == this.user_answer_index) { checked = "checked"; } // Create radio button input plus label html += "
"
+ " | "
//+ "" + this.choice_ids[z] + ". | " + "" + " |