webpackJsonp([1],{
/***/ 113:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(32);
/***/ }),
/***/ 32:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(60);
var player_ch9 = __webpack_require__(79);
window.player = new player_ch9();
/***/ }),
/***/ 60:
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/***/ 78:
/***/ (function(module, exports, __webpack_require__) {
var project_activity = __webpack_require__(5);
var activity_ch9 = project_activity.extend({
show_next_question: function (question) {
// if the item is in a sequence, show the next question
if (question.question_sequence != null) {
var qs = question.question_sequence;
var next_qs_index = question.question_sequence_index + 1;
var next_question = qs.questions[next_qs_index];
// what we do next is a little different
// depending on whether this is a one-at-a-time sequence
if (qs.one_at_a_time === false) {
// for *not* one at a time, just slide down the next item
if (next_question != null) {
next_question.jq.slideDown('fast', function () {
// when we're done showing the new question, scroll down to it
$(window).scrollTo($(this));
});
// if there is no next_question, sequence is complete.
}
else {
qs.sequence_complete = 'complete';
}
// for one-at-a-time, ...
}
else {
// if we have a next question, change the question submit button
// to a button for showing the next item
if (next_question != null) {
$('#question_submit_button_' + question.index).val('Next Question')
.unbind('click')
.click({'question': question, 'next_question': next_question}, function (e) {
// on click of this button, hide the current question and fade in the next one
e.data.question.jq.hide();
// use the below animation instead of fadeIn because it doesn't completely hide the item first
// and thus doesn't cause the window to scroll to the top.
e.data.next_question.jq.show()
.css({opacity: 0.25})
.animate({opacity: 1.0}, 500);
$.scroll_item_onto_screen(e.data.next_question.jq, {duration: 10, additional_padding: 50});
// update the sequence navigator
var index = e.data.next_question.question_sequence_index + 1;
var qs = e.data.question.question_sequence.index;
$('#question_sequence_index_' + qs).html(index);
var i = e.data.question.index;
$( '#query_answer_' + i).focus();
var text = $( '#textarea_description_question_' + i ).text();
$( 'body' ).append( '
' + text + '
' );
})
.show();
// make sure the button is visible
$.scroll_item_onto_screen($('#question_submit_button_'
+ question.index), {duration: 10, additional_padding: 50} );
// else we're done with the sequence, so if sequence_complete is false...
}
else if (qs.sequence_complete === false) {
var points_possible = 0;
var points_awarded = 0;
for (var i = 0; i < qs.questions.length; ++i) {
for (var j = 0; j < qs.questions[i].queries.length; ++j) {
var query = qs.questions[i].queries[j];
points_awarded += query.getPointsAwarded();
points_possible += query.getPointsPossible();
}
}
// round to at most two decimal places
points_awarded = Math.round(points_awarded * 100) / 100;
points_possible = Math.round(points_possible * 100) / 100;
var html = '
'
+ 'Total points awarded for this question sequence: '
+ points_awarded + ' out of ' + points_possible + ' '
+ '
'
;
safe_log(qs.closing_material);
if (qs.closing_material != null) {
// if student is reviewing (i.e. came back to the activity after completing in an earlier
// session), the show_closing_material function will be called by restore_saved_answers
var show_summary_text = 'Show Summary';
html += '
'
+'
';
// if there's closing material we're *kind of* done with the sequence now;
// set to "partial" so we won't add this html again
qs.sequence_complete = 'partial';
// if there's no closing material, we're completely through with the sequence now.
}
else {
qs.sequence_complete = 'complete';
// in this case we need to show the question_sequence_review right away
html = html.replace(/class='question_sequence_review'/,
'class=\'question_sequence_review\' style=\'display:none\'');
}
qs.inner_jq.append(html);
$('#closing_material_button_' + qs.index).button();
}
}
}
}
});
module.exports = activity_ch9;
/***/ }),
/***/ 79:
/***/ (function(module, exports, __webpack_require__) {
var project_player = __webpack_require__(0);
var activity_ch9 = __webpack_require__(78);
var platform = __webpack_require__( 1 ).run_on;
var KEY_CODES = __webpack_require__(2).KEYCODES;
window.Local_Dialog = function () {
var $manuscript = $('#manuscript');
var $body = $('body');
var $dialog, $content;
var options = {};
return {
open: function (html, opt) {
// Extend default options
options = $.extend(true, (opt || {}), {
modal: true,
draggable: false,
resizable: false
});
// Set buttons
if (options.buttons === 'none') {
options.buttons = null;
}
else if (options.buttons === 'OK' || !options.buttons) {
options.buttons = [{text: 'OK', click: Local_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);
var $parentDialog = $dialog.parent().attr({
'tabindex': '0',
'role': 'dialog',
'aria-labelledby': !platform.android && !platform.ios ? 'ui-dialog-title-standard_dialog_div' : ''
});
$parentDialog.find('#ui-dialog-title-standard_dialog_div').attr({
'role': 'heading',
'aria-level': '1',
'style': 'color: #4e4e4e; font-family: Verdana, Arial, sans-serif; font-size: 16px; font-weight: 700; '
+ 'float: none'
});
$parentDialog.find('.ui-dialog-titlebar').attr({
'style': 'text-align: center; margin-top: 50px'
});
// 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) {
Local_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();
}
});
$parentDialog.css('top', '75px');
var heading = $('#ui-dialog-title-standard_dialog_div');
heading.attr('tabIndex', '-1');
if (!platform.firefox && !platform.ie) {
$firstBtn.attr('aria-label', heading.text() + ' OK');
}
if (platform.ios) {
heading.focus();
setTimeout(function () {
$firstBtn.focus();
}, 400);
}
if (!platform.firefox && !platform.ie) {
setTimeout(function () {
$firstBtn.removeAttr('aria-label');
}, 1000);
}
if (!platform.ios) {
for (var i = 0; i < 3; i++) {
setTimeout(function () {
$firstBtn.focus();
}, 100);
}
}
},
// for now alert is just like any other dialog; we could change that later.
wait: function (html, opt) {
options = opt || {};
options.buttons = 'none';
Local_Dialog.open(html, options);
},
alert: function (html, opt) {
Local_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');
}
}
};
}();
var player_ch9 = project_player.extend( {
start_activity: function () {
var src = $( '[data-block_type=activity_iframe] iframe ' ).attr( 'src' );
// var window_width = 1100;
// var window_height = 720;
window.Local_Dialog.open('', {
title: 'Enrollment of 3-, 4-, and 5-year-olds in Pre-primary Programs',
width: 1200,
height: 800,
from: $('.start_activity_button')
});
var heading = $('#ui-dialog-title-standard_dialog_div');
if (platform.firefox) {
$('.ui-dialog.ui-widget.ui-widget-content.ui-corner-all').removeAttr('aria-labelledby');
for (var i = 0; i < 3; i++) {
setTimeout(function () {
heading.focus();
}, 100);
}
setTimeout(function () {
for (var i = 0; i < 3; i++) {
setTimeout(function () {
$('.ui-dialog.ui-widget.ui-widget-content.ui-corner-all button').focus();
}, 100);
}
}, 400);
}
var $graphIframe = $('#standard_dialog_div iframe');
$graphIframe.attr('aria-hidden', true);
var altText = 'A line graph contains 4 sequences for the data.'
+'The vertical axis shows the percentage of 3-, 4-, and 5-year-olds'
+' Enrolled in Pre-Primary Programs, ranging from 0 to 100, in increments of 10.'
+' The horizontal axis is a timeline, with time given in years, and points at 1970,'
+' 1980, 1990, 1995, 2000, 2005, 2010, and 2016. Four lines are almost parallel.'
+' For the line showing the percentage of 5-year-olds Enrolled in Pre-Primary Programs,'
+' the percentage is 69.3 for the year 1970, 84.7 for the year 1980, 88.8 for the year 1990,'
+' 87.5 for the year 1995, 87.6 for the year 2000, 86.4 for the year 2005, 86.3 for the year 2010,'
+' and 85.9 for the year 2016. For the line showing the percentage of 4-year-olds'
+' Enrolled in Pre-Primary Programs, the percentage is 27.8 for the year 1970, 46.3 for the year 1980,'
+' 56.1 for the year 1990, 61.6 for the year 1995, 64.9 for the year 2000, 66.2 for the year 2005, 68.6'
+' for the year 2010, and 65.9 for the year 2016. For the line showing the percentage of 3-year-olds'
+' Enrolled in Pre-Primary Programs, the percentage is 12.9 for the year 1970, 27.3 for the year 1980,'
+' 32.6 for the year 1990, 35.9 for the year 1995, 39.2 for the year 2000, 41.3 for the year 2005,'
+' 38.2 for the year 2010, and 41.6 for the year 2016. For the line showing the total percentage of 3, 4,'
+' and 5-year-olds Enrolled in Pre-Primary Programs, the percentage is 37.5 for the year 1970, 52.5 for'
+' the year 1980, 59.4 for the year 1990, 61.8 for the year 1995, 64 for the year 2000, 64.3 for the year 2005,'
+' 63.7 for the year 2010, and 64.6 for the year 2016.';
var $altIMG = $('');
$altIMG.attr('alt', altText);
$altIMG.insertBefore($graphIframe);
// 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' );
},
initialize: function () {
this._super();
var $headers = $( '[data-block_type="header_text_block"]' );
$headers.each( function ( i, v ) {
var header = $( v ).find( 'p' ).html();
$( v ).html( '
' + header + '
' );
} );
this.activity = new activity_ch9();
},
create_start_activity_button: function () {
var button = $( '[data-block_type=start_activity_button]' );
if ( button.length ) {
var button_html = '';
button.after( button_html );
}
}
});
module.exports = player_ch9;
/***/ })
},[113]);
//# sourceMappingURL=bergerls11e_dataconnections_ch9.js.map