webpackJsonp([0],{
/***/ 26:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var common = __webpack_require__(4);
MC_Query = __webpack_require__(50);
// Essay
Essay_Query = __webpack_require__(47);
// Player
var ChangedPlayer = __webpack_require__(0);
window.player = new ChangedPlayer();
common.initForceNextSection();
/***/ }),
/***/ 47:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ES_Query = __webpack_require__(49);
var Auxiliary = __webpack_require__( 3 );
var local_es_query = ES_Query.extend({
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 = jQuery.trim(text).replace(/\n/g, ' ');
var id = 'query_text_' + this.query_index;
// Old comment in sciam project by someone:
// "I don't know why question for textarea was changed by _
// and actual question is placed before textarea just in
,
// but we don't need this label"
if (this.parent_question && this.parent_question.md) {
if (this.parent_question.md.no_indent === 'true') {
var indent_class = ' no_indent';
}
else {
indent_class = '';
}
if (this.parent_question.md.child_question === 'true') {
this.parent_question.jq.addClass('child_question');
}
}
if (text !== '_') {
return '
' + text + '
';
}
else {
return '';
}
}
}
});
module.exports = local_es_query;
/***/ }),
/***/ 49:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var platform = __webpack_require__(2).run_on;
var Auxiliary = __webpack_require__( 3 );
var ES_Query = Essay_Query.extend({
/**
* Get correct HTML for query text and set id for following use
* @returns {string} Html for query text
*/
focus_user_input: function() {
var delay = ( platform.ie || platform.mac ) ? 2500 : 1200;
setTimeout('$("#query_answer_' + this.query_index + '").select();', delay);
},
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 = jQuery.trim(text).replace(/\n/g, ' ');
var id = 'query_text_' + this.query_index;
// Old comment in sciam project by someone:
// "I don't know why question for textarea was changed by _
// and actual question is placed before textarea just in
,
// but we don't need this label"
if (text !== '_') {
return '
' + 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;
// for Android and iOS we use advanced feedback
// feedbackId contains:
// essay_question_evaluation_feedback - id for div with text 'You must enter an answer'
// question_feedback - id for div with full feedback
var feedbackId = 'essay_question_evaluation_feedback_' + this.query_index + ' question_feedback_' + (this.query_index + 1);
var labelledBy = (platform.android || platform.ios) ? ' aria-labelledby="' + feedbackId + ' ' + queryTextId + '"' : ' aria-labelledby="' + queryTextId + '"';
html += '';
return html;
},
/**
* Fix typo evaluation
* @param {string} html
*/
set_evaluation_feedback: function(html) {
var htmlLive = html;
// Set message below the textarea
html = '
' + html + '
';
$('#essay_question_evaluation_feedback_' + this.query_index).remove();
$('#query_answer_' + this.query_index).after(html);
// no need for #live-feedback for iOS and android
if(!platform.android && !platform.ios) {
if ( platform.ie ) {
Auxiliary.setFeedbackAndClearAttr('assertive', 5000, htmlLive);
} else if ( platform.mac ) {
$('#live-feedback').html(htmlLive + Auxiliary.emptySymbols());
} else {
$('#live-feedback').html(htmlLive);
}
}
}
});
module.exports = ES_Query;
/***/ }),
/***/ 50:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var common = __webpack_require__( 4 );
var dom = __webpack_require__( 5 );
var UtilsShuffle = __webpack_require__( 52 );
var platform = __webpack_require__(2).run_on;
var Auxiliary = __webpack_require__( 3 );
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;
/***/ }),
/***/ 52:
/***/ (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;
/***/ }),
/***/ 70:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(26);
/***/ })
},[70]);
//# sourceMappingURL=markel_ps3e.js.map