Another think. Could you send the IDs with a hidden field to the question-form instead of using the session? There are some problems with the way you use the session.

* The data from the session is also used, if GET.getlist('assignments') returns an empty list (because no item is selected). So if you use no items, the items selected the last selected are deleted.
* You use the names 'assignments'. You should at least change that. In other case there could be a name conflict.