[Seaside] labelling radio buttons in a table

Tim Rowledge tim@sumeru.stanford.edu
Mon, 17 Jun 2002 13:23:47 -0700

OK, I've found a workable solution to my problem. I feel sort of dirty
after devising it...

The html looks like
<tr sea:id="row/answerList">
<td>[optionList] <input type="radio" sea:id="tableAnswersGroup"

The key part is that [optionList] does
#(a b c) at: (answerList indexOf: (self valueForKey: #row))
to 'intercept' the 'row' local variable. The advantage of this is that
it allows the #answerList to be that same for 'normal' questions and
'tabular' questions. This turns out to be useful since it lets the radio
buttons actually work with the previous saved answer! When I was trying
to make associations 'A'->#( blah foo bar) I had the (now obvious
seeming) problem that the random re-ordering of the possible answers
would mean that having saved 'A'->etc was not very helpful when the new
ordering means it should be 'C'->etc !! argh.

I guess this above technique allow for a sort of #do:with: approach, so
I can have two related lists working together.

Hooray; all the test taking stuff and question reviewing/grading
actually works at last. Now for the teacher's side stuff...


Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- A titanic intellect...  In a world full of icebergs.