Making a "quiz" using Javascript

Discussion in 'Javascript' started by Antha, Jun 11, 2008.

  1. Antha

    Antha Guest

    Hi!

    I have a small e-commerce site but for everything else webrelated I'm
    practically virgin...
    I'd like to offer some sort of quiz in my shop so people can
    interactively find out which products suits them best. They should be
    able to answer some short questions (type: is your skin a. oily b.
    sensitive c.dry d.normal) and their score should be added up,
    resulting in their best-matching (in this case skin care) program. A
    friend of mine said Javascript should be able to do the trick and that
    there are loads of free scripts to be found with Google but I haven't
    found quite what I'm looking for... Anybody any ideas?

    Thanks!
    Antha, Jun 11, 2008
    #1
    1. Advertising

  2. Antha

    Antha Guest

    On 11 jun, 17:22, Dan Rumney <> wrote:
    > > I have a small e-commerce site but for everything else webrelated I'm
    > > practically virgin...
    > > I'd like to offer some sort of quiz in my shop so people can
    > > interactively find out which products suits them best. They should be
    > > able to answer some short questions (type: is your skin a. oily b.
    > > sensitive c.dry d.normal) and their score should be added up,
    > > resulting in their best-matching (in this case skin care) program. A
    > > friend of mine said Javascript should be able to do the trick and that
    > > there are loads of free scripts to be found with Google but I haven't
    > > found quite what I'm looking for... Anybody any ideas?

    >
    > Something like that is probably going to require some server-side scripting.
    >
    > If this is really for your business, I'd strongly recommend that you
    > find a skilled web-developer to do this for you. This is an investment
    > in your business and the returns you reap are going to be in direct
    > correlation to the quality of the investment you make.
    >
    > I'm not sure that digging free scripts off the internet is going to
    > result in a professional looking store-front.


    You're probably right. The only thing is, it's such a young site
    (currently even offline due to hosting issues) I hardly realize a
    turnover at all, let alone profit. Making real investments seems a bit
    premature.
    Maybe it's best to work with e-mail-forms for the time being to reply
    on people's enquiries instead of making some unprofessional mumble
    jumble with free scripts... Thanks anyway!
    Antha, Jun 11, 2008
    #2
    1. Advertising

  3. Antha

    Baris-C Guest

    On Jun 11, 5:01 pm, Antha <> wrote:
    > Hi!
    >
    > I have a small e-commerce site but for everything else webrelated I'm
    > practically virgin...
    > I'd like to offer some sort of quiz in my shop so people can
    > interactively find out which products suits them best. They should be
    > able to answer some short questions (type: is your skin a. oily b.
    > sensitive c.dry d.normal) and their score should be added up,
    > resulting in their best-matching (in this case skin care) program. A
    > friend of mine said Javascript should be able to do the trick and that
    > there are loads of free scripts to be found with Google but I haven't
    > found quite what I'm looking for... Anybody any ideas?
    >
    > Thanks!


    You can't do that with client side javascript, you need server side
    scripting.
    Baris-C, Jun 12, 2008
    #3
  4. Baris-C wrote:
    > On Jun 11, 5:01 pm, Antha <> wrote:
    >> I'd like to offer some sort of quiz in my shop so people can
    >> interactively find out which products suits them best. They should be
    >> able to answer some short questions (type: is your skin a. oily b.
    >> sensitive c.dry d.normal) and their score should be added up,
    >> resulting in their best-matching (in this case skin care) program.

    >
    > You can't do that with client side javascript, you need server side
    > scripting.


    What about the problem requires server-side scripting? The description
    says that the user provides input in response to prompts and a result
    is computed. Any TC language can compute a (computable) result from
    input, and Javascript has provisions for both prompting and taking
    input from the user.

    --
    Michael Wojcik
    Micro Focus
    Rhetoric & Writing, Michigan State University
    Michael Wojcik, Jun 12, 2008
    #4
  5. Antha

    Mike Duffy Guest

    Michael Wojcik <> wrote in news:g2s8ac231h4
    @news4.newsguy.com:

    > What about the problem requires server-side scripting? The description
    > says that the user provides input in response to prompts and a result
    > is computed. Any TC language can compute a (computable) result from
    > input, and Javascript has provisions for both prompting and taking
    > input from the user.


    I agree. But I do need to ask what TC stands for.
    Mike Duffy, Jun 13, 2008
    #5
  6. Mike Duffy wrote:
    > Michael Wojcik wrote:
    >> [...] Any TC language can compute a (computable) result from
    >> input, and Javascript has provisions for both prompting and taking
    >> input from the user.

    >
    > I agree. But I do need to ask what TC stands for.


    <http://en.wikipedia.org/wiki/Turing-complete>, I presume.


    HTH

    PointedEars
    --
    Anyone who slaps a 'this page is best viewed with Browser X' label on
    a Web page appears to be yearning for the bad old days, before the Web,
    when you had very little chance of reading a document written on another
    computer, another word processor, or another network. -- Tim Berners-Lee
    Thomas 'PointedEars' Lahn, Jun 13, 2008
    #6
  7. Thomas 'PointedEars' Lahn wrote:
    > Mike Duffy wrote:
    >> Michael Wojcik wrote:
    >>> [...] Any TC language can compute a (computable) result from
    >>> input, and Javascript has provisions for both prompting and taking
    >>> input from the user.

    >> I agree. But I do need to ask what TC stands for.

    >
    > <http://en.wikipedia.org/wiki/Turing-complete>, I presume.


    Yes. I'm really using the term informally (much as big-O notation for
    algorithmic complexity gets thrown around in comp.* groups in ways
    that aren't quite kosher), to mean "any language that's roughly
    equivalent to other general-purpose programming languages".

    In their ideal form, general-purpose programming languages have all
    the constructs they need to express the algorithms that a Turing
    machine can compute. That's not exactly what "Turing-complete" means,
    but it's pretty close. (In practice, real-world implementations of
    programming languages are limited by real-world computers, which have
    finite storage and execution time, so they're really equivalent to
    bounded Turing machines, which are equivalent to push-down automata,
    which are not Turing-complete. But we generally ignore that detail.)

    But for shorthand purposes we say "a Turing-complete language" to mean
    a programming language that lets us loop through states, and choose
    the next state based on input or a stored value, and store values, and
    select among stored values.

    --
    Michael Wojcik
    Micro Focus
    Rhetoric & Writing, Michigan State University
    Michael Wojcik, Jun 13, 2008
    #7
  8. Michael Wojcik <> writes:

    [Turing complete]
    > Yes. I'm really using the term informally (much as big-O notation for
    > algorithmic complexity gets thrown around in comp.* groups in ways
    > that aren't quite kosher), to mean "any language that's roughly
    > equivalent to other general-purpose programming languages".


    It's good enough for me. I wouldn't argue that it isn't formally true
    too.

    > In their ideal form, general-purpose programming languages have all
    > the constructs they need to express the algorithms that a Turing
    > machine can compute.


    Indeed. Most language are defined in their ideal form, and only
    the implementations are restricted. I don't believe there is a limit
    on the amount of memory that Java can use in the language specification,
    so the language itself is Turing Complete.

    > That's not exactly what "Turing-complete" means, but it's pretty
    > close. (In practice, real-world implementations of programming
    > languages are limited by real-world computers, which have finite
    > storage and execution time, so they're really equivalent to bounded
    > Turing machines, which are equivalent to push-down automata, which
    > are not Turing-complete. But we generally ignore that detail.)


    Pedantry: Bounded turing machines (BTM) are more powerfull than
    push-down automata (PDA). BTMs recognize the context sensitive
    languages, whereas PDAs recognize the context free languages. An
    example of a language recognized by a BTM but not a PDA is
    { ww | w in S* } (where S is the input alphabet).

    > But for shorthand purposes we say "a Turing-complete language" to mean
    > a programming language that lets us loop through states, and choose
    > the next state based on input or a stored value, and store values, and
    > select among stored values.


    I'd accept "Turing complete" for any generic programming language,
    and most domain specific languages too.

    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, Jun 13, 2008
    #8
  9. Lasse Reichstein Nielsen wrote:
    > Michael Wojcik <> writes:
    >
    >> That's not exactly what "Turing-complete" means, but it's pretty
    >> close. (In practice, real-world implementations of programming
    >> languages are limited by real-world computers, which have finite
    >> storage and execution time, so they're really equivalent to bounded
    >> Turing machines, which are equivalent to push-down automata, which
    >> are not Turing-complete. But we generally ignore that detail.)

    >
    > Pedantry: Bounded turing machines (BTM) are more powerfull than
    > push-down automata (PDA). BTMs recognize the context sensitive
    > languages, whereas PDAs recognize the context free languages. An
    > example of a language recognized by a BTM but not a PDA is
    > { ww | w in S* } (where S is the input alphabet).


    Sorry; I meant finite TMs (finite in number of states and length of
    tape, regardless of input size) are equivalent to PDAs.

    "Bounded" TMs have space that's limited to the size of the input.
    There are generalizations; for example, Linear Bounded TMs have space
    that's a constant multiple of the input size, and Generalized Bounded
    TMs have space that's some function of the input size.

    As Lasse correctly points out, BTMs are more powerful than PDAs.
    (LBTMs are less powerful than unbounded TMs. I think GBTMs are
    equivalent to unbounded TMs, but it's been years since I did
    computation theory.)

    Real-world implementations of programming languages are equivalent to
    finite TMs, since they can have input that's larger than the storage
    available to them.

    --
    Michael Wojcik
    Micro Focus
    Rhetoric & Writing, Michigan State University
    Michael Wojcik, Jun 14, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ruby Quiz

    [QUIZ] Animal Quiz (#15)

    Ruby Quiz, Jan 14, 2005, in forum: Ruby
    Replies:
    11
    Views:
    364
    James Edward Gray II
    Jan 18, 2005
  2. David Tran
    Replies:
    9
    Views:
    182
    David Tran
    Jan 21, 2005
  3. Ruby Quiz

    [QUIZ] 1-800-THE-QUIZ (#20)

    Ruby Quiz, Feb 18, 2005, in forum: Ruby
    Replies:
    15
    Views:
    322
    gabriele renzi
    Feb 24, 2005
  4. Marcelo Alvim

    [QUIZ] Newbie doubts about the quiz

    Marcelo Alvim, Aug 15, 2006, in forum: Ruby
    Replies:
    15
    Views:
    250
    Marcelo Alvim
    Aug 16, 2006
  5. Daniel Moore
    Replies:
    10
    Views:
    306
    James Gray
    Jan 31, 2009
Loading...

Share This Page