|
CS 535 Object-Oriented Programming Fall Semester, 2003 Assignment 6 |
|
|---|---|---|
|
© 2003, All Rights Reserved, SDSU & Roger Whitney San Diego State University -- This page last updated 02-Dec-03 |
q=+What colors do you like? a=Red a=Black a=Yellow a=White
<br></br>2. What colors do you like? Select all that apply. <br></br> <input name ="2" value ="Red" type ="checkbox"></input> Red <br></br> <input name ="2" value="Black" type="checkbox"></input> Black <br></br> <input name ="2" value ="Yellow" type ="checkbox"></input> Yellow <br></br> <input name="2" value ="White" type="checkbox"></input> White
<html>
<title>
New Quiz/Survey
</title>
<body>
<p>
<center>
CS 535 Quiz/Survey
</center>
<hr size="1" noshade>
<h2 align="center">
Add a new Quiz/Survey
</h2>
<form action="servlet/NewSurvey" method="post">
<p align="left">
Select the type:
<br>
</p>
<input name="type" value="Quiz" type="radio">
</input>
Quiz
<br>
<input name="type" value="Survey" type="radio">
</input>
Survey
<br>
<p>
Enter the quiz/survey text
</p>
<textarea name="definition" rows="20" cols="80">
</textarea>
<br>
<input type="submit">
</input>
</form>
</body>
</html>
doPost: aRequest response: aResponse
| surveyString surveyType |
surveyString := aRequest anyFormValueAt: 'definition'.
surveyType := aRequest anyFormValueAt: 'type'.
"Here we can do anything we want.
Just return it for demonstration"
aResponse
write: '<html><body>You entered: <pre>';
write: surveyString;
write: '</pre><BR>Type: ';
write: surveyType;
write: '</body></html>'
form action="servlet/NewSurvey"If the static web page is served via another means then we need to use the full url like:
form action=http://127.0.0.1:8008/servlet/NewSurvey
<html>
<body>
<h2>
Surveys
</h2>
<lu>
<li>
<a href="DisplaySurvey?name=Computers">
Computers</a>
</li>
<li>
<a href="DisplaySurvey?name=Food Survey">
Food Survey</a>
</li>
</lu>
</body>
</html>
n=Math Quiz q=-What is the square root of 4 a=1 a=1.5 a=^2 a=2.5 a=3The “^” indicates which answer is correct. It is possible that more than one answer is correct for a given problem. In that case more than one answer will be marked with the “^”. Note that this means that the text of an answer cannot start with an “^”. Of course when displaying a quiz for someone to take, the correct answers should not be indicated. Short answer questions will not be used in quizzes. When a user submits a filled out quiz, they get a page giving them their score on the quiz and lists the questions they got right.