Fix JavaScript exceptions raised in the survey

The exceptions were raised because some attributes are not defined
depending on which questions were answered; there are explicit changes
in place now to avoid this problem.

----

So commit.