Skip to content

Commit

Permalink
Fixed issue #5443: Survey is starting on the last question group when…
Browse files Browse the repository at this point in the history
… usen token answer persistences and usesleft

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@10930 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Sep 2, 2011
1 parent df26edd commit dd9053b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.php
Expand Up @@ -853,13 +853,15 @@
if ($thissurvey['tokenanswerspersistence'] == 'Y' && !isset($_SESSION['srid']) && $thissurvey['anonymized'] == "N" && $thissurvey['active'] == "Y" && isset($token) && $token !='')
{
// load previous answers if any (dataentry with nosubmit)
$srquery="SELECT id FROM {$thissurvey['tablename']}"
. " WHERE {$thissurvey['tablename']}.token='".db_quote($token)."'\n";
$srquery="SELECT id,submitdate FROM {$thissurvey['tablename']}"
. " WHERE {$thissurvey['tablename']}.token='".db_quote($token)."' order by id desc";

$result = $connect->GetOne($srquery);
if ($result !== false && !is_null($result))
$result = db_select_limit_assoc($srquery,1);
if ($result->RecordCount()>0)
{
$_SESSION['srid'] = $result;
$row=$result->FetchRow();
if($row['submitdate']=='' || ($row['submitdate']!='' && $thissurvey['alloweditaftercompletion'] == 'Y'))
$_SESSION['srid'] = $row['id'];
}
buildsurveysession();
loadanswers();
Expand Down

0 comments on commit dd9053b

Please sign in to comment.