webpackJsonp([0],{
/***/ 101:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(30);
/***/ }),
/***/ 30:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Figures = __webpack_require__(70);
var project_player = __webpack_require__(0);
window.player = new project_player();
Essay_Query = __webpack_require__(6);
MC_Query = __webpack_require__(71);
// Dialog
window.Standard_Dialog = __webpack_require__(73);
(function ( i, s, o, g, r, a, m ) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push( arguments ); // eslint-disable-line prefer-rest-params
}, i[r].l = 1 * new Date();
a = s.createElement( o ),
m = s.getElementsByTagName( o )[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore( a, m );
})( window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga' );
window.WebFontConfig = { // eslint-disable-line no-unused-vars
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 );
})();
/***/ }),
/***/ 70:
/***/ (function(module, exports) {
var project_figures = Figures.extend( {
process_media: function () {
this.process_headings();
// we're not currently using this (jwplayer is not being included)
$( '[data-mmtype=\'mp3\']' ).each( function ( index, element ) {
var jq = $( element );
var id = jq.attr( 'data-figure-id' );
var mmsrc = jq.attr( 'data-mmsrc' );
// http://www.longtailvideo.com/jw/upload/bunny.mp3
// http://www.youtube.com/embed/CsGYh8AacgY
var src = jq.attr( 'src' );
var attr = jq.attr( 'data-attr' );
if ( attr == null ) {
attr = '';
}
attr = attr.split( /\s*,\s*/ );
var params = {};
params.width = jq.width();
params.height = jq.height() + 24; // 24 is for the controler at the bottom
params.file = mmsrc;
params.image = src;
params.controlbar = 'bottom';
params.screencolor = 'ffffff';
params['viral.allowmenu'] = 'false';
params['viral.onpause'] = 'false';
params['viral.oncomplete'] = 'false';
// determine url of flashplayer based on whether we're published or not
if ( UI_Elements.in_preview_mode() ) {
params.flashplayer = '/js/preview/player.swf';
}
else {
params.flashplayer = 'js/player.swf';
}
safe_log( params.flashplayer );
for ( var i = 0; i < attr.length; ++i ) {
var a = attr[i].split( /\s*=\s*/ );
params[a[0]] = a[1];
}
jwplayer( id ).setup( params );
} );
// AF: this is less than ideal, but i had to make
// this a global variable so it can be accessed by the video players when they fire the templateloaded event.
// we should look into changing it.
videos.templateReady = function ( figureObjectID ) {
var vidplayer = brightcove.api.getExperience( figureObjectID );
// var experienceModule = vidplayer.getModule( brightcove.api.modules.APIModules.EXPERIENCE );
var playerModule = vidplayer.getModule( brightcove.api.modules.APIModules.VIDEO_PLAYER );
var questionSequence = $( '#' + figureObjectID )
.closest( '[data-type="figure"]' )
.nextAll( '[data-block_type="question_sequence"], [data-block_type="question_sequence_one_at_a_time"]' );
questionSequence.each( function ( index, element ) {
if ( $( element ).attr( 'data-block_type' ) == 'figure' ) {
// we have found another video following the current one, so stop
if ( $( element ).find( '.BrightcoveExperience' ).size() > 0 ) {
return false;
}
}
var questionSequenceIndex = $( element ).attr( 'question_sequence_index' );
var questionSequenceMetaData = $( element ).find( '[data-type="box_inner"]' )
.children( '[data-type="metadata"]' ).find( '[key="cuepoint"]' ).html();
$( element ).hide();
if ( questionSequenceMetaData != null ) {
var cuePointsModule = vidplayer.getModule( brightcove.api.modules.APIModules.CUE_POINTS );
var CuePointType = brightcove.api.modules.CuePointsModule.CuePointType;
var cuePoints = [{
name: figureObjectID,
metadata: questionSequenceIndex,
time: questionSequenceMetaData,
type: CuePointType.CODE
}];
cuePointsModule.addCuePoints( videos[figureObjectID], cuePoints );
videos.question_sequence_to_video_map[questionSequenceIndex] = figureObjectID;
}
} );
playerModule.addEventListener( brightcove.api.events.CuePointEvent.CUE, videos.cuePointEvent );
};
videos.cuePointEvent = function ( e ) {
// get the player - the name property of the cuePoint is set to the ID of the Brightcove experience
// so we can find the player here.
var vidplayer = brightcove.api.getExperience( e.cuePoint.name );
globalPlayer = brightcove.api.getExperience( e.cuePoint.name );
safe_log( 'got vid player' );
var playerModule = vidplayer.getModule( brightcove.api.modules.APIModules.VIDEO_PLAYER );
safe_log( 'got module' );
playerModule.pause( true );
safe_log( 'paused' );
player.show_question_sequence( e.cuePoint.metadata, false );
};
},
process_headings: function () {
$( '[data-block_type="activity_title"] p, [data-block_type="page_title"] p,'
+' [data-block_type="page_title2"] p, [data-type="box_inner"] > p:first-child' )
.attr( 'role', 'heading' );
},
process_iframes: function (jq) {
if (jq == null) {
jq = $('body');
}
jq.find('[data-mmtype="iframe"]').each(function (index, element) {
var jq = $(element);
var src = jq.attr('data-mmsrc');
var attr = jq.attr('data-attr');
if (attr == null) {
attr = '';
}
// get default width and height from the placeholder image
var params = {};
// iframe has max with of 920 or it creates double scrollbars
var width = jq.width();
if (width > 920) {
width = 920;
}
params.width = width;
safe_log("setting iframe width to " + params.width);
params.height = jq.height();
params.frameborder = 'no';
params.scrolling = 'no';
params.style = 'margin:0px; padding:0px';
params.src = src;
if (attr !== '') {
attr = attr.split(/\s*,\s*/);
for (var i = 0; i < attr.length; ++i) {
var a = attr[i].split(/\s*=\s*/);
params[a[0]] = a[1];
}
}
var pstring = '';
/* eslint-disable guard-for-in*/
for (var i in params) {
pstring += ' ' + i + '="' + params[i] + '"';
}
/* eslint-enable guard-for-in*/
jq.replaceWith('');
});
}
} );
module.exports = project_figures;
/***/ }),
/***/ 71:
/***/ (function(module, exports, __webpack_require__) {
var MC_Query = __webpack_require__(77);
/**
* God know what it does
* @param {string} query_text String
* @return {stirng} query_text String
*/
function clean_query_text (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(/ ';
// Build answer selection
var is_correct = false;
for ( var z = 0; z < this.choices.length; z++ ) {
var index = this.choice_order[z];
// if this is review mode...
var checked = '';
var disabled = '';
var radio_style = 'query_mc_other_choice';
if ( mode == 'review' || mode == 'review_correct_incorrect' || mode == 'preview' ) {
// if it's the correct choice, it should be marked in green
if ( index == this.correct_answer_index ) {
// but only if we're *not* in review_correct_incorrect mode or this is the user's choice
if ( mode != 'review_correct_incorrect' || index == this.user_answer_index ) {
radio_style = 'query_mc_correct_choice';
}
// if this is what the user chose, he got it correct
if ( index == this.user_answer_index ) {
is_correct = true;
}
// else if it's the user's choice (and this.md.no_correct_answer is not true), it should be marked in red
}
else if ( index == this.user_answer_index && this.md.no_correct_answer != 'true' ) {
radio_style = 'query_mc_incorrect_user_choice';
}
// and the input should be disabled, unless we're in review_correct_incorrect mode
if ( mode != 'review_correct_incorrect' ) {
disabled = 'disabled';
}
}
// if this is the choice the user clicked, it's checked (regardless of mode)
if ( index == this.user_answer_index ) {
checked = 'checked';
}
// Create radio button input plus label
html += '
/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, '-');
query_text = query_text.replace(/<a .*?>/g, '');
query_text = query_text.replace(/<\/a>/g, '');
safe_log('clean_query_text: ' + query_text);
return query_text;
}
var project_mc = MC_Query.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';
}
},
// mode should be "delivery" or "review"; "delivery" is assumed
getHTML: function ( mode ) {
// 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 = this.query_text_html();
// wrap answers in a p tag
html += '
';
}
// get a possible feedback string; this fn will take account of mode
html += this.correct_incorrect_feedback( mode, is_correct );
html += ''
+ ' '
// + "" + this.choice_ids[z] + ". "
+ ''
+ '