Instructions
'); // header for podcast $('#podcast_wrap').before('Podcast
'); // fix question headers $('[data-type="question"]').find('h3').each(function () { var $this = $(this); $this.find('[data-type="title"]').remove(); var title_html = $this.html(); title_html = title_html.replace('Question', 'Question'); title_html = title_html.replace(/>\d+\.(\d+)\s*, '>$1<'); title_html = title_html.replace(/>(\d+)\s*, '>$1<'); $this.html(title_html); }); // make each question a form $('[data-type="question"]').each(function () { $(this).changeElementType('form'); }); // wrap h2, question text for styling if needed $('h2+p.question_text').each(function () { $(this).prev().andSelf().wrapAll('You have completed this activity, and your grade (' + grade + '%) has been submitted. Would you like to:
- '
+ '
- Keep your current grade ' + 'and review your previous answers ' + '
- Or reset your submission and ' + 'try the activity again? ' + '
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: We can show the grade percentage since these are all MC questions msg = 'You have completed this activity.
'
+ 'Total Score: ' + grade + '%.
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 != '') { Standard_Dialog.alert(msg, {title: 'Please Note', buttons: buttons}); } else { player.activity.ARGA_initialization_final(); } }, // Redefine this so that the dialog will close (if opened) ARGA_initialization_final: function (decision) { // close dialog if open $('#standard_dialog_div').dialog('close'); if (decision == 'reset') { ARGA_API.data = []; Set_ARGA_Grade(-1); player.user_has_received_completion_alert = false; Save_ARGA_Data({'show_progress': false}); // start on section 0 player.show_section(0); // else if user is here for the first time... } else if (player.ARGA_submission_initialized == false) { // initialize the questions player.activity.ARGA_Initialize_Questions(); // and show the first questions player.show_section(0); // otherwise normal re-initialization } else { // restore all saved answers if (player.md.restore_previous_submissions == 'true') { player.activity.restore_saved_answers(); } // grade the activity player.activity.grade_activity(); // set user_has_received_completion_alert to true // if the user has already completed the activity if (Get_ARGA_Data('complete') == 'yes') { player.user_has_received_completion_alert = true; } // restore to previously-viewed section if appropriate if (player.md.restore_last_viewed_section == 'true') { player.restore_section(); // otherwise show section 0 } else { player.show_section(0); } } }, question_submit_button: function (q) { var button_html = ''; return button_html; }, get_points_awarded_html: function (question_index) { var question = this.questions[question_index]; // calculate points_awarded and points_possible var points_awarded = 0; var points_possible = 0; var points_provisional = false; for (var i = 0; i < question.queries.length; ++i) { var query = question.queries[i]; points_awarded += query.getPointsAwarded(); points_possible += query.getPointsPossible(); if (query.pointsAreProvisional() == true) { points_provisional = true; } } // round to at most two decimal places points_awarded = Math.round(points_awarded * 100) / 100; points_possible = Math.round(points_possible * 100) / 100; var points_html = 'Points awarded: ' + points_awarded + ' out of ' + points_possible; if (points_provisional) { points_html += ' ' + '(' + 'provisional)'; } points_html += ''; return points_html; }, show_question_feedback: function (question, is_correct, try_again) { safe_log('show_question_feedback()'); // remove prior feedback if there $('#question_feedback_' + question.index).remove(); // if question is not answered correctly and they get to try again, show // hint above question if (!is_correct && try_again) { var hint_mesg = ''; if (question.queries[0].getQueryTypeForARGA() === 'multiple choice' && question.queries[0].choices_hint[question.queries[0]. user_answer_index]) { hint_mesg += question.queries[0].choices_hint[question. queries[0].user_answer_index] + ' '; } else if (question.md.feedback_hint) { hint_mesg += question.md.feedback_hint + ' '; } question.display_alert_mesg(hint_mesg, 'hint'); return; } // if this is an MC question then get specific feeback for answer var mc_fb = ''; if (question.queries[0].getQueryTypeForARGA() == 'multiple choice') { mc_fb = question.queries[0].correct_incorrect_feedback(null, is_correct); } // brb: If this is an essay question the we want to show the // provisional disclaimer if (question.queries[0].getQueryTypeForARGA() == 'essay') { question.md.feedback_correct = "Your answer has been provisionally accepted. You'll get full credit for now, but your instructor may update your grade later after evaluating it."; } // if we don't have any feedback at all, return if (!question.md.feedback && !question.md.feedback_correct && !question.md.feedback_incorrect && !question.md.feedback_hint && mc_fb === '') { // return; if (is_correct) { question.md.feedback_correct = 'Correct!'; } else { question.md.feedback_incorrect = 'Incorrect.'; } } 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 += 'Activity Completed
' + completion_text + '
/g, '\n'); // Also disable the input if we're not in review_correct_incorrect mode disabled = (mode !== 'review_correct_incorrect') ? 'disabled' : ''; } // var queryTextId = 'query_text'; // var feedbackId = 'essay_question_evaluation_feedback_' + // this.query_index + ' question_feedback_' + (this.query_index + 1); var labelledBy=' aria-labelledby=query_text_' + this.query_index; /* var labelledBy = (platform.android || platform.ios) ? ' aria-labelledby="' + feedbackId + ' ' + queryTextId + '"' : ' aria-labelledby="' + queryTextId + '"'; */ html += ''; if (this.answer_was_just_entered && this.grade == 100 && this.md.points_are_provisional == 'true') { /* html += '
text = jQuery.trim(text).replace(/\n/g, '
'); var id = 'query_text_' + this.query_index; // Old comment in sciam project by someone: // "I don't know why question for textarea was changed by _ // and actual question is placed before textarea just in
, // but we don't need this label" if (text !== '_') { return '
// NO: we're doing this in getHTML instead now // this.query_text = this.query_text.replace(/\n/g, '
'); }, correct_incorrect_feedback: function (mode, is_correct) { var html = ''; // get correct answer as presented to user for (var i = 0; i < this.choices.length; ++i) { if (this.choice_order[i] == this.correct_answer_index) { break; } } if (this.user_answer_index != null && this.choices_fb[this.user_answer_index] != null) { html += this.choices_fb[this.user_answer_index]; } // now, if we got any feedback, enclose it in a div if (html != '') { html = '' + html + ''; } return html; }, getHTML: function (mode) { var platform = __webpack_require__(0).run_on; // 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 = ''; if (fieldset_disabled) { html = '