var Activity_manuscript_type = Activity.extend({
current_question: null,
quiz_completed: false,
complete_quiz: function () {
// show questions
for (var i = 1; i < this.questions.length; ++i) {
this.questions[i].jq.show();
}
var html = "
"
+ "Activity complete. Total score: " + player.activity.total_points_earned
+ " out of " + player.activity.total_points_possible
+ " points (" + player.activity.grade_percent + "%)"
+ "
"
;
$("[data-block_type=question_sequence_one_at_a_time]").after(html);
// scroll to bottom of screen
$(window).scrollTo({ top: 2000, left: 0 }, { duration: 500 });
this.quiz_completed = true;
},
show_next_question: function (question) {
this._super(question);
if (question.index >= this.questions.length - 1) {
this.complete_quiz();
return;
}
}
});
var Player_lodish_animations = Player.extend({
show_questions: function(){
$("[data-block_type=question_sequence_one_at_a_time]").show();
$("#beginButton").hide();
},
initialize: function () {
var title = $("h1").find("[data-type=title]").html();
$("[data-type=chapter]").prepend("
" + title + "
");
this._super();
this.activity = new Activity_manuscript_type();
$("[data-block_type=question_sequence_one_at_a_time]").after("");
$("#beginButton").button();
},
initialize2: function () {
this._super();
}
});
player = new Player_lodish_animations();