Update SurveyJSON POD for the new method.

Add legal and header POD for ResponseJSON.
This commit is contained in:
Colin Kuskie 2008-12-06 00:23:17 +00:00
parent 3671e80bea
commit 931b502666
2 changed files with 57 additions and 5 deletions

View file

@ -1,9 +1,59 @@
package WebGUI::Asset::Wobject::Survey::ResponseJSON;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2008 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=head1 NAME
Package WebGUI::Asset::Wobject::Survey::ResponseJSON
=head1 DESCRIPTION
Helper class for WebGUI::Asset::Wobject::Survey. It manages data
from the user, sets the order of questions and answers in the survey,
based on forks, and gotos, and also handles expiring the survey
due to time limits.
This package is not intended to be used by any other Asset in WebGUI.
=cut
use strict;
use JSON;
use Data::Dumper;
=head2 new ( $json, $log, $survey )
Object constructor.
=head3 $json
Pass in some JSON to be serialized into a data structure. Useful JSON would
contain a hash with "startTime", "surveyOrder", "responses", "lastReponse"
and "questionsAnswered" keys, with appropriate values.
=head3 $log
The session logger, from $session->log. The class needs nothing else from the
session object.
=head3 $survey
A WebGUI::Asset::Wobject::Survey::SurveyJSON object that represents the current
survey.
=cut
sub new {
my $class = shift;
my $json = shift;
@ -28,9 +78,11 @@ sub new {
=head2 createSurveyOrder ( SurveyJSON, [address,address] )
This creates the order for the survey which will change after every fork.
The survey order is to precreate random questions and answers, which also leaves a record or what the user was presented with.
Forks are passed in to show where to branch the new order.
This creates the order for the survey which will change after every fork. The survey
order is to precreate random questions and answers, which also leaves a record or what
the user was presented with. Forks are passed in to show where to branch the new order.
If questions and/or answers were set to be randomized, it is handled in here.
=cut

View file

@ -38,8 +38,8 @@ Object constructor.
=head3 $json
Pass in some JSON to be serialized into a data structure. At the very least, you
must pass in the "null" JSON string, '{}'.
Pass in some JSON to be serialized into a data structure. Useful JSON would
be a hash with "survey" and "sections" keys with appropriate values.
=head3 $log