display one quiz at a time

Help
alber
2011-09-26
2013-05-28
  • alber
    alber
    2011-09-26

    How could I randomly start one quiz on page load without giving the option to choose from multiple quizzes. I want to have 4 quizzes but randomly (on page load) server one at a time rather then give the user a choice of 4.  Can that be done?

     
  • alber
    alber
    2011-09-26

    p.s. just to clarify - I want to keep the opening scene with the "start quiz" button but eliminate the ability to choose which quiz they get.

    Is that possible?

     
  • Joe B.
    Joe B.
    2011-09-29

    The easiest way to do what you want would be to drop several copies of the quizzy folder in your web root each with a different name and only one quiz in the quizzes folder.

    So instead of having

    /quizzy/quizzes/Lots of quizzes.xml
    

    You'd have

    /quiz1/quizzes/firstquiz.xml
    /quiz2/quizzes/secondquiz.xml
    ...
    

    Where each of the quiz folders contain identical copies of the quizzy files.

    Then when you want to include one of those quizzes on a page, instead of including quizzy/quizzy_header.php in your header and quizzy/quizzy.php in your document where you want the quiz, include quiz1/quizzy_header.php in your header and quiz1/quizzy.php in the document where you want the quiz.

    it's not pretty or efficient but it'll work until I can add such a feature to quizzy (it's already in the tracker)

     
  • Matt Bergstrom
    Matt Bergstrom
    2011-11-02

    Is there a way to do this and bypass the start quiz option? I only have 1 quiz and I'd like it to simply start the quiz when a user lands on the page.

     
  • Joe B.
    Joe B.
    2011-11-05

    bergysmalls:

    Unfortunately, I've looked into adding this feature and it was going to be pretty tricky to pull off. You could add your own work-around that would cause the first quiz option to be selected and the quiz to be started automatically by adding the following code the header of the page:

    <script type="text/javascript">
    $(document).ready(function() {
         // Click to select the first quiz
         $('#quizzy_quiz_opt0').click();
         // Click the start button
         $('#quizzy_start_b').click();
    };
    </script>
    

    If you did this, the user would still see the quiz select page but it would quickly scroll off to the left as the quiz starts. Not ideal, I know, but It'll work until that feature is supported by quizzy.

     
  • islam
    islam
    2012-03-18

    where to add this code ?? ((the file name))

     

  • Anonymous
    2013-01-28

    Yes, where to add this? :)

    Kind regards