Thank you for these suggestions. In this particular example one could probably use either of the techniques suggested by Paul Pearson to implement the problem properly. I was however thinking of such a mechanism for more general situations and the one proposed here was merely an example (maybe it was too simple to properly illustrate the problem). I should have a closed look at Scaffolding2. It seems to be the most flexible approach.
WeBWorK Problems
Answer fields shown in dependance of the answer of another answer field
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day