Skip to content

Commit

Permalink
Dev: fix : must control updated value …
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Apr 3, 2019
1 parent 7ff0292 commit b302a96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -6938,8 +6938,9 @@ public function _ValidateQuestion($questionSeq,$force=false)
{
if (!isset($_SESSION[$LEM->sessid][$sgqa]) && !is_null($LEM->knownVars[$sgqa]['default'])) {
$_SESSION[$LEM->sessid][$sgqa] = ""; // Fill the $_SESSION to don't do it again a second time, but wait to fill with good value
if(self::checkValidityAnswer($qInfo['type'],$_SESSION[$LEM->sessid][$sgqa],$sgqa,$qInfo,Permission::model()->hasSurveyPermission($LEM->sid, 'surveycontent', 'update'))) {
$_SESSION[$LEM->sessid][$sgqa]=$LEM->ProcessString($LEM->knownVars[$sgqa]['default'], $qInfo['qid'], NULL, 1, 1, false, false, true);// Ok can fill with good value
$defaultValue = $LEM->ProcessString($LEM->knownVars[$sgqa]['default'], $qInfo['qid'], NULL, 1, 1, false, false, true);
if(self::checkValidityAnswer($qInfo['type'],$defaultValue,$sgqa,$qInfo,Permission::model()->hasSurveyPermission($LEM->sid, 'surveycontent', 'update'))) {
$_SESSION[$LEM->sessid][$sgqa] = $defaultValue;// Ok can fill with good value
$LEM->updatedValues[$sgqa] = $updatedValues[$sgqa] = array('type'=>$qInfo['type'],'value'=>$_SESSION[$LEM->sessid][$sgqa]);
}
/* cleanup $LEM->validityString[$sgqa] */
Expand Down

0 comments on commit b302a96

Please sign in to comment.