Fixed Survey bug in handling of logical sections
This commit is contained in:
parent
c64a1de9f3
commit
867aa51507
2 changed files with 138 additions and 97 deletions
|
|
@ -1616,6 +1616,22 @@ sub www_loadQuestions {
|
|||
my @questions;
|
||||
eval { @questions = $self->responseJSON->nextQuestions(); };
|
||||
|
||||
# Logical sections cause nextResponse to move when nextQuestions is called, so
|
||||
# persist and changes, and repeat the surveyEnd check in case we are now at the end
|
||||
$self->persistResponseJSON();
|
||||
if ( $self->responseJSON->surveyEnd() ) {
|
||||
$self->session->log->debug('surveyEnd, probably as a result of a Logical Section');
|
||||
if ( $self->get('quizModeSummary') ) {
|
||||
if(! $self->session->form->param('shownsummary')){
|
||||
my ($summary,$html) = $self->getSummary();
|
||||
my $json = to_json( { type => 'summary', summary => $summary, html => $html });
|
||||
$self->session->http->setMimeType('application/json');
|
||||
return $json;
|
||||
}
|
||||
}
|
||||
return $self->surveyEnd();
|
||||
}
|
||||
|
||||
my $section = $self->responseJSON->nextResponseSection();
|
||||
|
||||
#return $self->prepareShowSurveyTemplate($section,$questions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue