#--- application/helpers/qanda_helper.php 15:48:19.000000000 +0200 #+++ application/helpers/qanda_helper.php 2018-09-25 18:05:36.587042790 +0200 ## array #@@ -3329,7 +3329,7 @@ # $fn++; # # foreach ($labelcode as $ld) { #- $CHECKED = (isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == $ld) ? 'CHECKED' : ''; #+ $CHECKED = ($ld != "" && isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == $ld) ? 'CHECKED' : ''; # $answer_tds .= doRender('/survey/questions/answer/arrays/array/no_dropdown/rows/cells/answer_td', array( # 'myfname'=>$myfname, # 'ld'=>$ld, ##still array #@@ -3343,7 +3343,7 @@ # // NB: $ia[6] = mandatory # $no_answer_td = ''; # if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1) { #- $CHECKED = (!isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == '') ? 'CHECKED' : ''; #+ $CHECKED = ''; # $no_answer_td .= doRender('/survey/questions/answer/arrays/array/no_dropdown/rows/cells/answer_td', array( # 'myfname' => $myfname, # 'ld' => '', --- application/core/QuestionTypes/ListRadio/RenderListRadio.php 2023-10-18 16:34:01.195789512 +0200 +++ application/core/QuestionTypes/ListRadio/RenderListRadio.php 2023-10-18 16:37:16.855782603 +0200 # List (radio) and image select list (radio) @@ -175,12 +175,6 @@ public function addNoAnswerRow() { - if (!isset($this->mSessionValue) || $this->mSessionValue == '' || $this->mSessionValue == ' ') { - $check_ans = CHECKED; //Check the "no answer" radio button if there is no answer in session. - } else { - $check_ans = ''; - } - return Yii::app()->twigRenderer->renderQuestion($this->getMainView() . '/rows/answer_row_noanswer', array( 'name' => $this->sSGQA, 'check_ans' => $check_ans, # list with comment --- application/core/QuestionTypes/ListWithComment/RenderListComment.php 2023-10-18 17:10:17.343712671 +0200 +++ application/core/QuestionTypes/ListWithComment/RenderListComment.php 2023-10-18 17:10:21.751712516 +0200 @@ -57,7 +57,6 @@ 'name' => $this->sSGQA, 'id' => 'answer' . $this->sSGQA, 'value' => '', - 'check_ans' => ($this->mSessionValue == '' || $this->mSessionValue == ' ') ? CHECKED : '', 'checkconditionFunction' => $this->checkconditionFunction . '(this.value, this.name, this.type)', 'labeltext' => gT('No answer'), ); # array = arrayflexiblerow --- application/core/QuestionTypes/ArrayFlexibleRow/RenderArrayFlexibleRow.php 2023-10-18 17:38:24.807653087 +0200 +++ application/core/QuestionTypes/ArrayFlexibleRow/RenderArrayFlexibleRow.php 2023-10-18 17:42:10.247645126 +0200 @@ -299,7 +299,6 @@ 'ld' => '', 'code' => $oAnswer->code, 'label' => gT('No answer'), - 'checked' => (is_null($value) || $value === '') ? 'checked' : '', ); } # array 5 point choice, array 10 point choice, array increase same decrease, array yes no uncertain, array by column, yesno, gender --- application/helpers/qanda_helper.php.orig 2023-09-27 17:48:55.679676491 +0200 +++ application/helpers/qanda_helper.php 2023-10-18 18:17:35.139570096 +0200 @@ -2524,9 +2524,6 @@ $noAnswer = false; if (($ia[6] != 'Y' && $ia[6] != 'S') && SHOW_NO_ANSWER == 1) { $noAnswer = true; - if (empty($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$ia[1]])) { - $naChecked = CHECKED; - } } $aQuestionAttributes = QuestionAttribute::model()->getQuestionAttributes($ia[0]); @@ -2537,7 +2534,6 @@ 'basename' => $ia[1], 'yChecked' => $yChecked, 'nChecked' => $nChecked, - 'naChecked' => $naChecked, 'noAnswer' => $noAnswer, 'value' => $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$ia[1]], 'displayType' => $displayType, @@ -2568,9 +2564,6 @@ $displayType = (int) $aQuestionAttributes['display_type']; if (($ia[6] != 'Y' && $ia[6] != 'S') && SHOW_NO_ANSWER == 1) { $noAnswer = true; - if ($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$ia[1]] == '') { - $naChecked = CHECKED; - } } $noAnswer = $noAnswer ?? false; @@ -2580,7 +2573,6 @@ 'basename' => $ia[1], 'fChecked' => $fChecked, 'mChecked' => $mChecked, - 'naChecked' => $naChecked, 'noAnswer' => $noAnswer, 'value' => $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$ia[1]], ); @@ -2773,14 +2773,12 @@ // ==>tds if (($isNotYes && $isNotS) && $showNoAnswer) { - $CHECKED = (!isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == '') ? 'CHECKED' : ''; $answer_tds .= doRender('/survey/questions/answer/arrays/5point/rows/cells/answer_td_input', array( 'i' => "", 'labelText' => gT('No answer'), 'myfname' => $myfname, 'basename' => $ia[1], 'code' => '', - 'CHECKED' => $CHECKED, 'checkconditionFunction' => $checkconditionFunction, 'value' => '', ), true); @@ -2944,7 +2942,6 @@ } if ($ia[6] != "Y" && SHOW_NO_ANSWER == 1) { - $CHECKED = (!isset($_SESSION['survey_' . $iSurveyId][$myfname]) || $_SESSION['survey_' . $iSurveyId][$myfname] == '') ? 'CHECKED' : ''; $answer_tds .= doRender( '/survey/questions/answer/arrays/10point/rows/cells/answer_td_input', array( @@ -2953,7 +2950,6 @@ 'myfname' => $myfname, 'basename' => $ia[1], 'code' => '', - 'CHECKED' => $CHECKED, 'value' => '', ), true @@ -3065,7 +3061,6 @@ $Ychecked = (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == 'Y') ? 'CHECKED' : ''; $Uchecked = (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == 'U') ? 'CHECKED' : ''; $Nchecked = (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == 'N') ? 'CHECKED' : ''; - $NAchecked = (!isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == '') ? 'CHECKED' : ''; $sRows .= doRender('/survey/questions/answer/arrays/yesnouncertain/rows/answer_row', array( 'basename' => $ia[1], @@ -3075,7 +3070,6 @@ 'Ychecked' => $Ychecked, 'Uchecked' => $Uchecked, 'Nchecked' => $Nchecked, - 'NAchecked' => $NAchecked, 'value' => $value, 'checkconditionFunction' => $checkconditionFunction, 'error' => $error, @@ -3168,7 +3162,6 @@ $Ichecked = (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == 'I') ? 'CHECKED' : ''; $Schecked = (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == 'S') ? 'CHECKED' : ''; $Dchecked = (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == 'D') ? 'CHECKED' : ''; - $NAchecked = (!isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == '') ? 'CHECKED' : ''; $no_answer = (($ia[6] != 'Y' && $ia[6] != 'S') && SHOW_NO_ANSWER == 1) ? true : false; $sRows .= doRender('/survey/questions/answer/arrays/increasesamedecrease/rows/answer_row', array( @@ -3179,7 +3172,6 @@ 'Ichecked' => $Ichecked, 'Schecked' => $Schecked, 'Dchecked' => $Dchecked, - 'NAchecked' => $NAchecked, 'value' => $value, 'checkconditionFunction' => $checkconditionFunction, 'error' => $error, @@ -4411,11 +4403,6 @@ $_SESSION['survey_' . App()->getConfig('surveyID')][$myfname] === $ansrow['code'] ) { $aData['checked'][$ansrow['code']][$ld] = CHECKED; - } elseif ( - !isset($_SESSION['survey_' . App()->getConfig('surveyID')][$myfname]) && - $ansrow['code'] == '' - ) { - $aData['checked'][$ansrow['code']][$ld] = CHECKED; // Humm.. (by lemeur), not sure this section can be reached // because I think $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] is always set (by save.php ??) ! // should remove the !isset part I think !! # array dual scale --- application/core/QuestionTypes/ArrayMultiscale/RenderArrayMultiscale.php 2023-10-18 18:35:23.024290497 +0200 +++ application/core/QuestionTypes/ArrayMultiscale/RenderArrayMultiscale.php 2023-10-18 18:36:22.587268833 +0200 @@ -319,31 +319,6 @@ } $aData['answertextright'] = $answertextright; - if ($aData['shownoanswer']) { - if (count($aData['labelans1']) > 0) { - $fname1value = $this->getFromSurveySession($myfname1); - // If value is empty, notset should be checked. - // string "0" should be considered as valid answer, - // so notset should not be checked in that case. - if ($fname1value !== '0' && empty($fname1value)) { - #$answer .= CHECKED; - $aData['aSubQuestions'][$i]['myfname1_notset'] = CHECKED; - } else { - $aData['aSubQuestions'][$i]['myfname1_notset'] = ""; - } - } else { - $fname0value = $this->getFromSurveySession($myfname0); - // If value is empty, notset should be checked. - // string "0" should be considered as valid answer, - // so notset should not be checked in that case. - if ($fname0value !== '0' && empty($fname0value)) { - //$answer .= CHECKED; - $aData['aSubQuestions'][$i]['myfname0_notset'] = CHECKED; - } else { - $aData['aSubQuestions'][$i]['myfname0_notset'] = ''; - } - } - } $fn++; } } --- application/core/QuestionTypes/5PointChoice/RenderFivePointChoice.php 2023-11-08 18:13:14.243657989 +0100 +++ application/core/QuestionTypes/5PointChoice/RenderFivePointChoice.php 2023-11-08 18:19:53.291643899 +0100 @@ -49,7 +49,6 @@ 'id' => $this->sSGQA, 'labelText' => gT('No answer'), 'itemExtraClass' => 'noanswer-item', - 'checkedState' => (!$this->mSessionValue ? ' CHECKED ' : ''), 'checkconditionFunction' => $this->checkconditionFunction, ); }