Пример #1
0
        }
        if (!isset($_POST[$pf])) {
            $_SESSION[$pf] = "";
        }
    }
}
//CHECK FOR TIMER QUESTIONS TO SAVE TIME REMAINING
if (isset($_POST['timerquestion'])) {
    $_SESSION[$_POST['timerquestion']] = sanitize_float($_POST[$_POST['timerquestion']]);
}
//Check to see if we should set a submitdate or not
// this depends on the move, and on quesitons checks
if (isset($move) && $move == "movesubmit") {
    $backok = null;
    $notanswered = addtoarray_single(checkmandatorys($move, $backok), checkconditionalmandatorys($move, $backok));
    $notvalidated = checkpregs($move, $backok);
    if ((!is_array($notanswered) || count($notanswered) == 0) && (!is_array($notvalidated) || count($notvalidated) == 0)) {
        $bFinalizeThisAnswer = true;
    } else {
        $bFinalizeThisAnswer = false;
    }
} else {
    $bFinalizeThisAnswer = false;
}
// SAVE if on page with questions or on submit page
if (isset($postedfieldnames) || isset($move) && $move == "movesubmit") {
    if ($thissurvey['active'] == "Y") {
        $bQuotaMatched = false;
        $aQuotas = check_quota('return', $surveyid);
        if ($aQuotas !== false) {
            if ($aQuotas != false) {
Пример #2
0
if (!isset($_SESSION['totalsteps'])) {$_SESSION['totalsteps']=0;}
if (isset($move) && $move == "moveprev") {$_SESSION['step'] = $thisstep-1;}
if (isset($move) && $move == "movenext") {$_SESSION['step'] = $thisstep+1;}

// We do not keep the participant session anymore when the same browser is used to answer a second time a survey (let's think of a library PC for instance).
// Previously we used to keep the session and redirect the user to the
// submit page.
//if (isset($_SESSION['finished'])) {$move="movesubmit"; }


//CHECK IF ALL MANDATORY QUESTIONS HAVE BEEN ANSWERED ############################################
//CHECK IF ALL CONDITIONAL MANDATORY QUESTIONS THAT APPLY HAVE BEEN ANSWERED
$notanswered=addtoarray_single(checkmandatorys($move),checkconditionalmandatorys($move));

//CHECK PREGS
$notvalidated=checkpregs($move);

//CHECK UPLOADED FILES
$filenotvalidated = checkUploadedFileValidity($move);

//SUBMIT
if ((isset($move) && $move == "movesubmit") && (!isset($notanswered) || !$notanswered) && (!isset($notvalidated) && !$notvalidated) && (!isset($filenotvalidated) || !$filenotvalidated))
{
    setcookie ("limesurvey_timers", "", time() - 3600);// remove the timers cookies : not actually used in all in one.
    if ($thissurvey['anonymized'] == "Y")
    {
        $privacy = templatereplace(file_get_contents("$thistpl/privacy.pstpl"));
    }
    if ($thissurvey['refurl'] == "Y")
    {
        if (!in_array("refurl", $_SESSION['insertarray'])) //Only add this if it doesn't already exist