//############################################################ //Practice 1 ;(function () { 'use strict'; function slideInitHandler(section) { // console.log('slideInitHandler'); //section config section.points_possible = 1; section.points_earned = 0; section.section_completed = false; section.jq .addClass('practice1') //add Accessibility elements var ariaLabel = section.title + '. ' //+ section.instructions var ariaReader = $('
Select each of the buttons to see what happened to that group of rats.
' ) $step2 .find('.btn-0, .btn-1') .attr('data-showed', '') $step2 .find('.practice1__step2-initial-img') .show() $step2 .find('.continue-btn') .attr('disabled', true) .unbind('click') .bind('click', initStep3) $step2 .find('.practice1__step2-fb') .hide() $step2 .find('.btn-0') .attr('disabled', false) .unbind('click') .bind('click', function(){ $(this).attr('data-showed', 'true') $step2 .find('.practice1__step2-fb, .practice1__step2-initial-img') .hide() /* $step2 .find('.practice1__step2-fb--general') .show()*/ $step2 .find('.practice1__step2-fb--0') .show() checkIfStepCompleted() }) $step2 .find('.btn-1') .attr('disabled', false) .unbind('click') .bind('click', function(){ $(this).attr('data-showed', 'true') $step2 .find('.practice1__step2-fb, .practice1__step2-initial-img') .hide() /* $step2 .find('.practice1__step2-fb--general') .show()*/ $step2 .find('.practice1__step2-fb--1') .show() checkIfStepCompleted() }) function checkIfStepCompleted(){ var isCompleted = $step2 .find('.btn-0, .btn-1') .toArray() .reduce(function(isCompleted, item){ isCompleted = (isCompleted) ? !!$(item).attr('data-showed') : false return isCompleted }, true) if (!isCompleted) return $step2 .find('.continue-btn') .attr('disabled', false) $step2 .find('.practice1__step2-fb--general') .show() $('.footer') .html( $step2.find('.practice1__step2-instruction').contents().clone() ) } } function initStep3(){ $step2.hide() $step3.show() $('.footer') .html( $step3.find('.practice1__step3-instruction').contents().clone() ) finishTask(section) } } function finishTask(section) { // console.log('--------finishTask--------> '); section.points_earned = 1; section.section_completed = true; player.activity.grade_activity(); player.update_section_status(); //######################### document.querySelector('.navigation_button.next_button').focus(); // // Standard_Dialog.open('$feedback.text()', { // title: 'Practice 1 completed!' // }); } function slideHideHandler(section) { // console.log('slideHideHandler', section) } window.mheContpract = window.mheContpract || {}; window.mheContpract['practice1'] = { initialize: slideInitHandler, show: slideShowHandler, hide: slideHideHandler }; })(); ;(function () { 'use strict'; function slideInitHandler(section) { // console.log('slideInitHandler'); section.points_possible = 1; section.points_earned = 0; section.section_completed = false; var _elem = section.jq _elem.addClass('practice2') } function completeTask(section) { section.points_earned = 1; section.section_completed = true; player.activity.grade_activity(); player.update_section_status(); document.querySelector('.navigation_button.next_button').focus(); } function slideShowHandler(section) { // console.log('slideShowHandler', section); //init step0 --------------- var _elem = section.jq.focus() var ariaContainer = $('