[Seaside] dynamically chosen subcomponents

Tim Rowledge tim@sumeru.stanford.edu
Tue, 04 Jun 2002 10:44:19 -0700

Next wierd question :-)

Some of my online questions are simple multiple choice type, where it is
good to randomise the order of the putative answers.
Some need the answers in a particular order because they have things
like 'all of the above' which looks pretty silly at the top of a list!
Some are in the form of tables and obviously need somewhat different
Some will be algorithmic and need a text field into which the student
types an answer.

My initial idea for handling this is to have various classes of
subcomponent that copes with each type of question. How can I make
seaside deal with this neatly?

I guess I could do something ugly like
<if sea:id="currentQuestion.isNormal=true"><otnormalquestionpane....
<if ...... .isFixedMC......

but that is grossly awful. How can I get the logical equivalent of
<pane sea:id="currentQuestion.questionPane"> , ie the right class for
the current question?

Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Try not to let implementation details sneak into design documents.