Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When one infoMode is false the quiz calculation is incorrect. Fix required. #1

Closed
Matt-Webb opened this issue Apr 2, 2015 · 4 comments

Comments

@Matt-Webb
Copy link
Collaborator

Here is the main iteration routine for the quiz which establishes whether or not we are displaying a information box to the user after the question has been answered.

 $(data).each(function (index, object) {

            $(object.questions).each(function (index, object) {
                if (infoMode) {
                    if (currentQuestion === index) {
                        infoMode = false;
                        complete = false;
                        content = infoHTML(object.info);
                    }
                } else {
                    if (currentQuestion === index) {
                        complete = false;
                        content = questionHTML(object.question, object.answers);
                        if (object.includeInfo) infoMode = true;
                    }
                }
            });
        });
@romy2012
Copy link

while includeInfo set false, the score still 0.

includeInfo set false,finish the quiz,the scroe can't statistics.

@romy2012
Copy link

    // ITERATION LOGIC:

    var next = function ($this) {

        //if (infoMode) {
            var userAnswer = $($this).serializeArray();
            updateScore(userAnswer);
        //} else {
            currentQuestion += 1;
        //}
    };

@claudioromanosp
Copy link

How to solve this question?

@Matt-Webb
Copy link
Collaborator Author

This iteration has now been fixed as part of v0.2.0-alpha
https://github.com/Matt-Webb/jquery-quiz-using-json/blob/master/js/quiz.js#L127

Matt-Webb pushed a commit that referenced this issue Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants