Skip to content

Commit

Permalink
Fixed issue #06140: Survey doesn't start from where it was left on To…
Browse files Browse the repository at this point in the history
…ken Persistence
  • Loading branch information
TMSWhite committed Jun 1, 2012
1 parent aee2ca6 commit 62f57af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.php
Expand Up @@ -867,7 +867,7 @@
if (!isset($_SESSION['srid']) && $thissurvey['anonymized'] == "N" && $thissurvey['active'] == "Y" && isset($token) && $token !='')
{
// load previous answers if any (dataentry with nosubmit)
$srquery="SELECT id,submitdate FROM {$thissurvey['tablename']}"
$srquery="SELECT id,submitdate,lastpage FROM {$thissurvey['tablename']}"
. " WHERE {$thissurvey['tablename']}.token='".db_quote($token)."' order by id desc";

$result = db_select_limit_assoc($srquery,1);
Expand All @@ -877,6 +877,11 @@
if(($row['submitdate']=='' && $thissurvey['tokenanswerspersistence'] == 'Y' )|| ($row['submitdate']!='' && $thissurvey['alloweditaftercompletion'] == 'Y'))
{
$_SESSION['srid'] = $row['id'];
if (!is_null($row['lastpage']))
{
$_SESSION['LEMtokenResume'] = true;
$_SESSION['step'] = $row['lastpage'];
}
}
buildsurveysession();
loadanswers();
Expand Down

0 comments on commit 62f57af

Please sign in to comment.