Welcome, Guest
Username: Password: Remember me

TOPIC: Quota: terminate survey with warning

Quota: terminate survey with warning 2 years 7 months ago #78306

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 171
  • Thank you received: 1
  • Karma: 3
I have set quota action to: Terminate survey with warning, so that participants can go back if they made a mistake.

But, if they load the url in the quota, they can later also go back just by using the browser back button, which I find to be a possible security risk. When they leave the survey, I want the survey to be terminated.

Can I add a button on the Quota page next to << Previous which says Close, and where the survey token is set to Uses left: 0 ?

I found this in line 3374 in index.php where I guess it could be added:
if ((isset($quota['status']) && $quota['status'] == "matched") && (isset($quota['Action']) && $quota['Action'] == "2"))
            {
 
                sendcacheheaders();
                doHeader();
                echo templatereplace(file_get_contents("$thistpl/startpage.pstpl"));
                echo "\t<div class='quotamessage'>\n";
                echo "\t".$quota['Message']."<br /><br />\n";
                echo "\t<a href='".$quota['Url']."'>".$quota['UrlDescrip']."</a><br /><br />\n";
                echo "<form method='post' action='{$publicurl}/index.php' id='limesurvey' name='limesurvey'><input type=\"hidden\" name=\"move\" value=\"movenext\" id=\"movenext\" /><input class='submit' accesskey='p' type='button' onclick=\"javascript:document.limesurvey.move.value = 'moveprev'; document.limesurvey.submit();\" value=' &lt;&lt; ". $clang->gT("Previous")." ' name='move2' />
					<input type='hidden' name='thisstep' value='".($_SESSION['step'])."' id='thisstep' />
					<input type='hidden' name='sid' value='".returnglobal('sid')."' id='sid' />
					<input type='hidden' name='token' value='".$clienttoken."' id='token' />
					</form>\n";
                echo "\t</div>\n";
                echo templatereplace(file_get_contents("$thistpl/endpage.pstpl"));
                doFooter();
                exit;
            }
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 2 years 7 months ago by waitz.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.153 seconds
Donation Image