Survey bug fixes

Fixed bugs in the handling of logical sections,
creating of responses and counting of responses.
Added in a bunch of new tests.
Jslinting of all survye js files
This commit is contained in:
Patrick Donelan 2009-05-23 09:54:03 +00:00
parent 5e7c594440
commit 3a25e806c6
12 changed files with 703 additions and 476 deletions

View file

@ -960,11 +960,6 @@ sub newAnswer {
Remove all existing answers and add a default set of answers to a question, based on question type.
N.B. You probably don't want to call this method directly to update a question's questionType, as it
doesn't actually change the stored value of questionType. Instead, call:
$surveyJSON->update( $address, { questionType => "some question type" } );
=head3 $address
See L<"Address Parameter">. Determines question to add answers to.
@ -986,6 +981,7 @@ sub updateQuestionAnswers {
# Get the indexed question, and remove all of its existing answers
my $question = $self->question($address);
$question->{answers} = [];
$question->{questionType} = $type;
# Add the default set of answers. The question type determines both the number
# of answers added and the answer text to use. When updating answer text