Web based Test in ASP

Posted on 2012-09-09
Last Modified: 2012-10-02
Team -

I am looking for examples / demo codes for Web based tests in asp. I have googled alot & found alot of websites like planet-source-codes, hotscripts etc., bt i couldnt find anything which i am looking for.

what i want is,

Web based test. Admin should be able to create tests, set time limit & also can assign to users.
Users need to finish the test within time.

can anyone send me a demo codes for the same pls.

Question by:davidi1
    LVL 30

    Expert Comment

    by:Wayne Barron
    (I assume you are using ASP Classic, since you Zoned it for that, if you are using ASP.NET, just replace it with the information below when answering, however, I will be unable to assist in the .NET area, as I am a Classic ASP Developer)
    What is your ASP Classic skill level =
    SQL Server =
    JQuery / AJAX =

    I would not design a script like this with Access Database, I would use SQL Server.
    Use JQuery for the time limit, as well as other functions within the site.

    There are all sorts of possibilities on doing this.
    I am currently working on one similar to this as well.
    It is not really that hard, though I have had to stop to work on other projects,
    Hoping to jump back into it within the next week.

    I can give you some pointers, if you can answer the questions above.
    However, there are some scripts called: School Scripts, but they are old, and the coding really sucks, and I would hate to dig them up again, as they were made around 1999-2001, and trust me when I say, you do not want to learn for that type of crap coding.

    LVL 2

    Author Comment

    @CarzKiss - you've helped me alot for my previous posts..,

    Yes. I am looking for Classic ASP only.

    What is your ASP Classic skill level = Intermediate
    SQL Server = Intermediate
    JQuery / AJAX = Beginner.

    I am using SQL Server.

    What i have done so far is,

    I have created a table called "Test_Main" with the following fields,

    CREATE TABLE [dbo].[Test_Main](
          [TestID] [numeric](18, 0) IDENTITY(5000,1) NOT NULL,
          [SubmitterNT] [varchar](255) NULL,
          [SubmitterName] [varchar](255) NULL,
          [SubmitDate] [smalldatetime] NULL,
          [SubmitProcess] [varchar](255) NULL,
          [SubmitSubProcess] [varchar](255) NULL,
          [TestName] [varchar](255) NULL,
          [TestCategory] [varchar](255) NULL,
          [TestLevel] [varchar](255) NULL,
          [MaxQuestions] [varchar](255) NULL,
          [EachQuestionScore] [varchar](255) NULL,
          [Timelimit] [varchar](255) NULL,
          [TestStatus] [varchar](255) NULL
    ) ON [PRIMARY]


    In the above table, user inputs "all except EachQuestionScore as its calculated based on "100/MaxQuestions"

    so a Test is created. Then I am asking the user to create questionarie for the same.

    query as follows:

    CREATE TABLE [dbo].[Test_Details](
          [QuestionID] [numeric](18, 0) IDENTITY(1000,1) NOT NULL,
          [TestID] [numeric](18, 0) NULL,
          [Question] [text] NULL,
          [Answer1] [varchar](255) NULL,
          [Answer2] [varchar](255) NULL,
          [Answer3] [varchar](255) NULL,
          [Answer4] [varchar](255) NULL,
          [Answer5] [varchar](255) NULL,
          [CorrectAnswer] [varchar](255) NULL


    I am able to add questions also.., However what i want to do is, i want to display all questions in 1 page(which i can still do in classic asp). But i dont know how to capture and save those inputs in sql as the table is dynamic. and also the catch here is, once the time limit is over, test should finish and marks to be graded for the questions attended.

    please help
    LVL 30

    Expert Comment

    by:Wayne Barron
    I will have to think on this one, no sleep as of yet, so, brain is not functioning properly right now....
    LVL 52

    Expert Comment

    by:Scott Fell, EE MVE
    I have also started to work on a project like this.  I can tell you this can be one of those things that sounds easy at first until you get into it becomes pretty complex.

    First with timing, you can do this server side with vbscript.  The advantage is it can not be manipulated by the savy test taker.  However, this eats up your cpu time.  Javascript/jquery timer will not do this but could potentially be manipulated by the user.   Part of your decision making

    At the very least, your timing code will look like below
    <div id="question1">testing....1..2...3</div>¿
    <script>setTimeout(function() {
    }, 1000); //¿¿¿¿¿</script>

    Open in new window

    Of course enhancements will include a timer, showing the next question etc.    As far as the Admin authoring questions and setting answers and time limits for each question that is simply updating/adding data in one area and displaying data in the test area.  

    <div id="<%=qID%>"><%=question%></div>¿
    <script>setTimeout(function() {
    }, 1000); //¿¿¿¿¿</script>

    Open in new window

    Although I would say using ajax to rotate the questions would better although add a little more complexity.  

    Take a look at how this site works,  Their process is cool.  Unfortunately, they use crowd sourced questions and answers that I found wrong.  It is a good exercise to see what you like and don't like.
    LVL 2

    Author Comment

    @CarrzKiss - any updates on this?
    LVL 30

    Expert Comment

    by:Wayne Barron
    I am so sorry David, I am completely tied up with some issues on our mail server and one of our sites.

    @padas, can you assist David further with his issue?
    LVL 2

    Author Comment

    @padas - any updates?
    LVL 52

    Accepted Solution

    I'm not really sure exactly what you are looking for.  I don't think there is any open source classic asp projects like this.  Take a look at some other examples.  Like I said before, this is a bigger project then you may have thought.
    Create test, set limits, assign users - this is nothing more then inserting records to your db
    INSERT INTO tblQuestions (qNumber, qTitle, qDescription, arrChoices, qAnswer, TimeLimit, arrUsers, ,...)
    VALUES (value1, value2, value3,...)

    Open in new window

    Where arrChoices data might look like: a)choice 1[-]b)choice 2[-]c)choice 3.
    Then when you want to display choices:
    for each x in Choices
        response.write x &"<br>"

    Open in new window

    You will use javascript to time the question as I have shown above.

    Take a look at the examples I have given you, decide what you like and don't like and start jotting down a flow chart for yourself to see the big picture.  Then you can start coding each piece of the  puzzle.  But the very basics I have just posted here.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now