need help making a slideshow or online quiz

Discussion in 'OT Technology' started by Mistertwo94t, Apr 15, 2005.

  1. Mistertwo94t

    Mistertwo94t New Member

    Joined:
    Apr 4, 2005
    Messages:
    36
    Likes Received:
    0
    Location:
    SC
    I need to make either a slideshow or quiz for a computer science class of mine. The example in my text book isn't working like most of the other examples in it so that is of almost no help to me. I've tried searching online for examples but just end up with different programs that make them for you. I need the code.
     
  2. oz02

    oz02 New Member

    Joined:
    Mar 28, 2005
    Messages:
    53
    Likes Received:
    0
    Well, be a bit more specific. What do you want the slideshow/quiz written in?
     
  3. Mistertwo94t

    Mistertwo94t New Member

    Joined:
    Apr 4, 2005
    Messages:
    36
    Likes Received:
    0
    Location:
    SC
    XHTML

    This is basically how my text book has it setup:

    <script type="text/javascript">
    function multipeChoicePoint(theQuestion, correctAnswer){
    if (theQuestion.choiceRB[correctAnswer].checked) {
    return 1
    }
    else {
    return 0
    }
    function processScore() {
    var score = 0
    score = score + multipleChoicePoint(document.question1, 1)
    score = score + multipleChoicePoint(document.question2, 0)
    score = score + multipleChoicePoint(document.question3, 2)
    document.answersForm.scoreBox.value = score
    document.answersForm.answer1Box.value = "b"
    document.answersForm.answer2Box.value = "b"
    document.answersForm.answer3Box.value = "a"
    }
    </script>
    </head>
    <body>
    <form id="question1" name="question1">
    1. What years where the MKI and MKII MR2's produced?<br />
    <input type="radio" name="choiceRB">
    a. 1985-1995<br />
    <input type="radio" name="choiceRB">
    b. 1985-1999<br />
    <input type="radio" name="choiceRB">
    c. 1990-1999<br />
    </form><hr />
    <form id="question2" name="question2">
    2. When was the first supercharged MR2 first introduced?<br />
    <input type="radio" name="choiceRB">
    a. 1990<br />
    <input type="radio" name="choiceRB">
    b. 1988<br />
    <input type="radio" name="choiceRB">
    c. 1985<br />
    </form><hr />
    <form id="question3" name="question3">
    3. When was the first turbocharged MR2 first introduced?<br />
    <input type="radio" name="choiceRB">
    a. 1990<br />
    <input type="radio" name="choiceRB">
    b. 1991<br />
    <input type="radio" name="choiceRB">
    c. 1985<br />
    </form><hr />
    <form id="answersForm" name="answersForm">
    <input type="button" value="Grade the quiz!"
    onClick="processScore()"><p></p> <--GETTING AN ERROR HERE
    <strong>Correct Answers:</strong><br />
    Question 1: <input type="text"
    name="answer1Box" size="1"><br />
    Question 2: <input type="text"
    name="answer2Box" size="1"><br />
    Question 3: <input type="text"
    name="answer3Box" size="1"><br />
    <p>You scored <input type="text"
    name="scoreBox" size="1"> out of 3.</p>
    </form>

    </body>
     
  4. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    You have no closing bracket on your multipleChoicePoint function, and you declared the function name without the L in multiple.

    Edit: And b, b, a are what you say the answers are, but b, a, c is what you're grading the answers as.
     
    Last edited: Apr 15, 2005

Share This Page