Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Automatic question paper generation

Automatic question paper generation

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasetutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sarodam
    wrote on last edited by
    #1

    Hi, i am creating an online test engine..Question papers and choices are stored in the database.when a user login for the test, a question paper vl b generated(randomly questions are selected from database).How to code that in c#.

    N C 2 Replies Last reply
    0
    • S sarodam

      Hi, i am creating an online test engine..Question papers and choices are stored in the database.when a user login for the test, a question paper vl b generated(randomly questions are selected from database).How to code that in c#.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      sarodam wrote:

      (randomly questions are selected from database)

      You need to make use of Rand() method available in SQL Server. This will generate random number. I presume that each of your question having unique id. First you need to find starting and ending question number. Then start a cursor, Find random number which comes in between starting and ending question id. Inside this loop you need to select question details for the randomly generated question id and insert values into one temporary table. Finally select your temporary table. Using cursors is not advisable practice, but if no other methods are available you can choose this. :doh:


      My Website | Ask smart questions

      S 1 Reply Last reply
      0
      • S sarodam

        Hi, i am creating an online test engine..Question papers and choices are stored in the database.when a user login for the test, a question paper vl b generated(randomly questions are selected from database).How to code that in c#.

        C Offline
        C Offline
        Chetan Patel
        wrote on last edited by
        #3

        Use Random function to get the questions

        Best Regards, Chetan Patel

        1 Reply Last reply
        0
        • N N a v a n e e t h

          sarodam wrote:

          (randomly questions are selected from database)

          You need to make use of Rand() method available in SQL Server. This will generate random number. I presume that each of your question having unique id. First you need to find starting and ending question number. Then start a cursor, Find random number which comes in between starting and ending question id. Inside this loop you need to select question details for the randomly generated question id and insert values into one temporary table. Finally select your temporary table. Using cursors is not advisable practice, but if no other methods are available you can choose this. :doh:


          My Website | Ask smart questions

          S Offline
          S Offline
          sarodam
          wrote on last edited by
          #4

          ok..this random function will generate a random number.what will happen if there is no question with id = that random number(some times questions may deleted from the database).

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups