Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Creating a "Quiz" on my Website

    I would like to add a "Quiz" to my website.

    I have used basic HTML forms to create how I would like the quiz to look, the quiz is multiple choice. Now I would like the quiz to be graded automatically without e-mailing me, and tell the user how they did.

    I don't know JAVA but I would like to know if Java would be one method of doing this.

    Any other methods I am also open to, thanks.

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,989
    Thanks
    56
    Thanked 557 Times in 554 Posts
    well, the first thing is that this is the javaSCRIPT forum. Java and javascript are 2 different languages.

    the next thing is that javascript is very good for things like collecting the answers that a user gives on a quiz, but it is very bad at keeping the correct answers secret, because all that anybody has to do to see the answers is hit "view source" and there it all is.

    but if you aren't worried about your users "cheating", probably javascript would be the easiest way to go.

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by xelawho View Post
    well, the first thing is that this is the javaSCRIPT forum. Java and javascript are 2 different languages.

    the next thing is that javascript is very good for things like collecting the answers that a user gives on a quiz, but it is very bad at keeping the correct answers secret, because all that anybody has to do to see the answers is hit "view source" and there it all is.

    but if you aren't worried about your users "cheating", probably javascript would be the easiest way to go.
    Ok "Javascript" then I apologize.

    Is this a fairly simple task for a beginner with javascript?

    I am also curious what other methods I could use to avoid cheaters.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,151
    Thanks
    80
    Thanked 4,559 Times in 4,523 Posts
    You can do it all in JavaScript, but anybody smarter than a turnip will be able to look at your JavaScript code and figure out what all the answers are. Thus defeating the normal purpose of a quiz.

    If it's just a "self-test" or maybe a "pre-test" and you don't really care if the person can cheat, then JavaScript is a fine way to do it.

    There have probably been at least one question like this every month for the past several years in this forum, so odds are good that a search of this forum will yield a workable answer. If you can't find something--and you don't care if people can cheat--then post again.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    I have a few quiz scripts at http://www.felgall.com/net3j.htm which don't allow people to cheat by just viewing the source code - it would require a lot more effort and a reasonable knowledge of JavaScript to work out the correct answers from the source - far more than is worth it for a quiz that is running in JavaScript and therefore can be considered to be "just for fun".

    If you want a quiz that will actually record the results at the end and do something with them then you'd do better to use a server side language to create the entire quiz as JavaScript cannot do all of the things that are necessary for a more serious quiz where the result matters.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,151
    Thanks
    80
    Thanked 4,559 Times in 4,523 Posts
    Well, I have to admit it was more work than it was worth, but...

    The answer is the first number modulo ( 2 more than ( second number modulo 13 ) )

    And adding this question caused it to bite the dust:
    What is the name of the ~ mark?

    <grin/>

    (Referring to your "Revised Quiz Maker 1".)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Old Pedant View Post
    Well, I have to admit it was more work than it was worth
    exactly - and you need to know JavaScript to be able to work it out (or have a very very large sample of quiz questions). For any 'just for fun' quiz that effort wouldn't be even remotely worth it.

    Quote Originally Posted by Old Pedant View Post
    And adding this question caused it to bite the dust:
    What is the name of the ~ mark?
    Yes I picked the ~ character as the separator because it is far less likely to occur in a quiz question or answer than any other easily accessible key on the keyboard. You obviously spotted that from the code and deliberately manufactured a question that you knew would break the script <grin/>

    I created those quizzes specifically because I was asked to by a number of people who were unable to install server side quizzes because of the limitations on what part of the site they controlled. I would not consider using any JavaScript quiz on a site where I had access to use a server side version instead.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,151
    Thanks
    80
    Thanked 4,559 Times in 4,523 Posts
    You could fix the embedded ~ problem.

    Just use \t instead. Unless somebody copy/pastes a question in to your generator program, they can't input a tab as part of a question. And even if they do, you could use a regular expression to zap all tabs (convert them to spaces, say). The use of the \t would make the code even more obscure looking.

    But never mind. That's being nit picky. It's a reasonably secure system, I agree. Not for serious quizzes but more than adequate for most website quizzes.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •