Viewing 9 replies - 1 through 9 (of 9 total)
  • use jQuery to get quiz results and send it using ajax ?

    Thread Starter ranorby

    (@ranorby)

    jQuery would be ok, but I can’t seem to find access to the values I need whether I want to put them into JSON or XML or the $_POST variable. Interestingly there are hooks for when the quiz finishes, but I can’t seem to get any of them to work. There is a lot of use of ob_ functions (object buffering), which I was unfamiliar with before digging into this plugin. I may be running afoul of some buffer flushing.

    try this
    jQuery(document).ready(function(){
    jQuery(‘input[name=”endQuizSummary”]’).click(function(){
    yourcode
    }
    })

    i tested it and the code is executed after the quiz finished. i use above code to retrieve my own version of leaderboard. well, it works.

    i tested it on localhost tough, never test it on real server. well, you can try it. let me know how it goes.

    Just tested the quiz by doing it while apache and mysql turned off. Surprisingly enough the quiz still scores me. so it is safe to assume that the scoring is all client side. it doesn’t need server. Somewhere on the page there is all answer to the quiz. no wonder scroring is instant. so, i think you can get the score by doing whatever you want when the user click “Finish Quiz” Button.

    Just get the text “You have reached xx of xxx points, (xx%)” and trim it according your needs.

    Thread Starter ranorby

    (@ranorby)

    Thanks yokowasis. I am looking forward to giving this a try!

    cheers

    Hi yokowasis,
    Want to use your code, but button with name “endQuizSummary” has style “display: none” when the quiz is displayed, so I can’t click it.
    Maybe you can tell me which settings I need to have in the quiz to have it displayed?

    This button is shown only when you activate the “preview questions” option, otherwise it is not shown and the quiz is terminated by a clic on a button whose name is “next”, same as when you answer a question.
    So not appropriate.
    I have a workaround which is to test the label of the button. Although it is not perfect, since it is language dependant, it works.
    Next step is to get the score and success indicator. Where can I find these?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Send Quiz Results to another file’ is closed to new replies.