Skip to content

Commit

Permalink
Fixed issue: relay on surveymodel rather than on inherited setting
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Mar 14, 2018
1 parent 60cee17 commit 1429369
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 @@ -4901,6 +4901,7 @@ public static function StartSurvey($surveyid,$surveyMode='group',$aSurveyOptions
}
$LEM->surveyOptions['active'] = (isset($aSurveyOptions['active']) ? $aSurveyOptions['active'] : false);
$LEM->surveyOptions['allowsave'] = (isset($aSurveyOptions['allowsave']) ? $aSurveyOptions['allowsave'] : false);
$LEM->surveyOptions['alloweditaftercompletion'] = (isset($aSurveyOptions['alloweditaftercompletion']) ? $aSurveyOptions['alloweditaftercompletion'] : false);
$LEM->surveyOptions['anonymized'] = (isset($aSurveyOptions['anonymized']) ? $aSurveyOptions['anonymized'] : false);
$LEM->surveyOptions['assessments'] = (isset($aSurveyOptions['assessments']) ? $aSurveyOptions['assessments'] : false);
$LEM->surveyOptions['datestamp'] = (isset($aSurveyOptions['datestamp']) ? $aSurveyOptions['datestamp'] : false);
Expand Down Expand Up @@ -5522,7 +5523,7 @@ private function _UpdateValuesInDatabase($finished=false)
//If the responses already have been submitted once they are marked as completed already, so they shouldn't be changed.
$oSurveyResponse = SurveyDynamic::model($this->sid)->findByAttributes(['id' => $_SESSION[$this->sessid]['srid']]);
$result = true;
if ($oSurveyResponse->submitdate == null || $this->surveyOptions['alloweditaftercompletion'] == 'Y') {
if ($oSurveyResponse->submitdate == null || Survey::model()->findByPk($this->sid)->alloweditaftercompletion == 'Y') {
$result = !dbExecuteAssoc($query);
}

Expand Down Expand Up @@ -5574,7 +5575,7 @@ private function _UpdateValuesInDatabase($finished=false)
}
else
{
if ($finished && ($oSurveyResponse->submitdate == null || $this->surveyOptions['alloweditaftercompletion'] == 'Y')) {
if ($finished && ($oSurveyResponse->submitdate == null || Survey::model()->findByPk($this->sid)->alloweditaftercompletion == 'Y')) {
$sQuery = 'UPDATE '.$this->surveyOptions['tablename'] . " SET ";
if($this->surveyOptions['datestamp'])
{
Expand Down

0 comments on commit 1429369

Please sign in to comment.