?
Solved

Random display of quiz questions

Posted on 2003-02-19
4
Medium Priority
?
286 Views
Last Modified: 2013-12-23
Dear experts,
Hello there and thanks for viewing this section.
I am still new to Dreamweavre Ultradev and i need to ask you guys a question about mah project.please help me

well i have to be able to display a page where by students can take an online assessment.The quiz would contain several questions and will be assessed online,where by the students get an immediate feedback on their scores and their scores will be sent to the database to be input to their grades table.Now comes the tricky part of the quiz questions,they have to be displayed by being randomized.The thing is how will i go about doing this.
will the questions need to be randomized at the database section or at the ultradev section.i am using sql as mah database
and if even so how would i deter the students to modify any content in the page by using view source.???

All replies are kindly welcomed.Thanks in advance.

hj
0
Comment
Question by:spicy7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Accepted Solution

by:
HanbingL earned 400 total points
ID: 8206257
Following is what I have done.  
1) Display a page of quize with 50 questions.
<%
'initialize database
sql="select * from test"
rs.open sql,conn,1,3

do while not rs.eof
RANDOMIZE
RandomValue = INT(200000*RND)+1
'Response.Write RandomValue & "<br>"
rs("count")=0
rs("count")=RandomValue
rs.update
rs.movenext
loop
rs.close

'get questions
sql="select top 50 * from test order by count desc"
Set rs = conn.Execute(sql)
%>

2) Then Display 50 questions in a web form:

<form action="submitanswer.asp" id="FORM1" method="post" name="FORM1">
<%
  i=1
  rs.movefirst
  do while not rs.eof%>
  <p><table align="center" width="80%">
  <tr>
  <td>
  <% Response.Write(i & ".")%> <%=rs("question")%></font>
  </td>
</tr>
</table>
    <table >
     
      <tr > 
        <td > 
          <input name="ans<%=i%>" type="radio" value="A">
          <%=rs("A")%> </td>
      </tr>
      <tr>
        <td>
          <input name="ans<%=i%>" type="radio" value="B">
          <%=rs("B")%> </td>
      </tr>
      <tr>
        <td>
          <input name="ans<%=i%>" type="radio" value="C">
          <%=rs("C")%> </td>
      </tr>
    </table>
<%
i=i+1
rs.movenext
loop
set conn = nothing
%>  
<input id="submit1" name="submit1" type="submit" value="Submit">
    <input id="reset1" name="reset1" type="reset" value="Reset">

3) Check answer and display a grade:
Submitanswer.asp

<%
NumCorrect = 0
rs.open "select top 50 * from test", conn
do while not rs.eof
  i=i+1
  StudentAnswer = request.form("ans"&i)
  if StudentAnswer = rs("Answer") then
    NumCorrect = NumCorrect + 1
  end if
rs.movenext
Loop
score = int(NumCorrect/j*100)

response.write score
%>
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 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