webpackJsonp([0],{
/***/ 114:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(4);
(function ($) {
$.fn.changeElementType = function (newType) {
var attrs = {};
$.each(this[0].attributes, function (idx, attr) {
attrs[attr.nodeName] = attr.nodeValue;
});
this.replaceWith(function () {
return $('<' + newType + '/>', attrs).append($(this).contents());
});
};
})(jQuery);
var Figures_subtype = __webpack_require__(228);
Figures = Figures_subtype;
Essay_Query = __webpack_require__(235);
// Question
Question = Question.extend({
// type = 'feedback' or 'points'
display_feedback_mesg: function (html, type) {
var $question = $('[data-question_index=' + this.index + ']');
var fb_mesg_id = 'question_' + this.index + '_fb_mesg';
// remove current fb
$('#' + fb_mesg_id).remove();
var $query_wrap = $('#query_wrap_' + this.index);
if ($query_wrap.length == 1) {
$query_wrap.append('
' + html + '
');
}
else {
$question.append('
' + html + '
');
}
// change the h3 question header to read 'completed'
var $h3 = $question.find('h3');
if (!/Completed/.test($h3.text())) {
var new_html = $h3.html() + ' [Completed]';
}
$h3.html(new_html);
},
remove_alert_mesg: function () {
var alert_mesg_id = 'question_' + this.index + '_alert_mesg';
$('#' + alert_mesg_id).remove();
},
display_alert_mesg: function (mesg, type) {
if (mesg === undefined || mesg === '') {
mesg = 'You must answer the question before submitting.';
}
if (type === undefined) {
type = 'error';
}
var $question = $('[data-question_index="' + this.index + '"]');
var alert_mesg_id = 'question_' + this.index + '_alert_mesg';
// remove current alert
$('#' + alert_mesg_id).remove();
var alert_mesg = '';
if (type === 'hint') {
alert_mesg += this.create_hint_mesg(mesg);
}
else if (type === 'manual') {
alert_mesg += mesg;
}
else {
alert_mesg += this.create_error_mesg(mesg);
}
var $query_wrap = $('#query_wrap_' + this.index);
if ($query_wrap.length == 1) {
$query_wrap.append('
' + alert_mesg + ' Please try again.
');
}
else {
$question.append('
' + alert_mesg + ' Please try again.
');
}
player.shadow_speech.talk(alert_mesg + ' Please try again.');
},
display_info_mesg: function (mesg) {
var $question = $('[data-question_index="' + this.index + '"]');
var alert_mesg_id = 'question_' + this.index + '_alert_mesg';
// remove current alert
$('#' + alert_mesg_id).remove();
var alert_mesg = mesg;
var $query_wrap = $('#query_wrap_' + this.index);
if ($query_wrap.length == 1) {
$query_wrap.append('
' + alert_mesg + '
');
}
else {
$question.append('
' + alert_mesg + '
');
}
player.shadow_speech.talk(alert_mesg);
},
create_error_mesg: function (mesg) {
return 'Submission error. ' + mesg;
},
create_hint_mesg: function (mesg) {
return 'Sorry, your answer is incorrect. ' + mesg;
}
});
// DD
DD_Query = __webpack_require__(234);
// FB
FB_Query = __webpack_require__(236);
MC_Query = __webpack_require__(230);
window.WebFontConfig = {
google: {families: [
'Open+Sans:400,300:latin', 'Montserrat:400,700:latin', 'Josefin+Slab:400,600,700:latin'
]}
};
(function () {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'https') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
// Dialog
window.Standard_Dialog = __webpack_require__(3);
var ConcretePlayer = __webpack_require__(231);
window.player = new ConcretePlayer();
/***/ }),
/***/ 223:
/***/ (function(module, exports) {
module.exports = {"global":{"inline_fitb":{"label":"answer input text field"},"inline_dd":{"label":"answer drop down select field"}}}
/***/ }),
/***/ 227:
/***/ (function(module, exports, __webpack_require__) {
var platform = __webpack_require__(0).run_on;
var Activity_subtype = Activity_manuscript_type.extend({
// bug fix for Get_ARGA_Grade() called in ARGA_initialization_alert()
Get_Correct_ARGA_Grade: function() {
if (!ARGA_API || ARGA_API.grade === null || ARGA_API.grade === "") {
return -1
}
else {
return ARGA_API.grade
}
},
/* 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 = this.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:
'
+ '
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: 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 = '
' + msg + '
';
$('body').append(msg);
$('#arga_init_dialog').dialog({
title: 'Please Note',
width: 450,
modal: true,
buttons: buttons
});
}
else {
player.activity.ARGA_initialization_final();
}
},
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, text) {
if (text !== undefined) {
text += ' ';
}
else {
text = '';
}
// 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);
}
// 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;
}
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 + '
';
}
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) {
if (question.md.feedback_conditional.hasOwnProperty(i)) {
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 we didn't find a feedback string to use above, check for
// feedback_incorrect
if (!found_feedback_string && question.md.feedback_incorrect) {
html += '
' + question.md.feedback_incorrect
+ 'Go through the answer to find out the correct one.
';
}
}
// include general feedback if there
if (question.md.feedback) {
html += '
' + text + question.md.feedback + '
';
if (question.queries[0].getQueryTypeForARGA() == 'essay') {
html += '
Please note: Your answer has been provisionally'
+ ' accepted. You will receive full credit at this time, but your instructor may update your grade'
+ ' later after evaluating your answer.
';
}
}
// brb: Do we need to display points?
// close question_feedback div
html += '';
// brb: use display_feedback_mesg to add feedback to question
// append the div, then fade it in
question.display_feedback_mesg(html);
},
restore_saved_answers: function () {
// skip page queries (questions[0])
for (var i = 1; i < this.questions.length; ++i) {
var question = this.questions[i];
// prepare for question_report_text questions
var query_responses;
if (question.md_set('question_report_text')) {
query_responses = '' + Get_ARGA_QuestionData(this.get_question_number(question));
query_responses = query_responses.split(this.query_responses_separator);
}
var restored_all_answers = true;
var all_answers_correct = true;
for (var j = 0; j < question.queries.length; ++j) {
var query = question.queries[j];
var saved_answer, saved_grade;
// get saved answer and grade out of the questionData for question_report_text questions
if (question.md_set('question_report_text')) {
if (query_responses[j] != null) {
var arr = query_responses[j].split(this.query_responses_grade_separator);
saved_answer = arr[0];
saved_grade = arr[1];
}
else {
saved_grade = saved_answer = '';
}
// or out of learnerResponse / questionData for single-query questions
}
else {
var ARGA_question_number = this.get_query_number(question, j);
saved_answer = Get_ARGA_LearnerResponse(ARGA_question_number);
// we stored the original grade in questionData
saved_grade = Get_ARGA_QuestionData(ARGA_question_number);
}
// if we found a grade...
if (saved_grade !== '' && saved_grade >= 0) {
// restore the answer
query.restoreAnswerFromARGA(saved_answer);
query.setGrade(saved_grade);
// then re-render the query in review mode
query.jq.html(query.getHTML('review'));
if (query.isCorrect() == false) {
all_answers_correct = false;
}
}
else {
restored_all_answers = false;
}
} // end for query
if (restored_all_answers) {
// update the submit div for the question
this.update_question_action_div(i);
// Show appropriate feedback. If the question responses were submitted,
// the student must have finished the question, so we don't have to worry
// about hints.
this.show_question_feedback(question, all_answers_correct, false);
// if the item is in a sequence, show the next question
this.show_next_question(question);
// NEED TO CHECK TO MAKE SURE THIS IS WORKING PROPERLY
// If the question is in a sequence and the sequence is complete, call show_closing_material
var qs = question.question_sequence;
if (qs != null && qs.sequence_complete == 'partial') {
this.show_closing_material(qs.index);
}
// brb: if there is a video with this question then show it
player.activity.hide_submit_button(i);
/* brb: there do not appear to be any 'reveal_video's in
these activities so I'm not sure why this was in here? */
} // end restored_all_answers
} // end for question
// resize_iframe();
},
submit_question: function (question_index) {
// 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(question.md.submit_error);
return false;
}
}
// if we made it here then remove any alert messages
question.remove_alert_mesg();
$('.ada-shadow-speech').empty();
this._super(question_index);
// set focus on feedback
var $fb_div = $('#question_' + question_index + '_fb_mesg');
if ($fb_div) {
if (platform.ios) {
var opt = {
delay: 100
};
player.setAriaFocusTo($fb_div, opt);
}
else {
$fb_div.focus();
}
}
// brb: hide submit button
player.activity.hide_submit_button(question_index);
/**
* dirty hack for TB on android, when radio-buttons where disabled
*/
if (platform.android) {
var _questionIndex = (typeof question_index === 'object') ? question_index.data.question_index : question_index;
var $question = player.activity.questions[_questionIndex].jq;
$question.find('input[type="radio"]').each(function () {
this.addEventListener('click', function (e) {
e.preventDefault();
});
$(this).css({
'opacity': 0.5,
'outline': 'none'
});
});
}
},
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().css('display', 'none');
// we also need to remove click handler so that students who know what they
// are doing can't re-enable in order to submit again
$submit_button.unbind('click');
},
// brb: we aren't going to use this one any more
update_question_action_div: function (question_index) {
return;
}
});
module.exports = Activity_subtype;
/***/ }),
/***/ 228:
/***/ (function(module, exports) {
var Figures_subtype = Figures.extend({
sequence_cuepoint: [], // holds the cuepoint for each sequence
bcVideo: {}, // holds all of the video players (by ID)
bcPlayerData: {
'accountId': '1500315202001',
'playerId': 'B1AhVYg4l'
},
process_media: function () {
$('#document-body-iframe', window.parent.document)
.attr('allowfullscreen', 'true')
.attr('mozallowfullscreen', 'true')
.attr('webkitallowfullscreen', 'true');
// save off 'this'
var context = this;
// Process each video
$('[data-mmtype="mov"]').each(function () {
var $this = $(this);
var $parent = $this.parent('[data-type="figure"]');
var video_mmsrc = $this.attr('data-mmsrc');
var video_id = $parent.attr('data-figure-id');
// Replace the current figure HTML with the new HTML5 video HTML
window.playerHTML = '
'
+ '
'
+ '
';
$parent.before(window.playerHTML);
$parent.remove();
// instantiate the player
bc(document.getElementById(video_id));
player.$videoPlayControl = $(videojs(video_id).el_.querySelector('.vjs-play-control'));
// create player instance and set up cuepoints
videojs(video_id).ready(function () {
context.bcVideo[video_id] = this;
// reset the video to the beginning after it ends
context.bcVideo[video_id].on('ended', function () {
context.bcVideo[video_id].currentTime(0);
context.bcVideo[video_id].pause();
});
});
});
}
});
module.exports = Figures_subtype;
/***/ }),
/***/ 229:
/***/ (function(module, exports, __webpack_require__) {
var Standard_Dialog = __webpack_require__( 3 );
var project_glossary = Glossary.extend({
terms: {},
show_definition: function (el) {
var jq = $(el);
var index = jq.attr('data-term');
if (index == '' || index == null) {
index = jq.html();
}
if (index != '' && index != null) {
index = index.toLowerCase();
var term = player.glossary.terms[index];
var html;
if (term == null) {
html = 'No definition found for ' + index;
}
else {
html = '' + term.term + ': ' + term.definition;
}
Standard_Dialog.open(html, {
'title': 'Glossary Term',
// 'modal': false,
// 'draggable': true,
'buttons': 'OK',
'from': jq
});
}
},
init: function () {
var terms = this.terms;
// find all terms
$('[data-type="glossaryentry"]').each(function (index, element) {
var jq = $(element);
var term = jq.find('[data-type="term"]').html();
var definition = jq.find('[data-type="definition"]').html();
if (term != '' && definition != '' && term != null && definition != null) {
// index terms object by lower-case, html-stripped version of term
var index = term.toLowerCase();
index = index.replace(/<[^>]+>/, '');
terms[index] = {'term': term, 'definition': definition};
}
});
$('[data-type="termref"]').attr('tabindex', '0').attr('role', 'button');
$('[data-type="termref"]').each(function (index, element) {
// opening with a click event, as in the following line, doesn't work for queries;
// in any case I think a "real" link is probably better anyway.
// $(element).click(t.open_link).css("cursor", "pointer");
var jq = $(element);
jq.click(function () {
player.glossary.show_definition(this);
});
});
$('[data-type="termref"]').keyup(function (e) {
var key = e.keyCode || e.which;
if (key === 32) {
player.glossary.show_definition(this);
}
});
$('[data-type="termref"]').keydown(function (e) {
var key = e.keyCode || e.which;
if (key === 32) {
e.preventDefault();
}
if (key === 13) {
e.preventDefault();
player.glossary.show_definition(this);
}
});
}
});
module.exports = project_glossary;
/***/ }),
/***/ 230:
/***/ (function(module, exports, __webpack_require__) {
var subtype_mc = __webpack_require__(237);
var platform = __webpack_require__(0).run_on;
var clean_query_text = function (query_text) {
query_text = query_text.replace(/]+>/g, '');
query_text = query_text.replace(/<\/span>/g, '');
query_text = query_text.replace(//g, '');
query_text = query_text.replace(/<\/em>/g, '');
query_text = query_text.replace(//g, '');
query_text = query_text.replace(/<\/strong>/g, '');
query_text = query_text.replace(/ /g, '');
query_text = query_text.replace(/ /g, '');
query_text = query_text.replace(/’/g, '"');
query_text = query_text.replace(/“/g, '\"');
query_text = query_text.replace(/”/g, '\"');
query_text = query_text.replace(/—/g, '--');
return query_text;
};
var project_mc = subtype_mc.extend( {
getQueryTextForARGA: function () {
if (this.query_text_for_ARGA != null && this.query_text_for_ARGA != '') {
return this.query_text_for_ARGA;
}
else if (this.query_text != null && this.query_text != '') {
var cleaned_text = clean_query_text(this.query_text);
return cleaned_text;
}
else {
return 'see page for question context';
}
},
user_has_answered: function () {
if ($('input:radio[name=query_answer_' + this.query_index + ']:checked').val() !== undefined) {
return true;
}
else {
return false;
}
},
parseSource: function () {
// initialize vars
this.choices = [];
this.choices_fb = [];
this.choices_hint = [];
this.choice_ids = [];
this.correct_answer_index = null;
this.user_answer_index = null;
// lines might start with "MC:"; if so, strip it out
var s = this.query_source.replace(/^MC:\s*/, '');
// split and go through the lines
var lines = s.split(this.line_separator);
this.query_text = '';
// the first choice has to be "a" or "A"
var choice_re = /^[\*]?([aA])[\.:\)]/;
for (var i = 0; i < lines.length; ++i) {
// get line and trim whitespace
var l = $.trim(lines[i]);
// choice
if (l.search(choice_re) > -1) {
var ident = RegExp.$1;
var choice_text = l.replace(/^[\*]?\w[\.:\)]\s*/, '');
ident = ident.toUpperCase();
// extract feedback for the choice, if there
var choice_fb = null;
if (/\[\[/.test(choice_text)) {
choice_text = choice_text.replace(/\s*\[\[(.*?)\]\]\s*/, '');
choice_fb = RegExp.$1;
// if feedback is simply "correct" or "incorrect", ignore it.
if (choice_fb.toLowerCase() == 'correct' || choice_fb.toLowerCase() == 'incorrect') {
choice_fb = null;
}
}
// extract choice hint
var choice_hint = null;
if (/{{/.test(choice_text)) {
choice_text = choice_text.replace(/\s*\{{(.*?)}}\s*/, '');
choice_hint = RegExp.$1;
}
this.choices.push(choice_text);
this.choices_fb.push(choice_fb);
this.choices_hint.push(choice_hint);
this.choice_ids.push(ident);
// if line started with *, it's the correct answer
if (l.search(/^[\*]/) > -1) {
correct_choice = ident;
this.correct_answer_index = this.choice_ids.length - 1;
}
// update choice_re so that any letter is OK from here on
choice_re = /^[\*]?(\w)[\.:\)]/;
// points_possible
}
else if (l.search(/^_points:\s*(\d+)/i) > -1) {
this.points_possible = RegExp.$1;
// metadata -- starts with "_[a-zA-Z]"
}
else if (l.search(/^\_[a-zA-Z]/) > -1) {
this.extractMetadata(l);
// by default add it to the query text
}
else {
this.query_text += l + '\n';
}
}
// if the query starts with \d\.\s*, strip it out
// *no, this version doesn't work; it also strips out "1." from "5TB-1.png"*//
// this.query_text = this.query_text.replace(/(\n?)\d+\.\s*/, "\1");
// now we should be done with the query text. Strip trailing white space
this.query_text = this.query_text.replace(/\s*$/, '');
// shuffle choices, unless md.never_scramble is true
this.choice_order = [];
for (var j = 0; j < this.choices.length; ++j) this.choice_order[j] = j;
if (this.md.never_scramble != 'true') {
this.choice_order.shuffle();
}
// if no correct answer was given, we need to explicitly note that.
if (this.correct_answer_index == null) {
this.md.no_correct_answer = 'true';
}
// replace any remaining \n's with
// 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 the question explicitly defines feedback for the user's answer, use it as the feedback
if (this.user_answer_index != null && this.choices_fb[this.user_answer_index] != null) {
html += this.choices_fb[this.user_answer_index];
}
// the correct answer will be highlighted in green, so there's no reason to say anything more.
// now, if we got any feedback, enclose it in a div
if (html != '') {
html = '' + html + '';
}
return html;
},
query_text_html: function () {
var query_text = this._super();
var first = query_text.indexOf('>') + 1;
this.jq.parent().find('h3').remove();
return query_text.substring(0, first) + this.parent_question.number + ' ' + query_text.substring(first);
},
getHTML: function (mode) {
var label_tag = 'label';
// 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 = '';
// some useful fixes
if (html.match(/__/)) {
html = html.replace(/()_+(<\/span>)/g, 'blank$1$2');
}
if (platform.mac) {
var firstLabelId = html.substr(html.search('label id="')).split('"')[1];
html = html
.replace('legend', 'div')
.replace(/(query_text)/, '$1" id="query_text_' + this.parent_question.index + '"')
.replace(/(type="radio")/, '$1 aria-labelledby="query_text_'
+ this.parent_question.index + ' ' + firstLabelId + '"')
.replace('/legend', '/div');
}
return html;
}
} );
module.exports = project_mc;
/***/ }),
/***/ 231:
/***/ (function(module, exports, __webpack_require__) {
var Standard_Dialog = __webpack_require__( 3 );
var ShadowSpeech = __webpack_require__(238);
var project_activity = __webpack_require__(227);
var project_glossary = __webpack_require__(229);
var platform = __webpack_require__(0).run_on;
var thirdSlideInstruction = '
Instructions:
'
+ '
Answer the questions based on the video and your reading of the entire'
+ ' chapter.
';
var project_player = Player.extend( {
ACTIVITY_COMPLETED: false,
DUE_DATE_HAS_PASSED: false,
FIRST_PAGE: true,
SHOWN_INSTRUCTOR_MESG: false,
show_toc: function () {
$('#toc_dialog').remove();
var html = '';
for (var i = 0; i < this.sections.length; ++i) {
var s = this.sections[i];
var extra_style = '';
if (this.md.sequenced_sections == 'true' && i > this.last_available_section // && !player.activity.is_instructor()
&& !this.DUE_DATE_HAS_PASSED) {
extra_style = 'toc_section_not_available';
}
if (extra_style === 'toc_section_not_available') {
html += '
Note: slides are not accessible until preceding slides have'
+ ' been viewed or completed.
'
+ html;
html = '
' + html + '
';
var opt = platform.firefox ? {
title: 'Table of Contents',
from: $('#menu'),
ariaLabelledby: '',
ariaDescribedby: 'ui-dialog-title-standard_dialog_div standard_dialog_div'
} : {
title: 'Table of Contents',
from: $('#menu'),
};
Standard_Dialog.open(html, opt);
},
add_question: function (index, element) {
var a = player.activity;
// this fn gets called within the scope of a jquery each, so we can't refer to "this"
var jq = $(element);
// see if we're in a question_pool or question_sequence block
var qs_parent = jq
.parents('[data-block_type=question_sequence], [data-block_type=question_sequence_one_at_a_time]');
var q = a.questions[a.questions.length] = new Question({
'index': a.questions.length,
'number': jQuery.trim($('[data-type="number"]', jq).html()),
'title': jQuery.trim($('[data-type="title"]', jq).html()),
'jq': jq,
'points_possible': 0
});
// store the question index in the DOM too
jq.attr('data-question_index', q.index);
// get question queries
a.question_being_initialized = q;
$('[data-type="query"]', jq).each(a.add_query);
// if the question has queries, add bling to the bottom
if (q.queries.length > 0) {
var html = '
';
var submit_handler;
// add a submit button if we're supposed to have one
// (image map and matching questions, which should contain one and only one query, don't have submit buttons)
if (q.queries[0].hasSubmitButton === true) {
// "answer_one" pool mode (yet to be fully implemented...)
if (q.pool_mode == 'answer_one') {
html += '';
submit_handler = player.activity.Show_Submit.bind( this, q.index );
}
else {
html += a.question_submit_button(q);
submit_handler = player.activity.submit_question.bind( this, q.index);
}
}
// add a "give up" button if we're supposed to have one
// (image map questions, which should contain one and only one query, should have this button)
if (q.queries[0].hasGiveUpButton === true) {
html += '';
submit_handler = player.activity.give_up_question;
}
html += '
';
jq.append(html);
var nAgt = navigator.userAgent;
var Mobile = nAgt.match( /(iPhone|iPod|iPad|Android|BlackBerry)/ );
var mousedown = ( Mobile ) ? 'touchstart' : 'mousedown';
document.querySelector( '#question_submit_button_' + q.index ).addEventListener( mousedown, submit_handler );
// bind the submit_handler function to the button, passing in the question_index
// float instructor controls to right of action button
jq.prepend(a.instructor_question_controls(q));
// also, determine question points and weight at this time
for (var i = 0; i < q.queries.length; ++i) {
q.points_possible += q.queries[i].getPointsPossible();
}
// round to two decimal places, in case there are decimals
q.points_possible = Math.round(q.points_possible * 100) / 100;
}
// now that the question has been created, deal with sequences and pools
if (qs_parent.length > 0) {
// get sequence index and item
var qs_index = qs_parent.attr('question_sequence_index') * 1;
var qs = a.question_sequences[qs_index];
// place in sequence
var sequence_num = qs.questions.length;
qs.questions[sequence_num] = q;
// place reference to sequence in question
q.question_sequence = qs;
q.question_sequence_index = sequence_num;
// if this isn't #1, hide the question
if (sequence_num > 0) {
jq.hide();
}
// update the sequence navigator if it's there
$('question_sequence_max_index_' + qs.index).html(sequence_num+1);
}
},
submit_question: function (question_index) {
this._super(question_index);
},
start_activity: function () {
var src = $( '[data-block_type=activity_iframe] iframe' ).attr( 'src' );
var window_width = screen.width;
console.log(window_width);
var window_height = screen.height;
player.activity_window = window.open( src, 'activity_window', 'width=' + window_width + ',height='
+ window_height + ', left=0, top=0, toolbar=no, location=no, directories=no, status=no,'
+ ' scrollbars=no, resizable=no, copyhistory=no' );
},
create_start_activity_button: function () {
var button = $( '[data-block_type=start_activity_button]' );
if ( button.length ) {
var button_html = '
'
+ button.text() + '
';
button.after( button_html );
}
},
check_activity_availability: function () {
if (document.URL.indexOf('digfir-published') == -1) {
var isViewable = $('[key=activity_is_viewable]').html();
if (isViewable != null) {
isViewable = $.trim(isViewable);
isViewable = isViewable.toLowerCase();
if (document.URL.indexOf('show_activity') == -1) {
if (isViewable == 'false') {
this.show_coming_soon_message();
}
}
}
}
},
show_coming_soon_message: function () {
var message = 'This activity will be available soon.';
var html = '
' + message + '
';
$('#manuscript').before(html);
},
show_completion_message: function () {
// player.activity.grade_activity will always have been called before this fn
// so we'll have access to the properly-calculated activity properties below
var html = ''
+ '
'
+ 'Congratulations! You have completed this activity.'
+ '
Your grade'
+ ' has been submitted to your instructor.
'
+ '
'
+ '
Your grade has been submitted to your instructor.
'
+ '';
// section should have a block_type=activity_report paragraph to receive this info
$('[data-block_type=activity_report]').html(html).show();
// show the grade submitted message if user_has_received_completion_alert is true
if (player.user_has_received_completion_alert == true) {
$('#grade_submitted_message').show();
}
},
show_section: function (section_to_show, from_toc) {
if (this.$videoPlayControl.hasClass('vjs-playing')) {
this._toggleVideoStatus();
}
if (from_toc) {
Standard_Dialog.close();
}
var direction = 'right';
var set_menu_focus = true;
if (section_to_show == 'previous') {
section_to_show = this.section_currently_showing - 1;
direction = 'left';
}
else if (section_to_show == 'next') {
section_to_show = this.section_currently_showing + 1;
}
if (section_to_show == null || isNaN(section_to_show)
|| section_to_show < 0 || section_to_show >= this.sections.length) {
return;
}
// if user has to view sections in sequence and hasn't gotten up to this one, don't allow it
if (this.md.sequenced_sections == 'true' && section_to_show > this.last_available_section) {
// but let instructors through
/* if (player.activity.is_instructor()) {
// only show this message once
if (!this.SHOWN_INSTRUCTOR_MESG) {
set_menu_focus = false;
var $menu = $('#menu');
var opt = platform.firefox ? {
'title': 'Instructor Message',
'close': function (e) {
$menu.focus();
},
'h2_close': $menu,
'from': $menu,
'ariaLabelledby': '',
'ariaDescribedby': 'ui-dialog-title-standard_dialog_div standard_dialog_div'
} : {
'title': 'Instructor Message',
'close': function (e) {
$menu.focus();
},
'h2_close': $menu,
'from': $menu
};
Standard_Dialog.alert('Please note: Students need to read and complete each section of the activity before'
+ ' moving on to the next section. Instructors, however, can skip around between sections as they choose.',
opt);
this.SHOWN_INSTRUCTOR_MESG = true;
}
}
else { */
set_menu_focus = false;
Standard_Dialog.alert(this.md.section_sequence_message,
{
'title': 'Next Button Not Permitted',
'from': $('.next_button')});
return;
// }
}
this.show_section_animate(section_to_show, direction);
// process iframes for the section, unless all were preloaded
if (player.md.preload_all_iframes != 'true') {
this.figures.process_iframes(this.get_current_section().jq);
}
this.update_section_status();
this.update_navigation();
// brb: set focus on menu
if (!this.FIRST_PAGE && set_menu_focus) {
if (platform.mac || platform.ios) {
setTimeout(function () {
$('#menu').focus();
}, 500);
}
else if (platform.android) {
setTimeout(function () {
$('#menu').focus();
}, 800);
}
else {
$('#menu').focus();
}
}
this.FIRST_PAGE = false;
},
/* brb: Overriding this method in order to keep the activity from
updating ARGA if the activity has been completed or hasn't and is passed due date
so that it doesn't overwrite a manual grade change in the grade book (see JIRA LP-127) */
update_section_status: function() {
if (this.section_currently_showing != null && this.last_available_section <= this.section_currently_showing) {
var s = this.get_current_section();
s.all_questions_answered = true;
// if the current section has any questions, see if they've all been answered
var qs_to_check = [];
s.jq.find("[data-type=question]").each(function(index, element) {
var q_index = $(element).attr("data-question_index");
var question = player.activity.questions[q_index];
s.all_questions_answered = s.all_questions_answered && question.is_complete();
if (question.question_sequence != null) {
for (var i = 0; i < qs_to_check.length; ++i) {
if (qs_to_check[i] == question.question_sequence) break;
}
if (i == qs_to_check.length) {
qs_to_check.push(question.question_sequence);
}
}
});
// now check question sequences to make sure they're done too
s.all_question_sequences_completed = true;
for (var i = 0; i < qs_to_check.length; ++i) {
s.all_question_sequences_completed = s.all_question_sequences_completed && (qs_to_check[i].sequence_complete == "complete");
}
if (s.all_questions_answered && s.all_question_sequences_completed) {
this.last_available_section = this.section_currently_showing + 1;
}
}
this.fill_in_previous_query_responses();
// if ARGA is initialized and we need to restore the user to his last position when he returns,
if (this.ARGA_running && player.md.restore_last_viewed_section == "true") {
// if we're viewing a page other than the one currently saved as LVS (last-viewed section)
var lvs = Get_ARGA_Data("LVSX");
if (this.section_currently_showing != null && this.section_currently_showing != lvs) {
// store LVS/LAS to register the last-viewed/last-available page,
// and save ARGA so it gets registered
Set_ARGA_Data("LVSX", this.section_currently_showing);
Set_ARGA_Data("LASX", this.last_available_section);
/* brb: If the activity has not been completed then save LVSX, but if
it has been completed then do not save LVSX because that will also
send the grade to the PX grade book again, overwriting any manual
grade changes the instructor may have made. */
/* brb: also don't want to do this if the due date has passed */
if (!this.ACTIVITY_COMPLETED && !this.DUE_DATE_HAS_PASSED) {
this.activity.ARGA_submit_data(false);
}
}
}
},
update_navigation: function () {
// show/hide the "next" button as appropriate
if (this.last_available_section > this.section_currently_showing && this.showing_last_section() == false) {
UI_Elements.toggle_button('step_button', true);
}
else {
UI_Elements.toggle_button('step_button', false);
}
if (this.showing_last_section() && player.activity.answered_all_queries) {
player.show_completion_message();
}
},
show_section_animate: function (section_to_show, direction) {
// brb: set up h1
var text = $('h1.section-title').html();
$('#slide_title').html(text);
// make sure modal window is closed
$('#toc_dialog').dialog('close');
// slide in using parent function
// hide currently showing section
this.section_currently_showing = section_to_show;
// Only show h1 to browsers on first slide
if (this.section_currently_showing == 0) {
$('h1.section-title').removeClass('v-h');
}
else {
$('h1.section-title').addClass('v-h');
}
// update slide_number and title
$('#slide_number').html((section_to_show + 1) + ' of ' + this.sections.length + ' ');
$('[data-type="section"]').each(function () {
var $this = $(this);
var sec_idx = $this.attr('data-section-index');
if (player.section_currently_showing == sec_idx) {
}
else {
$this.css('display', 'none').attr('aria-hidden', 'true');
}
});
this.get_current_section_jq().fadeIn('slow').attr('aria-hidden', 'false');
// if this is the first/last section, dim the previous/next button
if (this.section_currently_showing == 0) {
$('.prev_button').addClass('disabled_prev_button').attr('aria-hidden', 'true');
}
else {
$('.prev_button').removeClass('disabled_prev_button').attr('aria-hidden', 'false');
}
if (this.section_currently_showing < this.sections.length - 1) {
$('.next_button').addClass('active_next_button').attr('aria-hidden', 'false').removeClass('disabled_next_button');
}
else {
$('.next_button').removeClass('active_next_button').attr('aria-hidden', 'true').addClass('disabled_next_button');
}
if (platform.ie) {
setTimeout( function () {
if (section_to_show === 0 || section_to_show === 3) {
$('video').hide().attr({
'aria-hidden': true,
'role': 'presentation'
});
}
else {
$('video').show().attr({
'aria-hidden': false,
'role': 'document'
});
}
}, 0);
}
},
show_navigation: function () {
var html = '';
if (this.sections.length > 1 && this.md.hide_toolbar != 'true') {
html += '';
}
$('[data-type=chapter]').after(html);
$('#overlay-left .prev_button').click(function (e) {
player.show_section('previous');
});
$('#overlay-right .next_button').click(function (e) {
player.show_section('next');
});
},
initialize: function () {
var fontHTML = '';
$('body').append(fontHTML);
$('[data-type=chapter][data-block_type=no-menu]').siblings('#top_banner').find('#top_nav').hide(0);
var title = $('[data-block_type="activity_title"] p').html();
$('h1.section-title').eq(0).html(title);
document.title = title;
$('[data-block_type="activity_title"]').remove();
// brb: header
var chaptertitle = $('h1.section-title').html();
var html = '
'
+ '
'
+ '
' + chaptertitle + '
'
+ ''
+ '
'
+ ''
+ ''
+ '
';
$('[data-type=chapter]').before(html);
// brb: move h1 into header
$('h1.section-title').appendTo('#top_banner');
$('[data-type="section"]').changeElementType('section');
// fix up question numbers
$('[data-type="question"] h3 [data-type="number"]').each(function () {
var $this = $(this);
var $h3 = $this.parent();
var number = $this.text().trim().replace(/\d+\./, '');
var hidden = platform.ie ? 'aria-hidden="true"' : '';
$h3.html('Question ' + number + '.');
// add id to h3
$h3.attr('id', 'question_header_' + number);
// add
for question text
// brb: uncomment to go back to question text outside of legend
$h3.after('
');
});
// brb: make all sections hidden
$('[data-type="section"]').attr('aria-hidden', 'true');
this._super();
this.activity = new project_activity();
this.glossary = new project_glossary();
this.shadow_speech = new ShadowSpeech();
this.check_activity_availability();
this.create_start_activity_button();
this._addInstruction();
},
initialize2: function () {
this._super();
if (player.ARGA_running) {
try {
var dejs_arr = ARGA_API.dejs_data;
for (var i=0; iSlide ' + slide_num + ' of ' + player.sections.length + ': ' + h2_html);
$h2.css('display', 'inline-block');
if (i === 0) {
// $h2.addClass('v-h');
$('h1.section-title').show();
}
});
// brb: determine if due date has passed for assignment
// Note: If you don't want all the due date fixes for this activity then
// just comment out this if statement.
if (player.ARGA_running) {
if (Get_ARGA_Data('due_date_has_passed') == 1) {
this.DUE_DATE_HAS_PASSED = true;
}
}
// brb: Need to set allowfullscreen to true on parent iframe so videos
// can go to full screen
$('#document-body-iframe', window.parent.document)
.attr('allowfullscreen', 'true')
.attr('mozallowfullscreen', 'true')
.attr('webkitallowfullscreen', 'true');
// brb: make first h2 visibly hidden
// brb: convert subtitles to h3
$('[data-block_type="subtitle"] p').each(function () {
var $this = $(this);
$this.addClass('subtitle');
$this.changeElementType('h3');
});
// brb: Remove 'References' button, make it a sub-header instead
$('[data-block_type="references"]').each(function () {
var $this = $(this);
var $ref_button = $this.find('[data-onclick_trigger]');
$ref_button.before('
References
');
$ref_button.remove();
});
// brb: All figures will be hidden from screen readers
$('[data-type="figure"]').each(function () {
var $this = $(this);
var $img = $this.find('img');
if ($img.length == 0) {
return;
}
var alt_text = $img.attr('alt');
if (!(/\S/.test(alt_text))) {
$this.attr('aria-hidden', 'true');
$this.attr('role', 'presentation');
$img.attr('aria-hidden', 'true');
$img.attr('role', 'presentation');
}
$this.changeElementType('figure');
});
var userID = 'anonymous';
if (player.ARGA_running) {
userID = Get_ARGA_Data('learner_id');
}
console.log(userID);
// brb: click_button for Childhood Obesity page 4
$('[data-block_type="click_button"]').each(function () {
var $this = $(this);
var $button = $this.find('[data-type="button"]');
var $target = $this.find('[data-type="target"]');
$button.attr('role', 'button').attr('tabindex', '0').attr('aria-expanded', 'false');
// all targets start as hidden
$target.attr('aria-hidden', 'true').attr('tabindex', '-1');
$button.bind('click keydown', function (e) {
// if keydown, make sure it is either return or space
if (e.type === 'keydown') {
var key = e.keyCode || e.which;
if (key !== 32 && key !== 13) {
return;
}
}
var $this = $(this);
var expanded = $this.attr('aria-expanded');
if (expanded == 'false') {
$target.attr('aria-hidden', 'false').css('display', 'block');
$this.attr('aria-expanded', 'true');
$target.focus();
}
else {
$target.attr('aria-hidden', 'true').css('display', 'none');
$this.attr('aria-expanded', 'false');
}
});
});
$('[data-block_type="bigger_text_block"]').each(function () {
var $this = $(this);
var $h3 = $this.children('[data-type="box_inner"]').children('h3[data-type="title"]');
if ($h3.length == 1) {
var html = $h3.html();
if (html == '') {
$h3.remove();
}
}
});
$('[data-type="chapter"]').attr('role', 'main');
$('#footer').attr('role', 'navigation');
$('header').attr('role', 'banner');
$('.subtitle').hide();
$('button').removeAttr('role');
$('#digfir_section_0').find('p').find('strong').each(function (i, item) {
var instText = $(item).text();
if (instText) {
$(item).text(instText.replace(/Click the Arrow/, 'Press the Next button'));
}
});
if (platform.ios) {
$('[data-type="section"]').each(function (i, item) {
var opt = {
headingLvl: 2,
isFocusNeeded: false
};
var $heading2 = $(item).find('h2.section-title').wrap('');
$(item).find('[data-type="number"]').remove();
this.setAriaFocusTo($heading2.parent(), opt);
}.bind(this));
}
this.addTranscriptBtn();
this._wrapSecondSLideContent();
this._addTranscriptHiddenInstruction();
// brb: If the due date has passed and the activity has not been
// completed then remove all submit buttons, disable all radio buttons
// and give user message
if (this.DUE_DATE_HAS_PASSED && !this.ACTIVITY_COMPLETED) {
$('button.question_submit_button').each(function() {
var $this = $(this);
$this.remove();
});
// disable all questions
$('[data-type="question"]').each(function() {
var $this = $(this);
$this.find('input[type="radio"]').attr("disabled",true);
$this.find('textarea').attr("disabled",true);
$this.find('input').attr("disabled",true);
$this.find('select').attr("disabled",true);
});
// display message to user
Standard_Dialog.alert("The due date for this assignment has now passed. "
+ "You may watch the video "
+ "but you will not be able to submit answers for a grade. "
+ "Please contact your instructor for further information.",
{title: "Alert"});
}
// brb: If activity has been completed then remove all submit buttons.
// This keeps students who know what they are doing from reactivating
// the button and re-submitting.
if (this.ACTIVITY_COMPLETED) {
$('button.question_submit_button').each(function() {
$(this).remove();
});
}
// brb: Make sure that the comma after a blank in the question text
// does not get moved to the next line
$('.query_text').each(function() {
var $this = $(this);
var q_text = $this.html();
q_text = q_text.replace(/<\/span>,/g,
",");
$this.html(q_text);
});
}, // end initialize2
addTranscriptBtn: function () {
$('[data-type=section]').find('.transcript-text').each(function (i, item) {
$(item).parent().prev().append('');
$('#transcript-button_' + i).click(function () {
var transcriptText = $(item).html();
var strWindowFeatures = '';
var win = window.open('about:blank', '_blank', strWindowFeatures);
win.document.write(transcriptText);
win.document.title = 'Transcript';
$(win.document.body).css({
'font-family': '"Open Sans", sans serif',
'font-size': '1.2em'
});
$(win.document.head).parent().attr('lang', 'en');
var fontSize = platform.android ? '13px' : '0.9em';
$(win.document.head).append('');
$(win.document.body).find('.main').attr('role', 'main');
});
});
},
setAriaFocusTo: function ($elem, opt) {
opt = opt || {};
var delay = opt.delay || 0;
var isFocusNeeded = opt.isFocusNeeded || true;
var headingLvl = opt.headingLvl ? 'role="heading" aria-level="' + opt.headingLvl + '"' : '';
setTimeout(function () {
$elem = typeof $elem === 'string' ? $($elem) : $elem;
if (platform.ios && $elem.find('*').length) {
$elem.find('.ios-vo-focus-fix').remove();
$elem.css('position', 'relative');
var $elemText = $elem.attr('aria-label') || $elem.text();
var itemDescribedByText = $('#' + $elem.attr('aria-describedby')).text() || '';
var $iosVoFocusableElem = $('
' + $elemText
+ ' ' + itemDescribedByText + '
');
if (!$elem.find('.visible-part').length) {
$elem.html('
' + $elem.html() + '
');
}
$elem.prepend($iosVoFocusableElem);
$elem = $iosVoFocusableElem;
}
isFocusNeeded && $elem.focus();
}, delay);
},
_addInstruction: function () {
$('[data-type="section"]').eq(2).find('.section-title').after(thirdSlideInstruction);
},
_toggleVideoStatus: function () {
this.$videoPlayControl.click();
},
_wrapSecondSLideContent: function () {
var $sectionContent = $('section[data-section-index="1"]>:not(.section-title, .special-ios)');
$sectionContent.wrapAll('');
},
_addTranscriptHiddenInstruction: function () {
var $transcriptButton = $('.transcript-button');
var transcriptInstrutionID = 'transcript-instruction';
$transcriptButton.after(''
+ ' Will be opened in a new tab');
$transcriptButton.attr('aria-describedby', transcriptInstrutionID);
}
});
module.exports = project_player;
/***/ }),
/***/ 233:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function QueryMixin() {}
QueryMixin.prototype.finish_inline_query = function(correct_answer, mode) {
// if mode is "delivery" (default) or this.md.no_correct_answer is true,
// don't show this at all
if (mode == 'delivery' || mode == '' || mode == null || this.md.no_correct_answer == "true") {
return "";
}
var s = "";
// image that indicates if the query is correct or incorrect
if (mode == 'review' || mode == 'review_correct_incorrect') {
var fbclass, alt;
if (this.isCorrect()) {
fbclass = 'query_correct_feedback_span';
alt = 'Correct';
}
else {
fbclass = 'query_incorrect_feedback_span';
alt = 'Incorrect';
}
s += "" + alt + " ";
//s += "";
}
// correct answer -- we show this in both review and preview mode,
// but not in review_correct_incorrect mode
// also don't show it if there *is* no correct answer
if (mode != 'review_correct_incorrect' && this.md.no_correct_answer != "true") {
s += '' + correct_answer + '';
}
s += "";
return s;
};
module.exports = QueryMixin;
/***/ }),
/***/ 234:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var common = __webpack_require__(2);
var dom = __webpack_require__(1);
var UtilsShuffle = __webpack_require__( 6 );
var aria = __webpack_require__(223);
var QueryMixin = __webpack_require__(233),
Query;
// NOTE: Replace methods of parent Query object
DD_Query.mixin([ QueryMixin ]);
Query = DD_Query.extend({
parseSource: function() {
this._super.apply(this, arguments);
if (UtilsShuffle.currentQuestionIsRandomize()) {
var shuffleArr = UtilsShuffle.shuffleArrays(this.choices, function(choices) {
this.choices = choices;
}.bind(this));
this.correct_answer_index = shuffleArr.indexOf(this.correct_answer_index);
}
},
getHTML: function(mode) {
var html = "", attrs;
// DD's never have query text
// Start a nobr tag for the item
// html = '';
// if we're in preview mode or
// (a student answer has been given and we're not in review_correct_incorrect mode),
// or the student got it correct
// disable the select
var disabled = "";
if (mode == 'preview' || (mode != 'review_correct_incorrect' && this.user_answer_index != null) || this.isCorrect()) {
disabled = "disabled";
}
// If we are in the table make different label
var $parent = this.jq.parent();
var labelledBy = '';
var label_id;
var question_index = this.parent_question.index;
if ( $parent.get( 0 ).nodeName.toLowerCase() === 'td' ) {
labelledBy = ' aria-labelledby="fb_' + question_index + '_header_label_' + $parent.index() +
' fb_' + question_index + '_label_' + this.jq.parents( 'tr' ).index() + '"';
}
else {
label_id = 'query_label_' + question_index + '_' + this.query_index;
if (this.query_text.length == 0) {
html += '';
}
else {
html += ' ';
}
if (this.parent_question.md.question_text_idx) {
labelledBy = ' aria-labelledby="' + this.parent_question.md.question_text_idx + ' ' + label_id + '"';
}
else {
labelledBy = ' aria-labelledby="' + label_id + '"';
}
}
html += '';
html += this.finish_inline_query(this.choices[this.correct_answer_index], mode);
// Close off the nobr tag for the item
// html += '';
attrs = common.extractMetadataAttrs(this.md);
html = dom.createHTML(html);
common.setAdditionalAttrs(attrs, 'select', html);
return html;
},
/**
* It is used only if we are in the table, rare case
*/
postInit: function() {
// If we are in the table make correct structure
var $parent = this.jq.parent();
var question_index = this.parent_question.index;
if ( $parent.get( 0 ).nodeName.toLowerCase() === 'td' ) {
var tr = $parent.parent();
var firstChild = tr.children().eq(0);
if ( firstChild[ 0 ] !== $parent[ 0 ] ) {
firstChild.attr( {
id: 'fb_' + question_index + '_label_' + this.jq.parents( 'tr' ).index()
} );
}
var th = this.jq.parents( 'table' ).find( 'tr' ).eq( 0 ).find( 'th' );
th.each( function( i ) {
$( this ).attr( {
id: 'fb_' + question_index + '_header_label_' + i,
scope: 'col'
} );
} );
}
}
});
module.exports = Query;
/***/ }),
/***/ 235:
/***/ (function(module, exports, __webpack_require__) {
/**
* Created by Abdulnasyrova on 20.04.2017.
*/
var platform = __webpack_require__(0).run_on;
var Query = Essay_Query.extend({
/**
* Get correct HTML for query text and set id for following use
* @returns {string} Html for query text
*/
query_text_html: function() {
if (this.query_text !== '' && this.md._hide_query_text !== 'true') {
// Replace newlines with
var text = jQuery.trim(this.query_text).replace(/\n/g, ' ');
var id = 'query_text_' + this.query_index;
return '
' + text + '
';
} else {
return '';
}
},
/**
* Add aria-labelledby for textarea
* @param {string} mode
* @returns {string} Html for the question
*/
getHTML: function(mode) {
// Start with the query text, if there
var html = this.query_text_html();
var val = '';
var disabled = '';
if (this.userHasAnswered() && mode !== 'preview') {
// Make sure we convert double quotes to " for placement in 'value="xxx"' attributes
// Convert breaks to newlines
val = this.user_answer.replace(/ /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_' + this.query_index;
var feedbackId = 'essay_question_evaluation_feedback_' + this.query_index;
// Add short label for mobile devices
var labelledBy = platform.mobile ? ' aria-label="Enter your answer for the question" aria-labelledby="' + feedbackId + '"' :
' aria-labelledby="' + feedbackId + ' ' + queryTextId + '"';
html += '';
return html;
},
/**
* Fix typo evaluation
* @param {string} html
*/
set_evaluation_feedback: function(html) {
// Set message below the textarea
html = '
' + html + '
';
$('#essay_question_evaluation_feedback_' + this.query_index).remove();
$('#query_answer_' + this.query_index).after(html);
if (platform.ios) {
player.shadow_speech.talk('');
player.shadow_speech.talk($(html).text());
}
}
});
module.exports = Query;
/***/ }),
/***/ 236:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var platform = __webpack_require__( 0 ).run_on;
var dom = __webpack_require__(1);
var common = __webpack_require__(2);
/**
* Created by Abdulnasyrova on 21.04.2017.
*/
var Query = FB_Query.extend( {
/**
* Get correct HTML for query text and set id for following use
* @returns {string} Html for query text
*/
query_text_html: function() {
if ( this.query_text != '' && this.md._hide_query_text !== 'true' ) {
// Replace newlines with
var text = jQuery.trim( this.query_text ).replace( /\n/g, ' ' );
var id = 'query_text_' + this.query_index;
// Set id for use it to associate query text with input radios
return '
' + text + '
';
}
else {
return '';
}
},
getHTML: function( mode ) {
// Add the query text, if there is any
var html = this.query_text_html(),
attrs;
// Determine how big the response blank should be, unless one was specified
var blank_size = this.md.blank_size;
if ( !blank_size || isNaN( blank_size * 1 ) ) {
blank_size = (('' + this.correct_answer).length + 2);
}
// If student hasn't answered or we're in preview mode, use an empty string for the input value
var val, disabled;
if ( !this.userHasAnswered() || mode == 'preview' ) {
val = '';
disabled = '';
}
else {
// Convert double quotes to "
val = this.user_answer.replace( /\"/g, '"' );
// Disable the input in this case, if we're not in review_correct_incorrect mode or if the user got it right
if ( mode !== 'review_correct_incorrect' || this.isCorrect() ) {
disabled = 'disabled';
}
}
var textId = 'query_text_' + this.query_index;
var labelledBy = '';
// If we are in the table make different label
var $parent = this.jq.parent();
if ( $parent.get( 0 ).nodeName.toLowerCase() === 'td' ) {
var question_index = this.parent_question.index;
labelledBy = ' aria-labelledby="fb_' + question_index + '_header_label_' + $parent.index() +
' fb_' + question_index + '_label_' + this.jq.parents( 'tr' ).index() + '"';
}
else {
// Add short label for mobile devices
labelledBy = platform.mobile ? ' aria-label="Enter your answer for the question"' : ' aria-labelledby="' + textId + '"';
}
html += '' +
'';
html += this.finish_inline_query( this.correct_answer, mode );
html += '';
attrs = common.extractMetadataAttrs(this.md);
html = dom.createHTML(html);
common.setAdditionalAttrs(attrs, 'input', html);
return html;
},
/**
* It is used only if we are in the table, rare case
*/
postInit: function() {
// If we are in the table make correct structure
var $parent = this.jq.parent();
var question_index = this.parent_question.index;
if ( $parent.get( 0 ).nodeName.toLowerCase() === 'td' ) {
var tr = $parent.parent();
var firstChild = tr.children().eq(0);
if ( firstChild[ 0 ] !== $parent[ 0 ] ) {
firstChild.attr( {
id: 'fb_' + question_index + '_label_' + this.jq.parents( 'tr' ).index()
} );
}
var th = this.jq.parents( 'table' ).find( 'tr' ).eq( 0 ).find( 'th' );
th.each( function( i ) {
$( this ).attr( {
id: 'fb_' + question_index + '_header_label_' + i,
scope: 'col'
} );
} );
}
}
} );
module.exports = Query;
/***/ }),
/***/ 237:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var common = __webpack_require__( 2 );
var dom = __webpack_require__( 1 );
var UtilsShuffle = __webpack_require__( 6 );
var platform = __webpack_require__(0).run_on;
var Query = MC_Query.extend( {
parseSource: function() {
this._super.apply( this, arguments );
if ( UtilsShuffle.currentQuestionIsRandomize() ) {
var shuffleArr = UtilsShuffle.shuffleArrays( this.choices, this.choices_fb, function( choices, choices_fb ) {
this.choices = choices;
this.choices_fb = choices_fb;
}.bind( this ) );
this.correct_answer_index = shuffleArr.indexOf( this.correct_answer_index );
}
},
/**
* Get correct HTML for query text and set id for following use
* @returns {string} Html for query text
*/
query_text_html: function() {
if ( this.query_text != '' && this.md._hide_query_text !== 'true' ) {
// Replace newlines with
var text = jQuery.trim( this.query_text ).replace( /\n/g, ' ' );
// Set id for use it to associate query text with input radios
if ( platform.ios ) {
// iOS doesn't see legend
return '
' + text + '
';
}
else {
return '';
}
}
else {
return '';
}
},
getHTML: function( mode ) {
// Initialize image map elements
if ( this.imagemap_initialized === false ) {
var question_jq = this.jq.parent();
this.im_init( question_jq );
this.imagemap_initialized = true;
}
// Wrap answers in radio group
var html = '";
html = dom.createHTML( html );
common.parseMathExpresions( html );
return html;
},
/**
* If we have individual feedback for each mc option
* @returns {string} Html for the feedback
*/
correct_incorrect_feedback: function() {
// Try get individual feedback for option
var index = this.choice_order[this.user_answer_index]; // Get correct index, if choices are scrambled
var html = this.choices_fb[index] || '';
// If we got any feedback, enclose it in a div
if (html) {
html = '
' + html + '
';
}
return html;
}
} );
module.exports = Query;
/***/ }),
/***/ 238:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var dom = __webpack_require__(1);
var platform = __webpack_require__( 0 ).run_on;
function ShadowSpeech(aria_live, role, atomic, root) {
var frag;
root = root || document.body;
this.live = aria_live || (platform.ie ? 'assertive' : 'polite');
this.role = role ? 'role = "' + role + '"' : '';
this.atomic = atomic ? 'aria-atomic = "' + atomic + '"' : '';
frag = dom.createHTML('');
this._el = frag.firstChild;
dom.append(frag, root);
}
ShadowSpeech.prototype.talk = function(some, clone) {
if (clone && some instanceof Node) {
some = some.cloneNode(true);
}
dom.clear(this._el);
dom.setHtml(some, this._el);
};
module.exports = ShadowSpeech;
/***/ }),
/***/ 3:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Created by Abdulnasyrova on 19.04.2017.
*/
var runOn = __webpack_require__(0).run_on;
var KEY_CODES = __webpack_require__(2).KEYCODES;
var Standard_Dialog = function() {
var $manuscript = $('#manuscript');
var $body = $('body');
var $dialog, $content;
var options = {};
return {
open: function(html, opt) {
// Extend default options
options = $.extend(true, {
width: 450,
modal: true,
draggable: false,
resizable: false,
ariaLabelledby: null,
ariaDescribedby: ''
}, (opt || {}));
// Set buttons
if (options.buttons === 'none') {
options.buttons = null;
}
else if (options.buttons === 'OK' || !options.buttons) {
options.buttons = [ { text: 'OK', click: Standard_Dialog.close } ];
}
// Remove previous dialog
$('#standard_dialog_div').dialog('close').remove();
if (options.modal) {
$body.css('overflow', 'hidden');
}
// Hide other content from reader for mobile devices
$manuscript.attr('aria-hidden', 'true');
$dialog = $('');
$content = $('
' + (html || '') + '
');
$dialog.append($content);
$dialog.dialog(options);
// If we open toc we use as description only instruction in the top of dialog and not links
var isMenu = $content.find('#toc_head').length;
var labelledByPart = isMenu ? 'toc_head' : 'standard_dialog_div';
var labelledBy = options.ariaLabelledby === null ? 'ui-dialog-title-standard_dialog_div ' + labelledByPart : options.ariaLabelledby;
// set so ugly, that don't break current functionality with aria-labelledby
var $parentDialog = $dialog.parent().attr({
'tabindex': '0',
'role': 'dialog'
});
var _labeledBy = !runOn.android ? labelledBy : null;
var _descrBy = options.ariaDescribedby;
_labeledBy && $parentDialog.attr('aria-labelledby', _labeledBy);
_descrBy && $parentDialog.attr('aria-describedby', _descrBy);
$parentDialog.find('#ui-dialog-title-standard_dialog_div').attr({
'role': 'heading',
'aria-level': '1'
});
// Remove close btn
$('.ui-dialog-titlebar-close').remove();
var $lastBtn = $parentDialog.find('button').last();
var $firstBtn = $parentDialog.find('button').first();
// Attach events
$parentDialog.bind('keydown', function(e) {
var code = e.keyCode || e.which;
if (code === KEY_CODES.ESC) {
Standard_Dialog.close(true);
}
if (e.target === this && e.shiftKey && code === KEY_CODES.TAB) {
e.preventDefault();
$lastBtn.focus();
}
});
$lastBtn.bind('keydown', function(e) {
var code = e.keyCode || e.which;
if (!e.shiftKey && code === KEY_CODES.TAB) {
$parentDialog.focus();
e.preventDefault();
}
});
if (runOn.android) {
// For android we set focus on dialog in any cases
$parentDialog.focus();
}
else if (isMenu) {
// If it is menu put focus on first link
$parentDialog.find('a').first().focus();
}
else {
// For other platform we set focus on first button
$firstBtn.focus();
}
$(document.head).parent().css('overflow', 'hidden');
},
// for now alert is just like any other dialog; we could change that later.
wait: function(html, opt) {
options = opt || {};
options.buttons = 'none';
Standard_Dialog.open(html, options);
},
alert: function(html, opt) {
Standard_Dialog.open(html, opt);
},
close: function() {
// Show other content
$manuscript.removeAttr('aria-hidden');
if ($dialog) {
$dialog.dialog('close').remove();
}
else {
$("#standard_dialog_div").remove();
}
if (options.from) {
options.from.focus();
}
if (options.modal) {
$body.css('overflow', 'auto');
}
$(document.head).parent().css('overflow', 'auto');
}
};
}();
module.exports = Standard_Dialog;
/***/ }),
/***/ 347:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(114);
/***/ }),
/***/ 6:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var UtilsShuffle = {};
UtilsShuffle.currentQuestionIsRandomize = function() {
return Boolean(player.activity.question_being_initialized.md["randomize-choices"]);
};
UtilsShuffle.getFilledArr = function(maxValue) {
var arr = [];
for (var i = 0; i < maxValue; i++) {
arr[i] = i;
}
arr.shuffle();
return arr;
};
UtilsShuffle.shuffleArrays = function() {
var arrs = [];
var length = arguments[0].length;
var shuffleArr = UtilsShuffle.getFilledArr(length);
var lengthArguments = arguments.length;
var callBackFunctions = null;
if (typeof arguments[lengthArguments - 1] === 'function') {
lengthArguments--;
callBackFunctions = arguments[lengthArguments];
}
// create new example of arrays
for (var i = 0; i < lengthArguments; i++) {
arrs[i] = [];
}
// shuffle of this arrays
for (var index = 0; index < length; index++) {
var el = shuffleArr[index];
for (var countArrFirst = 0; countArrFirst < lengthArguments; countArrFirst++) {
arrs[countArrFirst].push(arguments[countArrFirst][el]);
}
}
// return this arrays example
if (callBackFunctions) {
callBackFunctions.apply(null, arrs);
}
else {
for (var countArrSecond = 0; countArrSecond < lengthArguments; countArrSecond++) {
arguments[countArrSecond] = arrs[countArrSecond];
}
}
// return array of shuffle index
return shuffleArr;
};
module.exports = UtilsShuffle;
/***/ })
},[347]);
//# sourceMappingURL=comer_fap9_va.js.map