From 9a1d2b9eb1a506cbbfdd6cc28d820563eaef60ec Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Mon, 29 Apr 2013 15:35:37 +1000 Subject: [PATCH] Reset page position when respondent is to self complete in a different mode --- email.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/email.php b/email.php index f8328c0a..3b6cd20d 100644 --- a/email.php +++ b/email.php @@ -242,6 +242,22 @@ if (isset($_POST['firstname'])) $db->Execute($sql); + //set to start frm the first page if the format for the respondent is not question by question + $sql = "SELECT q.lime_mode + FROM questionnaire as q, `case` as c + WHERE c.case_id = $case_id + AND q.questionnaire_id = c.questionnaire_id"; + + $lmode = $db->GetOne($sql); + + if ($lmode != "question") + { + $sql = "UPDATE " . LIME_PREFIX ."survey_{$lime_sid} + SET lastpage = 0 + WHERE token = '$token'"; + + $db->Execute($sql); + } if (isset($_POST['submith'])) {