Progress indicator fixes

Clicking a dot in the progress view jumps to relevant question
Already answered questinos will be marked as such.
d3summaryChart
Frank Ronny Larsen 2013-01-15 08:17:59 +01:00
parent ac381582c5
commit 6c555191ac
1 changed files with 7 additions and 2 deletions

View File

@ -195,9 +195,16 @@ H5P.QuestionSet = function (options) {
$('#qdot-' + currentQuestion, $myDom).removeClass('unanswered').addClass('answered'); $('#qdot-' + currentQuestion, $myDom).removeClass('unanswered').addClass('answered');
_updateFinishButton(); _updateFinishButton();
}); });
if (quest.getAnswerGiven()) {
$('#qdot-'+i, $myDom).removeClass('unanswered').addClass('answered');
}
} }
// Set event listeners. // Set event listeners.
$('.progress-dot', $myDom).click(function (ev) {
var idx = parseInt($(this).attr('id').split('-')[1]);
_showQuestion(idx);
});
$('.next.button', $myDom).click(function (ev) { $('.next.button', $myDom).click(function (ev) {
_showQuestion(currentQuestion + 1); _showQuestion(currentQuestion + 1);
}); });
@ -259,8 +266,6 @@ H5P.QuestionSet = function (options) {
// Get total score possible for questionset. // Get total score possible for questionset.
var totalScore = function () { var totalScore = function () {
return questionInstances.length;
// FIXME: questions need to get totalScore function.
var score = 0; var score = 0;
for (var i = questionInstances.length - 1; i >= 0; i--) { for (var i = questionInstances.length - 1; i >= 0; i--) {
score += questionInstances[i].totalScore(); score += questionInstances[i].totalScore();