CS 535 Object-Oriented Programming
Fall Semester, 2003
© 2003, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 02-Dec-03
Saturday Dec. 20 10:30 am. You can turn it in before then.
& Quizzes Continued
are two changes to the specification given in assignment 5. The first
modification is that questions can be added to an existing quiz or survey. That
is when a quiz/survey is submitted and there is already a quiz/survey with the
same name, the new questions are added to the existing quiz/survey.
second modification involves the html generated for the select many multiple
choice questions. For the question:
q=+What colors do you like?
html should be:
<br></br>2. What colors do you like? Select all that apply.
<input name ="2" value ="Red" type ="checkbox"></input> Red
<input name ="2" value="Black" type="checkbox"></input> Black
<input name ="2" value ="Yellow" type ="checkbox"></input> Yellow
<input name="2" value ="White" type="checkbox"></input> White
user enters the text for a quiz or survey using an html web page like:
CS 535 Quiz/Survey
<hr size="1" noshade>
Add a new Quiz/Survey
<form action="servlet/NewSurvey" method="post">
Select the type:
<input name="type" value="Quiz" type="radio">
<input name="type" value="Survey" type="radio">
Enter the quiz/survey text
<textarea name="definition" rows="20" cols="80">
is a doPost:response: method that echos the submitted quiz/survey information.
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"
write: '<html><body>You entered: <pre>';
write: '</pre><BR>Type: ';
notes about submitting a quiz/survey.
If the above static web page is served from the VW web server we can use the
relative url like:
the static web page is served via another means then we need to use the full
In the surveyString in the above doPost:response: method the lines are
separated by a carriage return (Character cr) and then a line feed (Character
If a quiz/survey of a given name already exists then the questions are added to
the existing quiz/survey.
a user submits a survey or quiz it needs to be saved for later use. The url:
a web page that lists all the surveys and quizzes by their title. When a user
clicks on the title of a survey/quiz it should display a web page with the
survey/quiz. Below is a sample web page that lists two surveys.
<a href="DisplaySurvey?name=Food Survey">
a user clicks on one of the surveys they will get the html page for the survey.
They can answer the questions and submit the filled out survey. They will then
get a page displaying the number of times each answer in the survey was
selected. These results are cumulative. That is they see the number of times
each answer was selected by all people up to that point.
and Students working in Pairs
you wish to work with one other student on this assignment you may do so, but
will need to also add the following functionality.
a quiz is entered answers are marked as to which answer is correct. For example:
q=-What is the square root of 4
“^” 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.
of the grade will be on formatting, following Smalltalk naming conventions and
using reasonable names
of the grade will be on unit tests for your code
of grade will be on the structure of your code
remainder of the grade will be on meeting the requirements of the assignment.
Copyright ©, All rights reserved.
2003 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.
visitors since 02-Dec-03