Change ResponseJSON to use a proper mutator for startTime.
Add tests for startTime. Survey uses the accessor, and no longer needs to manually set startTime.
This commit is contained in:
parent
5096352780
commit
1c1f01d473
3 changed files with 79 additions and 10 deletions
|
|
@ -820,7 +820,7 @@ sub prepareShowSurveyTemplate {
|
|||
$section->{'totalQuestions'} = @{$self->response->surveyOrder};
|
||||
$section->{'showProgress'} = $self->get('showProgress');
|
||||
$section->{'showTimeLimit'} = $self->get('showTimeLimit');
|
||||
$section->{'minutesLeft'} = int((($self->response->{startTime} + (60 * $self->get('timeLimit'))) - time())/60);
|
||||
$section->{'minutesLeft'} = int((($self->response->startTime() + (60 * $self->get('timeLimit'))) - time())/60);
|
||||
|
||||
my $out = $self->processTemplate( $section, $self->get("surveyQuestionsId") );
|
||||
|
||||
|
|
@ -953,7 +953,6 @@ sub getResponseId {
|
|||
$self->loadBothJSON($responseId);
|
||||
$self->response->createSurveyOrder();
|
||||
$self->{responseId} = $responseId;
|
||||
$self->response->{startTime} = $time;
|
||||
$self->saveResponseJSON();
|
||||
|
||||
} ## end if ( $haveTaken < $allowedTakes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue