Skip to content

Commit

Permalink
Fixed issue : survey with 'alloweditaftercompletion' allways start at…
Browse files Browse the repository at this point in the history
… first step

Dev: If survey is already submitted: put maxstep to totalsteps for index
  • Loading branch information
Shnoulle committed Oct 10, 2013
1 parent 4d898e6 commit 621b64c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion application/controllers/survey/index.php
Expand Up @@ -619,13 +619,17 @@ function sendreq(surveyid)
if((empty($oSurveyTokenInstance->submitdate) || $thissurvey['alloweditaftercompletion'] == 'Y' ) && $thissurvey['tokenanswerspersistence'] == 'Y')
{
$_SESSION['survey_'.$surveyid]['srid'] = $oSurveyTokenInstance->id;
if (!empty($oSurveyTokenInstance->lastpage) && empty($oSurveyTokenInstance->submitdate))
if (!empty($oSurveyTokenInstance->lastpage))
{
$_SESSION['survey_'.$surveyid]['LEMtokenResume'] = true;
$_SESSION['survey_'.$surveyid]['step'] = $oSurveyTokenInstance->lastpage;
}
}
buildsurveysession($surveyid);
if(!empty($oSurveyTokenInstance->submitdate)) // alloweditaftercompletion
{
$_SESSION['survey_'.$surveyid]['maxstep'] = $_SESSION['survey_'.$surveyid]['totalsteps'];
}
loadanswers();
}
}
Expand Down

0 comments on commit 621b64c

Please sign in to comment.