var Player_ch03 = Player_ays.extend({
update_section_status: function () {
this._super();
var question_index = 1;
var curSectionIndex = player.get_current_section().index;
if( curSectionIndex && !$(".first-part-questions-text").find("p").length > 0) {
var prevSection = player.sections[curSectionIndex - 1].jq;
if( prevSection.find("[data-type=question]").length > 0 ) {
var queries = player.activity.questions[question_index].queries;
var answerNodes = [];
//var questionsCount = player.activity.questions.length;
//player.sections[section.index];
for ( var i = 0; i < queries.length; i++ ) {
var userIndex = queries[i].user_answer_index;
answerNodes[i] = queries[i].choices[userIndex];
}
var scoreSection = player.get_current_section().jq[0];
var firstQuestions = scoreSection.querySelector(".first-part-questions-text");
var secondQuestions = scoreSection.querySelector(".second-part-questions-text");
var firstQuestionsP = document.createElement('p');
//firstQuestionsP.setAttribute("tabindex", "0");
var secondQuestionsP = document.createElement('p');
//secondQuestionsP.setAttribute("tabindex", "0");
firstQuestionsP.innerHTML = "You " +
"" + answerNodes[0] + "" +
" that this person might abandon you, and you " +
"" + answerNodes[1] + "" +
" that this person doesn’t care for you. ";
secondQuestionsP.innerHTML = "You also " +
"" + answerNodes[2] + "" +
" that you usually discuss your concerns and problems with this person and you " +
"" + answerNodes[3] + "" + " that you can turn to this person in times of need.";
firstQuestions.appendChild(firstQuestionsP);
secondQuestions.appendChild(secondQuestionsP);
}
}
},
initialize: function () {
this._super();
var $sections = $('[data-type="section"]');
var $link = $($sections[2]).find('a');
$link.attr('aria-label', 'For a more detailed assessment of your attachment style, click on a link to listen.');
}
});
player = new Player_ch03();