Skip to content

Commit

Permalink
Fixes to Survey tests and merged code from 7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jan 18, 2012
1 parent 1ab73e2 commit a6e1adf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/migration.txt
Expand Up @@ -422,3 +422,8 @@ getEditForm now returns a WebGUI::FormBuilder object
Show Performance Indicators
==========================
This setting is removed, as the Plack debug console shows this for us.

WebGUI::Asset::Wobject::Survey
==========================
The surveyJSON method conflicted with the new Moose accessor. In WebGUI 8,
the old surveyJSON is called getSurveyJSON.
4 changes: 2 additions & 2 deletions lib/WebGUI/Asset/Wobject/Survey.pm
Expand Up @@ -2439,8 +2439,8 @@ Extend the base method to include custom question types added to this Survey.
sub exportAssetData {
my $self = shift;
my $asset_data = $self->SUPER::exportAssetData();
my $questions = $self->surveyJSON->questions();
my $multiple_choice = $self->surveyJSON->multipleChoiceTypes();
my $questions = $self->getSurveyJSON->questions();
my $multiple_choice = $self->getSurveyJSON->multipleChoiceTypes();
my %question_types = ();
my $get_question = $self->session->db->prepare('select answers from Survey_questionTypes where questionType=?');
foreach my $question (@{ $questions }) {
Expand Down
4 changes: 2 additions & 2 deletions t/Asset/Wobject/Survey/package.t
Expand Up @@ -27,7 +27,7 @@ my $import_node = WebGUI::Asset->getImportNode($session);
my $survey = $import_node->addChild( { className => 'WebGUI::Asset::Wobject::Survey', } );
WebGUI::Test->addToCleanup($survey);

my $sJSON = $survey->surveyJSON;
my $sJSON = $survey->getSurveyJSON;

# Load bare-bones survey, containing a single section (S0)
$sJSON->update([0], { variable => 'S0' });
Expand Down Expand Up @@ -57,7 +57,7 @@ $asset_data->{question_types}->{fingers} = clone $asset_data->{question_types}->
$survey->importAssetCollateralData($asset_data);

$survey = $survey->cloneFromDb;
my $multipleChoiceTypes = $survey->surveyJSON->multipleChoiceTypes;
my $multipleChoiceTypes = $survey->getSurveyJSON->multipleChoiceTypes;

ok exists $multipleChoiceTypes->{fingers}, 'fingers type imported as package collateral data';
ok exists $multipleChoiceTypes->{toes}, 'still have toes, too';
Expand Down

0 comments on commit a6e1adf

Please sign in to comment.