webpackJsonp([1],{ /***/ 15: /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(6); /***/ }), /***/ 6: /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable no-unused-vars */ /* eslint-disable require-jsdoc */ /* eslint-disable prefer-rest-params */ /* eslint-disable prefer-spread */ var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; // detect iOS (VoiceOver) var isAndroid = /(android)/i.test(navigator.userAgent); // detect Android (TalkBack) var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; // detect Firefox (NVDA) // var isIE =/MSIE |Trident\//.test(navigator.userAgent); // detect IE (Jaws) var Activity_manuscript = Activity.extend({ get_question_number: function (q) { // always use q.index here return q.index; }, submit_question: function (question_index_obj) { var curSection = player.section_currently_showing; var s = player.sections[curSection]; var curQuestion = $(this).closest('[data-type=question]'); // curQuestion.find('.question_action_div').attr('aria-hidden', 'true'); curQuestion.append('
'); var focusElement = $('.focus-element'); focusElement.focus(); // if we're on the last page and user has answered all queries, show completion message if (player.showing_last_section() && player.activity.answered_all_queries) { player.show_completion_message(); } var question_index; // the arg may be a number or an event object; in the latter case... if (typeof question_index_obj == 'object') { // extract the question_index from the object question_index = question_index_obj.data.question_index; } else { question_index = question_index_obj; } setTimeout(function () { player.activity.questions[question_index].checkModelUpdateConditionals(question_index); }, 0); this._super(question_index_obj); var $question = s.jq.find('[data-question_index="' + question_index + '"]'); var $feedback_part = $question.find('.query_mc_feedback_correct_incorrect'); var $feedback_part_check = $question.find('.question_feedback_part'); var incorrect = ''; if ($feedback_part[0] || $feedback_part_check[0]) { var queries = player.activity.questions[question_index].queries; for (var i = 0; i < queries.length; i++) { if (queries[i].user_answer_index !== queries[i].correct_answer_index) { incorrect = 'Incorrect. '; break; } } } var $essayFeedback = $question.find('.essay_question_evaulation_feedback'); var $pointsFeedback = $question.find('.points_awarded_div'); var provisional = curQuestion.find('.points_awarded_div a'); $('.points_awarded_div a').attr({'tabindex': '0'}).keyup(function (e) { e.preventDefault(); if ((e.keyCode || e.which) === 32) { player.activity.explain_provisional(provisional); } }).attr({ 'role': 'button' }).removeAttr('href').click(function (e) { e.preventDefault(); player.activity.explain_provisional(provisional); }); if (provisional.length > 0) { provisional.focus(); } setTimeout(function () { $('#liveRegion').text('Feedback. ' + incorrect + $feedback_part.text() + $feedback_part_check.text() + ' ' + $essayFeedback.text() + ' ' + $pointsFeedback.text()); }); // focusElement.remove(); // curQuestion.append(''); // var nextFocusElement = $('.focus-element'); // nextFocusElement.focus(); // nextFocusElement.remove(); if (player.activity.answered_all_queries) { Standard_Dialog.open('Congratulations! You’ve completed this activity.'); } }, show_grade_saved_message: function () { this._super(); // if activity is complete, show the completion div // (in addition to doing an alert, which super does) if (player.activity.answered_all_queries) { player.user_has_received_completion_alert = true; $('#grade_submitted_message').show(); } }, explain_provisional: function (from) { Standard_Dialog.open('This grade may be changed by your instructor after reviewing your answer.', { 'from': from, 'modal': false, 'buttons': 'OK' }); } }); Question = Question.extend({ init: function () { this._super.apply(this, arguments); /* bruce if (this.md["randomize-choices"]) { CB_Shuffle.shuffle(this.jq); } */ }, extract_metadata: function () { if (this.jq == null) { return; } this.md.add_from_jq(this.jq.children('[data-type=metadata]')); player.processNextStepConditionals(this); player.processModelUpdateConditionals(this); }, checkModelUpdateConditionals: function (question_index) { var q_string = 'player.activity.questions[' + question_index + ']'; for (var i = 0; i < player.activity.questions[question_index].md.model_update_conditional.length; ++i) { var c = player.activity.questions[question_index].md.model_update_conditional[i]; var condition = c.condition.replace(/qq/g, q_string); condition = condition.replace(/model/g, 'player.model'); var updateStatement = c.updateStatement.replace(/setModel/g, 'player.setModel'); updateStatement = updateStatement.replace(/model/g, 'player.model'); updateStatement = updateStatement.replace(/qq/g, q_string); updateStatement = unescape(updateStatement); condition = unescape(condition); condition = condition.replace(/&/g, '&'); if (condition == 'else' || eval(condition) == true) { // if section_to_show is "done", we're done! // safe_log("triggering model update from question"); eval(updateStatement); } } return null; } }); var Player_manuscript = Player.extend({ model: {}, tabs: null, tab_numbers: [], restore_section: function () { // safe_log("restore_section"); // this should only be called if ARGA is initialized var lvs = Get_ARGA_Data('LVSX'); var las = Get_ARGA_Data('LASX'); // if we have a previously-stored LVS, show it now if (lvs != '' && las != '') { this.last_available_section = las * 1; // safe_log("calling show_section, passing " + lvs); this.show_section(lvs * 1); // go to the correct page on tab // safe_log("setting last page"); var curr_tab = this.tab_numbers[lvs]; lvs = lvs * 1; // safe_log("curr_tab = " + curr_tab); // find the first section for this tab var first_section = 0; for (var i=0; i,
// but we don't need this label
if (qt !== '_') {
return '
';
}
else {
return '';
}
}
else {
return '';
}
},
getHTML: function (mode) {
// start with the query text, if there
var html = this.query_text_html();
var val, disabled;
if (!this.userHasAnswered() || mode == 'preview') {
val = '';
disabled = '';
// otherwise we have an answer, so fill it in
}
else {
// make sure we convert double quotes to " for placement in 'value="xxx"' attributes
val = this.user_answer;
// convert breaks to newlines
val = val.replace(/
/g, '\n');
// also disable the input if we're not in review_correct_incorrect mode
if (mode != 'review_correct_incorrect') {
disabled = 'disabled';
}
}
var labelId = 'textarea_description_question_' + this.query_index;
if (this.query_text === '_') {
labelId = this.jq.closest('[data-type=question]').find('p').attr('id');
}
// Add short label for mobile devices
var labelledBy = (isAndroid || iOS) ? ' aria-label="Enter your answer for the question"' :
' aria-labelledby="' + labelId + '"';
html +=
'';
// if answer was just entered and grade is 100, also show the "provisional" message
// (unless for this question it isn't provisional)
if (this.answer_was_just_entered && this.grade == 100 && this.md.points_are_provisional == 'true') {
html +=
'