Skip to content

Commit

Permalink
Dev: move doAssements from setArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Feb 16, 2017
1 parent 75c6cc2 commit 164bd7b
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -121,6 +121,13 @@ public function run($surveyid,$args)
$_SESSION[$this->LEMsessid]['maxstep'] = 0;
}

// TODO: remove those line, why a special condition when survey is not active VS when it's active and why HERE????
if ($this->thissurvey['active'] != "Y"){
// TODO: TWIG ASSESSMENTS !!!!!
if ($thissurvey['assessments'] == "Y"){
$assessments = $this->assessments = doAssessment($thissurvey['sid']);
}
}


$this->moveSubmitIfNeeded();
Expand Down Expand Up @@ -790,7 +797,7 @@ private function getArgs()
}

/**
* This function is still doing much more things than just setting args....
* Now it's ok ^^
*/
private function setArgs()
{
Expand Down Expand Up @@ -820,24 +827,14 @@ private function setArgs()

$this->thissurvey = $thissurvey;

if ($thissurvey['active'] != "Y"){

// TODO: TWIG ASSESSMENTS !!!!!
if ($thissurvey['assessments'] == "Y"){
$assessments = $this->assessments = doAssessment($thissurvey['sid']);
}

}else{
//THE FOLLOWING DEALS WITH SUBMITTING ANSWERS AND COMPLETING AN ACTIVE SURVEY
//don't use cookies if tokens are being used
//THE FOLLOWING DEALS WITH SUBMITTING ANSWERS AND COMPLETING AN ACTIVE SURVEY
//don't use cookies if tokens are being used
if ($thissurvey['active'] == "Y"){
if ($thissurvey['usecookie'] == "Y" && $tokensexist != 1) {
setcookie("LS_" . $surveyid . "_STATUS", "COMPLETE", time() + 31536000); //Cookie will expire in 365 days
}

}

}

}


Expand Down

0 comments on commit 164bd7b

Please sign in to comment.