webpackJsonp([0],{
/***/ 20:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var common = __webpack_require__(1);
// Dialog
window.Standard_Dialog = __webpack_require__(5);
// Question
Question = __webpack_require__(41);
// MC_Query
MC_Query = __webpack_require__(37);
// Player
var ProjectPlayer = __webpack_require__(38);
player = new ProjectPlayer();
common.initForceNextSection();
/***/ }),
/***/ 37:
/***/ (function(module, exports, __webpack_require__) {
/**
* Created by Lupachev on 24.08.2017.
*/
var MC_Query = __webpack_require__(40);
var common = __webpack_require__( 1 );
var dom = __webpack_require__( 2 );
var platform = __webpack_require__(0).run_on;
var Auxiliary = __webpack_require__( 4 );
var project_mc_query = MC_Query.extend({
user_has_answered: function () {
return (typeof $('input:radio[name=query_answer_' + this.query_index + ']:checked').val() != 'undefined');
},
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;
}
var html = '
';
html = dom.createHTML( html );
common.parseMathExpresions( html );
return html;
},
query_text_html: function () {
var text = jQuery.trim( this.query_text );
text = Auxiliary.underlinedText(text);
// Replace newlines with
text = text.replace( /\n/g, ' ' );
text = (this.query_index + 1) + '. ' + text;
// Set id for use it to associate query text with input radios
if ( platform.ios ) {
return '
' + text + '
';
}
else if (platform.mac) {
return '
' + text + '
';
}
else {
return '';
}
}
});
module.exports = project_mc_query;
/***/ }),
/***/ 38:
/***/ (function(module, exports, __webpack_require__) {
/**
* Created by Lupachev on 24.08.2017.
*/
var xBookUtils = {};
var platform = __webpack_require__(0).run_on;
var Shadow_speech = __webpack_require__(43);
var Standard_Dialog = __webpack_require__(5);
var Activity_subtype = Activity_manuscript_type.extend({
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;
}
// force all queries to be answered before doing anything.
var allQueriesAnswered = true;
for (var i = 0; i < player.activity.questions[question_index].queries.length; i++) {
var x = player.activity.questions[question_index].queries[i].user_has_answered();
if (!x) {
allQueriesAnswered = false;
}
}
if (!allQueriesAnswered) {
Standard_Dialog.open(
'Please answer all of the questions before submitting.',
{title: 'Please answer all questions', from: $('#question_submit_button_1')});
return false;
}
var answer;
player.model['score'] = 0;
player.model['val0'] = 0;
player.model['val1'] = 0;
player.model['val2'] = 0;
player.model['val3'] = 0;
player.model['val4'] = 0;
for (var i = 0; i < player.activity.questions[question_index].queries.length; i++) {
answer = $('input:radio[name=query_answer_' + i + ']:checked').val();
if (answer !== '-1') {
player.model['val' + answer]++;
console.log('val' + answer + ': ' + player.model['val' + answer]);
}
}
this._super(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;
}
player.activity.questions[question_index].checkModelUpdateConditionals(
question_index);
// check if we need to show the next button
// safe_log(player.get_current_section_jq().find(".next_section_button").attr("role"));
player.get_current_section_jq().find('.next_section_button').show();
// STG set focus on continue butotn, so 'continue' button shows up in the window, not below
$('button.next_section_button').focus();
// insert any variables that may be newly displayed in the question feedback
player.show_variables();
// move the feedback into a nice popup
$('[data-question_index=" + question_index + "]').find(
'.query_mc_feedback_correct_incorrect').dialog({
buttons: [{
text: 'OK',
click: function () {
$(this).dialog('close');
}
}]
});
$('#next_button2').show();
player.show_section(1);
return false;
},
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;
}
}
if (restored_all_answers) {
// fix for feedback showing, when student will reenter the activity in LP
this.show_question_feedback(question, all_answers_correct, false);
this.update_question_action_div(i);
// 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);
}
// update section status
player.update_section_status();
}
}
}
});
var Player_subtype = Player_manuscript_type.extend({
model: {},
show_section_animate: function (section_to_show, direction) {
if ($.browser.safari) {
$('body').animate({scrollTop: 0}); // 1100 - скорость
}
else {
$('html').animate({scrollTop: 0});
}
this._super(section_to_show, direction);
player.show_variables();
$(document).trigger('df-content-rendered'); // added as DF-57
},
show_navigation: function () {
this._super();
var navHtml = UI_Elements.get_button_html({
id: 'next_button2',
extra_class: 'toolbar_button prev_next_buttons',
label: 'Results',
fn: 'player.show_section("next")'
});
var quizHtml = UI_Elements.get_button_html({
id: 'next_button1',
extra_class: 'toolbar_button prev_next_buttons',
label: 'Quiz',
fn: 'player.show_section(0)'
});
var $nav_container = $('');
$nav_container.append(quizHtml);
$nav_container.append(navHtml);
$('#next_button2').button();
$('#next_button1').button();
$nav_container.insertAfter('h1');
},
show_variables: function () {
// look through all the p nodes
var section = this.get_current_section_jq();
var regex = new RegExp('{(.+?)}', 'gmi');
$(section).find('p, label, option, table').each(function (index, element) {
var text = $(element).html();
text = text.replace(regex, function (a, b) {
return eval('player.' + b);
});
$(element).html(text);
});
// display the appropriate results
// first, we need to know how many questions are on the page
var num_q = $('[data-type="query"]').length;
// All of the activities have 9 questions
if (num_q == 9) {
var i = 0;
// if any answer has five or more, we show it
for (i = 0; i < 5; i++) {
var key = 'val' + i;
if (key in player.model && player.model[key] !== undefined) {
if (player.model[key] > 4) {
var result = '[data-block_type="results_' + key + '"]';
var result_title = '[data-block_type="results_' + key + '_title"]';
$(result).addClass('show_result');
$(result_title).addClass('show_result');
$('[data-block_type="results_val_mixed"]').removeClass(
'show_result');
$('[data-block_type="results_val_mixed_title"]').removeClass(
'show_result');
return;
}
}
}
// otherwise we have at least one of every answer
$('[data-block_type="results_val_mixed"]').addClass('show_result');
$('[data-block_type="results_val_mixed_title"]').addClass('show_result');
} // end num_q == 9
else if (num_q == 5) {
var i;
var big_key = undefined;
for (i = 0; i < 3; i++) {
var key = 'val' + i;
if (key in player.model && player.model[key] !== undefined) {
if (player.model[key] > 2) {
var result;
if (player.model[key] == 5) {
result = '[data-block_type="results_' + key + '_5"]';
}
else {
result = '[data-block_type="results_' + key + '_3"]';
}
safe_log('setting big_key to ' + key);
big_key = key;
$(result).addClass('show_result');
$('[data-block_type="results_val_mixed"]').removeClass(
'show_result');
$('[data-block_type="summary"]').show();
}
}
}
// If we get here then they have chosen at least one of each type
// and we will give them a generic response
if (big_key === undefined) {
safe_log('big_key: ' + big_key);
$('[data-block_type="results_val_mixed"]').addClass('show_result');
$('[data-block_type="summary"]').hide();
}
} // end num_q == 5
}, // end show_variables function
processNextStepConditionals: function (s) {
for (var i = 0; i < s.md['next_step_conditional'].length; ++i) {
var c = s.md.next_step_conditional[i];
if (c.search(/\{(.*)\}\s*\{(.*)\}/) > -1) {
// extract condition, section to show if it's met
c = {};
c.condition = RegExp.$1;
c.section_to_show = RegExp.$2;
c.message = $.trim(RegExp.$3);
c.condition = this.processCondition(c.condition);
s.md.next_step_conditional[i] = c;
}
else {
safe_log('bad conditional step: ' + c);
s.md.next_step_conditional[i] = {condition: 'false'};
}
}
},
processModelUpdateConditionals: function (s) {
for (var i = 0; i < s.md['model_update_conditional'].length; ++i) {
var c = s.md.model_update_conditional[i];
if (c.search(/\{(.*)\}\s*(.*)/) > -1) {
// extract condition, section to show if it's met, and optional message
c = {};
c.condition = RegExp.$1;
c.updateStatement = RegExp.$2;
c.updateStatement = this.processCondition(c.updateStatement);
c.condition = this.processCondition(c.condition);
s.md.model_update_conditional[i] = c;
}
else {
safe_log('bad conditional step: ' + c);
s.md.model_update_conditional[i] = {condition: 'false'};
}
}
},
processCondition: function (condition) {
// < > in condition
condition = condition.replace(//g, '>');
var div = document.createElement('div');
div.innerHTML = condition;
var condition = div.firstChild.nodeValue;
// substitute for queries in condition...
// query is correct or incorrect
condition = condition.replace(/qq(\d+)\s*==\s*true/g,
'qq.queries[$1-1].isCorrect()');
condition = condition.replace(/qq(\d+)\s*==\s*false/g,
'!qq.queries[$1-1].isCorrect()');
// check for a certain MC answer
condition = condition.replace(/qqMC(\d+)/g,
'qq.queries[$1-1].user_answer_index');
// otherwise assume it's something about query.user_answer
condition = condition.replace(/qq(\d+)/g, 'qq.queries[$1-1].user_answer');
// note that everything is going to be a string compare unless the condition includes "*1",
// i.e. qq1*1 < 4
// for update statements, get string value of a MC or DD
condition = condition.replace(/qqMCValue(\d+)/g,
'qq.queries[$1-1].choices[qq.queries[$1-1].user_answer_index]');
// now conditions on the entire question -- just allow correct and incorrect
condition = condition.replace(/qq\s*==\s*true/g, 'qq.is_correct()');
condition = condition.replace(/qq\s*==\s*false/g, '!qq.is_correct()');
return condition;
},
setModel: function (key, value, loadOnInit) {
if (key.match(/^userAvatar\./)) {
var newkey = key.substring(11, key.length);
player.model.userAvatar[newkey] = value;
}
else if (key.match(/^partnerAvatar\./)) {
var newkey = key.substring(14, key.length);
player.model.partnerAvatar[newkey] = value;
}
else if (key.match(/^avatar\./)) {
var newkey = key.substring(7, key.length);
player.model.avatar[newkey] = value;
}
else {
player.model[key] = value;
}
},
initialize_sections: function () {
this._super();
$('h1').html($('div[key="activity_type"]').html());
var $headers = $('h3');
for (var i = 0; i < $headers.length; i++) {
if ($headers[i].innerHTML === '') {
$($headers[i]).remove();
}
}
$('[data-type="rawhtml"]').each(function () {
var $this = $(this);
var raw_content = $this.contents();
$this.replaceWith(raw_content);
});
if (xBookUtils.inPXFrame()) {
var $page_html = $('body');
/* must use body to make IE work */
var doc_parent = window.parent;
var $doc_iframe = $('#document-body-iframe', doc_parent.document);
if ($doc_iframe.length > 0) {
setInterval(function () {
var page_height = $page_html.height();
var frame_height = $doc_iframe.height();
if (page_height != frame_height) {
xBookUtils.resizeWrapperFrameHeight(page_height);
}
}, 1000);
}
}
var $wrongh2 = $('h2.section-title');
for (var j = 0; j < $wrongh2.length; j++) {
$($wrongh2[j]).remove();
}
var $wrongh3 = $('h3');
for (j = 0; j < $wrongh3.length; j++) {
$($wrongh3[j]).remove();
}
},
show_section: function (section_to_show) {
var direction = 'right';
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) {
window.scrollTo( 0, 0 );
if (player.activity.is_instructor()) {
if (platform.firefox) {
setTimeout(function () {
Standard_Dialog.open('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.',
{title: 'Please note', from: $('#next_button2')});
}, 1000);
}
else {
Standard_Dialog.open('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.',
{title: 'Please note', from: $('#next_button2')});
}
}
else {
Standard_Dialog.open(this.md.section_sequence_message, {title: 'Please note', from: $('#next_button2')});
return;
}
}
this.show_section_animate(section_to_show, direction);
this.update_section_status();
this.update_navigation();
if (this.section_currently_showing === 0) {
$('#next_button1').css('background-color', '#4e60ba');
$('#next_button2').css('background-color', '#033D7D');
}
else if (this.section_currently_showing === 1) {
$('#next_button1').css('background-color', '#033D7D');
$('#next_button2').css('background-color', '#4e60ba');
if (this.activity.questions[1].is_complete()) {
var text = 'Please refer to the results below.';
if (!platform.ios) {
$('#next_button2').focus();
setTimeout(function () {
player.shadow_speech.talk(text);
}, 1000);
}
else {
$('#next_button2').attr('aria-label', text + 'Results ');
setTimeout(function () {
$('#next_button2').focus();
$('#next_button2').blur(function () {
$('#next_button2').removeAttr('aria-label');
});
}, 1000);
}
}
}
},
initialize: function () {
this._super();
this.activity = new Activity_subtype();
if (!platform.ios) {
this.shadow_speech = new Shadow_speech();
$('div.ada-shadow-speech').attr('tabIndex', '-1');
}
},
initialize2: function () {
this._super();
var sections = $('[data-type="section"]');
var sectionsContainer = $('');
$('#nav').after(sectionsContainer);
sectionsContainer.append(sections);
$('.mc_query_group').each(function () {
this.addEventListener('mousedown', function (e) {
e.stopPropagation();
});
});
}
});
xBookUtils.resizeWrapperFrameHeight = function (page_height) {
var doc_parent = window.parent;
var $doc_iframe = $('#document-body-iframe', doc_parent.document);
if ($doc_iframe.length > 0) {
if (page_height > 600 ||
$doc_iframe.height() > 600) {
$doc_iframe.height(page_height);
safe_log('set document-body-iframe height to ' + page_height);
}
}
};
xBookUtils.inPXFrame = function () {
try {
if (top.PxPage) {
return true;
}
}
catch (err) {
}
return false;
};
Question = Question.extend({
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;
}
});
module.exports = Player_subtype;
/***/ }),
/***/ 4:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Common css
/*
require('./assets/css/common');
require('./initialize');
var dom = require('lib/dom');
var jq_utils = require('lib/utils/jq_utils');*/
//-----{ Public: }------------------------------------------------------------->
function underlinedText(txt) {
var uText = txt.match(/(\__)([a-zA-Z0-9\s\-\’\+\[\]]+)(\__)/g);
if (uText) {
uText.forEach(function (value, i) {
txt = txt.replace(uText[i], '' + uText[i].substr(2, uText[i].length - 4) + '');
});
}
return txt;
}
function setFeedbackAndClearAttr(type, delay, html) {
$('#live-feedback').attr('aria-live', type);
$('#live-feedback').html(html);
setTimeout("$('#live-feedback').html('');", delay);
setTimeout("$('#live-feedback').attr('aria-live', 'off');", delay);
}
function createTitle(title) {
if (title) {
if (title.indexOf("<") > -1) {
return title.substring(title.indexOf(">") + 1, 0) +
title[title.indexOf(">") + 1].toUpperCase() +
title.substring(title.indexOf(">") + 2);
}
else {
if (title !== "") {
return title[0].toUpperCase() + title.substring(1);
}
else {
return "";
}
}
} else {
return "";
}
}
var stringWithEmptySymbols = '';
function emptySymbols() {
stringWithEmptySymbols += '\u00A0';
return stringWithEmptySymbols;
}
module.exports = {
underlinedText: underlinedText,
setFeedbackAndClearAttr: setFeedbackAndClearAttr,
emptySymbols: emptySymbols,
createTitle: createTitle
};
/***/ }),
/***/ 40:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var common = __webpack_require__( 1 );
var dom = __webpack_require__( 2 );
var UtilsShuffle = __webpack_require__( 42 );
var platform = __webpack_require__(0).run_on;
var Auxiliary = __webpack_require__( 4 );
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' ) {
var text = jQuery.trim( this.query_text );
text = Auxiliary.underlinedText(text);
// Replace newlines with
text = 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 {
if ( this.query_text == '' ) {
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;
/***/ }),
/***/ 41:
/***/ (function(module, exports) {
/**
* Created by Lupachev on 06.06.2017.
*/
var Question = Class.extend({
extract_metadata: function() {
if (this.jq == null) {
return;
}
this.md.add_from_jq(this.jq.find("[data-type=metadata]"));
},
// return whether or not metadata with the given key is set
md_set: function(key) {
return (this.md[key] != null);
},
is_complete: function() {
for (var i = 0; i < this.queries.length; ++i) {
if (!this.queries[i].userHasAnswered()) {
return false;
}
}
return true;
},
is_correct: function() {
for (var i = 0; i < this.queries.length; ++i) {
if (!this.queries[i].isCorrect()) {
return false;
}
}
return true;
},
get_weight: function() {
return Math.round(this.points_possible / player.activity.total_points_possible * 100);
},
check_conditional: function(condition) {
return "";
// condition will be, e.g.:
// ({1}=9) No, that's the intercept.
// meaning that if the first query is equal to 9, condition is met
if (condition.search(/\((.*?)\)\s*(.*)/) > -1) {
var test = RegExp.$1;
var s = RegExp.$2;
// prepare for eval: first convert "=" to "==" (but allow == too)
test = test.replace(/=/g, "==");
test = test.replace(/====/g, "==");
// now convert {1} to this.queries[0].user_answer;
while (test.search(/\{(\d+)\}/) > -1) {
var i = RegExp.$1 * 1 - 1;
test = test.replace(/\{(\d+)\}/, "this.queries[" + i + "].user_answer");
}
// and test
} else {
safe_log("error with feedback_conditional: " + condition);
return "";
}
},
init: function(atts) {
for (var j in atts) {
this[j] = atts[j];
}
this.queries = new Array();
this.tries = 0;
this.gave_up = false;
// extract question metadata
this.md = new Metadata({lowercase_keys:true});
// define any md items that need to be arrays
this.md.feedback_conditional = [];
this.md.next_step_conditional = [];
this.md.model_update_conditional = [];
this.extract_metadata();
}
});
module.exports = Question;
/***/ }),
/***/ 42:
/***/ (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;
/***/ }),
/***/ 43:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var dom = __webpack_require__(2);
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;
/***/ }),
/***/ 5:
/***/ (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__(1).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;
/***/ }),
/***/ 57:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(20);
/***/ })
},[57]);
//# sourceMappingURL=gardnerunderstanding3e_selfassessment.js.map