Quota: terminate survey with warning

5 years 7 months ago - 5 years 7 months ago #78306 by waitz
waitz created the topic: Quota: terminate survey with warning
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"))
                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' />
                echo "\t</div>\n";
                echo templatereplace(file_get_contents("$thistpl/endpage.pstpl"));

Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 5 years 7 months ago by waitz.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!