diff options
Diffstat (limited to 'admin/survey/classes/surveyAnalysis/class.SurveyTTest.php')
-rw-r--r-- | admin/survey/classes/surveyAnalysis/class.SurveyTTest.php | 309 |
1 files changed, 183 insertions, 126 deletions
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php b/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php index 34819a1..de3a5c2 100644 --- a/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php +++ b/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php @@ -8,9 +8,9 @@ *
*/
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
-define("BC_PRECISION", 20);
-define("R_FOLDER", "admin/survey/R");
+if(!defined("EXPORT_FOLDER"))define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if(!defined("BC_PRECISION"))define("BC_PRECISION", 20);
+if(!defined("R_FOLDER"))define("R_FOLDER", "admin/survey/R");
class SurveyTTest
{
@@ -28,19 +28,28 @@ class SurveyTTest public $showChart = false; # ali prikazujemo graf pod tabelo
private $sessionData; # podatki ki so bili prej v sessionu - za nastavitve, ki se prenasajo v izvoze...
-
+
+ protected $currentMissingProfile = null;
+ protected $_HAS_TEST_DATA = null;
+ protected $_CURRENT_STATUS_FILTER = null;
+ protected $_CURRENT_LOOP = null;
+ protected $isArchive = null;
function __construct($sid) {
+ global $global_user_id;
if ((int)$sid > 0) {
+
$this->sid = $sid;
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->sid);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
- $this->db_table = '_active';
- }
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
+ // Pri glasovanju tega ne pustimo
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") == 0){
+ die();
+ }
# Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->sid);
@@ -142,16 +151,18 @@ class SurveyTTest // Shranimo spremenjene nastavitve v bazo
SurveyUserSession::saveData($this->sessionData);
+ if(isset($_GET['a'])){
# izvedemo akcijo
switch ($_GET['a']) {
- case 'spremenljivkaChange':
- $this->spremenljivkaChange();
- break;
- case 'variableChange':
- $this->variableChange();
- break;
- default:
- break;
+ case 'spremenljivkaChange':
+ $this->spremenljivkaChange();
+ break;
+ case 'variableChange':
+ $this->variableChange();
+ break;
+ default:
+ break;
+ }
}
// Shranimo spremenjene nastavitve v bazo
SurveyUserSession::saveData($this->sessionData);
@@ -162,20 +173,14 @@ class SurveyTTest # ali imamo testne podatke
if ($this->_HAS_TEST_DATA) {
# izrišemo bar za testne podatke
- $SSH -> displayTestDataBar(true);
$SSH = new SurveyStaticHtml($this->sid);
+ $SSH -> displayTestDataBar(true);
}
-
- /*echo '<div id="dataOnlyValid">';
- SurveyStatusProfiles::displayOnlyValidCheckbox();
- echo '</div>';*/
-
- //$this->DisplayLinks();
-
+
echo '<div id="ttest_variables">';
$this->DisplayVariables();
echo '</div>'; # id="ttest_variables"
- echo '<br class="clr">';
+
echo '<div id="ttestResults">';
$this->variableChange();
echo '</div>'; # id="ttestResults"
@@ -270,44 +275,48 @@ class SurveyTTest $variables = $this->getVariableList(2);
- echo '<span id="ttestSpremenljivkaSpan" class="floatLeft">';
- echo $lang['srv_ttest_label1'];
- echo '<br />';
- echo '<select id="ttestSpremenljivka" name="ttestSpremenljivka" onchange="ttestSpremenljivkaChange();" autocomplete="off">';
+ echo '<div id="ttestSpremenljivkaSpan" class="ttestLeftHolder">';
+
+ echo '<span class="title">'.$lang['srv_ttest_label1'].':</span>';
+
+ echo '<select id="ttestSpremenljivka" name="ttestSpremenljivka" class="dropdown large" onchange="ttestSpremenljivkaChange();" autocomplete="off">';
echo '<option value="0" selected="selected" >'. $lang['srv_ttest_select1_option'] . '</option>';
if (count($variables)) {
foreach ($variables as $variable) {
- echo '<option value="'.$variable['spr_id'].'"'
+ echo '<option value="'.(isset($variable['spr_id'])?$variable['spr_id']:'').'"'
. ( isset($variable['grd_id']) ? ' grid="'.$variable['grd_id'].'" ' : '')
. ( isset($variable['vr_id']) ? ' vred="'.$variable['vr_id'].'" ' : '')
. ( isset($variable['sequence']) ? ' seq2="'.$variable['sequence'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( $variable['spr_id'] != '' && $variable['spr_id'] == $this->sessionData['ttest']['spr2'] && $variable['sequence'] == $this->sessionData['ttest']['seq2'] ? ' selected="selected"':'')
+ . ( isset($variable['spr_id'])&&$variable['spr_id'] != '' && isset($this->sessionData['ttest']['spr2'] )&& $variable['spr_id'] == $this->sessionData['ttest']['spr2'] && $variable['sequence'] == $this->sessionData['ttest']['seq2'] ? ' selected="selected"':'')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? ' ' : ' ' ))
.$variable['variableNaslov'] . '</option>';
}
}
- echo '</select>'; # name="ttestSpremenljivka"
- echo '<br class="clr"/><br/>';
+ echo '</select>';
+
#.(count($this->sessionData['ttest']['sub_conditions']) == 2?'':'class="active"').
$_active = $this->checkSubConditionsActive();
- if ($this->sessionData['ttest']['spr2'] > 0) {
+ if (isset($this->sessionData['ttest']['spr2'])&&$this->sessionData['ttest']['spr2'] > 0) {
echo '<div id="ttestVariablesSpan"'.($_active < 2 ? ' class="active"' : '').'>';
$this->spremenljivkaChange();
echo '</div>';
} else {
echo '<div id="ttestVariablesSpan" style="display:none" '.($_active < 2 ? ' class="active"' : '').'></div>';
}
- echo '</span>';
+
+ echo '</div>';
+
$cntSubConditionsActive = $this->checkSubConditionsActive();
- echo '<span class="floatLeft spaceRight"> </span>';
- echo '<span id="ttestNumerusSpan" class="floatLeft'.($cntSubConditionsActive == 2 ? '' : ' gray').'">'; #gray
- echo $lang['srv_ttest_label2'];
- echo '<br />';
- echo '<select id="ttestNumerus" name="ttestNumerus" onchange="ttestVariableChange();" autocomplete="off" '.($cntSubConditionsActive == 2 ? '' : ' disabled="disabled"').'>'; #
+
+ echo '<div id="ttestNumerusSpan" class="ttestRightHolder '.($cntSubConditionsActive == 2 ? '' : ' gray').'">';
+
+ echo '<span class="title">'.$lang['srv_ttest_label2'].':</span>';
+
+ echo '<select id="ttestNumerus" name="ttestNumerus" class="dropdown large" onchange="ttestVariableChange();" autocomplete="off" '.($cntSubConditionsActive == 2 ? '' : ' disabled="disabled"').'>'; #
echo '<option value="0" selected="selected" >'. $lang['srv_ttest_select2_option'] . '</option>';
if (count($numerus)) {
foreach ($numerus as $variable) {
@@ -316,22 +325,33 @@ class SurveyTTest . ( isset($variable['vr_id']) ? ' vrd="'.$variable['vr_id'].'" ' : '')
. ( isset($variable['sequence']) ? ' seq="'.$variable['sequence'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( $variable['spr_id'] != '' && $variable['spr_id'] == $selectedVar[0]['spr'] && $variable['sequence'] == $selectedVar[0]['seq']?' selected="selected"':'')
+ . ( isset($selectedVar[0]['spr'])&&$variable['spr_id'] != '' && $variable['spr_id'] == $selectedVar[0]['spr'] && $variable['sequence'] == $selectedVar[0]['seq']?' selected="selected"':'')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? ' ' : ' ' ))
. $variable['variableNaslov'] . '</option>';
}
}
- echo '</select>'; # name="ttestSpremenljivka"
- echo '</span>';
+ echo '</select>';
+
+ echo '</div>';
+
- echo '<br /><span style="margin-left: 30px;">';
- echo '<label><input id="showChart" type="checkbox" onchange="showTableChart(\'ttest\');" '.($this->sessionData['ttest_charts']['showChart']==true?' checked="checked"':'' ).'>'.$lang['srv_show_chart'].'</label>';
+ echo '<div class="ttestSubSetting">';
+
+ echo '<span class="title">'.$lang['settings'].':</span>';
+
+ echo '<span class="setting_line">';
+ echo ' <input id="showChart" type="checkbox" onchange="showTableChart(\'ttest\');" '.(isset($this->sessionData['ttest_charts']['showChart'])&&$this->sessionData['ttest_charts']['showChart']==true?' checked="checked"':'' ).'><label for="showChart">'.$lang['srv_show_chart'].'</label>';
echo '</span>';
- echo '<span style="margin-left: 30px;"><a href="https://www.1ka.si/d/sl/pomoc/prirocniki/ttest?from1ka=1" target="_blank">';
- echo $lang['srv_ttest_interpretacija_note'];
- echo '</a></span>';
+
+ /*echo '<span class="setting_line">';
+ echo ' <a href="https://www.1ka.si/d/sl/pomoc/prirocniki/ttest?from1ka=1" target="_blank">';
+ echo $lang['srv_ttest_interpretacija_note'];
+ echo ' </a>';
echo Help::display('srv_ttest_interpretation');
+ echo '</span>';*/
+
+ echo '</div>';
// Shranimo spremenjene nastavitve v bazo
@@ -346,7 +366,7 @@ class SurveyTTest $this->variablesList = array();
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
if ($witch == 1) {
# prvi drop down, morajo biti numerične ali ordinalne
# skala - 0 Ordinalna
@@ -497,7 +517,7 @@ class SurveyTTest # imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[] = array(
'tip'=>$tip,
@@ -536,16 +556,17 @@ class SurveyTTest if (isset($this->sessionData['ttest']['spr2']) && $this->sessionData['ttest']['spr2'] != 0){
$_spr = explode('_',$this->sessionData['ttest']['spr2']);
- #$spr = $_spr[0];
$spr = $this->sessionData['ttest']['spr2'];
if (isset($this->sessionData['ttest']['grid2'])){
$grid = $this->sessionData['ttest']['grid2'];
}
+
# poiščemo pripadajoče variable
$_spr_data = $this->_HEADERS[$this->sessionData['ttest']['spr2']];
- echo $lang['srv_ttest_kategories_note'].' ('.$_spr_data['variable'].') '.$_spr_data['naslov'];
- echo '<br/>';
+
+ echo '<span class="title">'.$lang['srv_ttest_kategories_note'].' ('.$_spr_data['variable'].') '.$_spr_data['naslov'].'</span>';
+
switch ($_spr_data['tip']) {
case 1: #radio
case 3: #dropdown
@@ -553,31 +574,42 @@ class SurveyTTest #nardimo inpute za vse opcije
$sekvenca = $_spr_data['sequences'];
foreach ($_spr_data['options'] as $value => $option) {
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>('.$value.') - '.$option.'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'">('.$value.') - '.$option.'</label>';
+ echo '</span>';
}
break;
- case 2: #checkbox
+ case 2: #checkbox
#nardimo inpute za vse opcije
$option = '1';
foreach ($_spr_data['grids'][0]['variables'] as $vid => $variable) {
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option. '" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'">('.$variable['variable'].') - '.$variable['naslov'].'</label>';
+ echo '</span>';
}
break;
- case 6: #mgrid
+ case 6: #mgrid
#nardimo inpute za vse opcije
$sekvenca = $this->sessionData['ttest']['seq2'];
foreach ($_spr_data['options'] as $value => $option) {
- //$sekvenca = $_spr_data['grids'][$value]['variables'][0]['sequence'];
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>('.$value.') - '.$option.'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'">('.$value.') - '.$option.'</label>';
+ echo '</span>';
}
break;
- case 16: #mcheck
+ case 16: #mcheck
#nardimo inpute za vse opcije
# poiščemo pripadajočo sekvenco
#nardimo inpute za vse opcije
$option = '1';
foreach ($_spr_data['grids'][$grid]['variables'] as $vid => $variable) {
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'">('.$variable['variable'].') - '.$variable['naslov'].'</label>';
+ echo '</span>';
}
break;
@@ -602,20 +634,16 @@ class SurveyTTest function variableChange() {
global $admin_type;
- if (count($this->sessionData['ttest']['sub_conditions']) > 1 ) {
+ if (isset($this->sessionData['ttest']['sub_conditions'])&&count($this->sessionData['ttest']['sub_conditions']) > 1 ) {
$variables1 = $this->getSelectedVariables();
- if (count($variables1) > 0) {
+ if (isset($variables1)&&count($variables1) > 0) {
+
// ikone za izvoz
$this->displayExport();
+
foreach ($variables1 AS $v_first) {
- $ttest = null;
- /*$ttest = $this->createTTestOld($v_first, $this->sessionData['ttest']['sub_conditions']);
- $this->displayTtestTable($ttest);*/
- $ttest = $this->createTTest($v_first, $this->sessionData['ttest']['sub_conditions']);
- $this->displayTtestTable($ttest);
-
- // Zvezdica za vkljucitev v porocilo
+ // Zvezdica za vkljucitev v porocilo
$spid1 = $this->sessionData['ttest']['variabla'][0]['spr'];
$seq1 = $this->sessionData['ttest']['variabla'][0]['seq'];
$grid1 = $this->sessionData['ttest']['variabla'][0]['grd'];
@@ -629,6 +657,11 @@ class SurveyTTest $spr1 = $seq2.'-'.$spid2.'-'.$grid2.'-'.$sub1.'-'.$sub2;
$spr2 = $seq1.'-'.$spid1.'-'.$grid1;
SurveyAnalysis::addCustomReportElement($type=7, $sub_type=0, $spr1, $spr2);
+
+ // Tabela
+ $ttest = null;
+ $ttest = $this->createTTest($v_first, $this->sessionData['ttest']['sub_conditions']);
+ $this->displayTtestTable($ttest);
// Izrisemo graf za tabelo
if(isset($this->sessionData['ttest_charts']['showChart']) && $this->sessionData['ttest_charts']['showChart'] == true){
@@ -646,7 +679,7 @@ class SurveyTTest function getSelectedVariables() {
$selected = array();
- if (count($this->sessionData['ttest']['variabla']) > 0 ) {
+ if (isset($this->sessionData['ttest']['variabla'])&&count($this->sessionData['ttest']['variabla']) > 0 ) {
foreach ($this->sessionData['ttest']['variabla'] AS $var1) {
if ((int)$var1['seq'] > 0) {
$selected[] = $var1;
@@ -760,7 +793,7 @@ class SurveyTTest }
}
-
+ $additional_status_filter = null;
# dodamo status filter za vse sekvence checkbox-a da so == 1
if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
@@ -931,9 +964,9 @@ class SurveyTTest }
# dodamo status filter za vse sekvence checkbox-a da so == 1
- if ($additional_status_filter != null) {
+ /* if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
- }
+ } */
# odstranimo vse zapise, kjer katerakoli od variabel vsebuje missing
$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
@@ -992,22 +1025,28 @@ class SurveyTTest $grid1 = $this->sessionData['ttest']['variabla'][0]['grd'];
if (is_array($ttest) && count($ttest) > 0 && (int)$seq1 > 0) {
+
if ($this->isArchive == false) {
+
echo '<div id="displayFilterNotes">';
+
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
SurveyTimeProfiles :: printIsDefaultProfile();
- # če imamo filter ifov ga izpišemo
- SurveyConditionProfiles:: getConditionString($doNewLine );
- # če imamo filter spremenljivk ga izpišemo
- SurveyVariablesProfiles:: getProfileString($doNewLine, true);
- SurveyDataSettingProfiles :: getVariableTypeNote($doNewLine );
- # če rekodiranje
+
+ # če imamo filter ifov ga izpišemo
+ SurveyConditionProfiles:: getConditionString();
+
+ # če imamo filter spremenljivk ga izpišemo
+ SurveyVariablesProfiles:: getProfileString();
+ SurveyDataSettingProfiles :: getVariableTypeNote();
+
+ # če rekodiranje
$SR = new SurveyRecoding($this->sid);
$SR -> getProfileString();
+
echo '</div>';
-
- echo '<br class="clr" />';
}
+
$spr_data_1 = $this->_HEADERS[$spid1];
if ($grid1 == 'undefined') {
@@ -1022,7 +1061,8 @@ class SurveyTTest }
}
}
- } else {
+ }
+ else {
# imamo subgrid
$sprLabel1 = '('.$spr_data_1['grids'][$grid1]['variable'].') '. $spr_data_1['grids'][$grid1]['naslov'];
}
@@ -1032,84 +1072,101 @@ class SurveyTTest $sprLabel2 = trim($this->sessionData['ttest']['label2']);
$label1 = $this->getVariableLabels($this->sessionData['ttest']['sub_conditions'][0]);
$label2 = $this->getVariableLabels($this->sessionData['ttest']['sub_conditions'][1]);
- echo '<table border="0" class="ttestTable">';
- echo '<tr>';
+
+
+ echo '<table class="table_ttest">';
+
+
+ echo '<tr class="row1">';
+
#labele
- echo '<td class="lightGreen" rowspan="2" >';
- echo '<span class="anl_variabla">';
- echo '<a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid2.'\'); return false;">';
- echo $sprLabel2.'</a>';
- echo '</span>';
+ echo '<td class="cell_question" rowspan="2" >';
+ echo ' <span class="anl_variabla">';
+ echo ' <a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid2.'\'); return false;">';
+ echo $sprLabel2;
+ echo ' </a>';
+ echo ' </span>';
echo '</td>';
- echo '<td class="lightGreen" colspan="9">';
- echo '<span class="anl_variabla">';
- echo '<a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid1.'\'); return false;">';
- echo $sprLabel1.'</a>';
- echo '</span>';
+ echo '<td class="cell_question" colspan="9">';
+ echo ' <span class="anl_variabla">';
+ echo ' <a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid1.'\'); return false;">';
+ echo $sprLabel1;
+ echo ' </a>';
+ echo ' </span>';
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #echo '<th colspan="2"> </th>';
+
+
+ echo '<tr class="row2">';
+
#frekvenca
- echo '<th >n</th>';
+ echo '<td class="cell_value">n</td>';
#povprečje
- echo '<th><span class="avg">x</span></th>';
+ echo '<td class="cell_value"><span class="avg">x</span></td>';
#varianca
- echo '<th>s²</th>';
+ echo '<td class="cell_value">s²</td>';
#standardna napaka
- echo '<th>se(<span class="avg">x</span>)</th>';
+ echo '<td class="cell_value">se(<span class="avg">x</span>)</td>';
#margini
- echo '<th>±1,96×se(<span class="avg">x</span>)</th>';
+ echo '<td class="cell_value">±1,96×se(<span class="avg">x</span>)</td>';
#d
- echo '<th>d</th>';
+ echo '<td class="cell_value">d</td>';
#sed
- echo '<th>se(d)</th>';
+ echo '<td class="cell_value">se(d)</td>';
#signifikanca
- echo '<th>Sig.</th>';
+ echo '<td class="cell_value">Sig.</td>';
#ttest
- echo '<th>t</th>';
+ echo '<td class="cell_value">t</td>';
+
echo '</tr>';
+
echo '<tr>';
- #labele
-
- echo '<td class="lightGreen">'.$label1.'</td>';
+ #labele
+ echo '<td class="cell_question">'.$label1.'</td>';
#frekvenca
- echo '<td>'.$this->formatNumber($ttest[1]['n'],0).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['n'],0).'</td>';
#povprečje
- echo '<td>'.$this->formatNumber($ttest[1]['x'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['x'],3).'</td>';
#varianca
- echo '<td>'.$this->formatNumber($ttest[1]['s2'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['s2'],3).'</td>';
#standardna napaka
- echo '<td>'.$this->formatNumber($ttest[1]['se'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['se'],3).'</td>';
#margini
- echo '<td>'.$this->formatNumber($ttest[1]['margin'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['margin'],3).'</td>';
#d
- echo '<td rowspan="2">'.$this->formatNumber($ttest['d'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['d'],3).'</td>';
#sed
- echo '<td rowspan="2">'.$this->formatNumber($ttest['sed'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['sed'],3).'</td>';
#sig
- echo '<td rowspan="2">'.$this->formatNumber($ttest['sig'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['sig'],3).'</td>';
#ttest
- echo '<td rowspan="2">'.$this->formatNumber($ttest['t'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['t'],3).'</td>';
+
echo '</tr>';
+
echo '<tr>';
+
#labele
- echo '<td class="lightGreen">'.$label2.'</td>';
+ echo '<td class="cell_question">'.$label2.'</td>';
#frekvenca
- echo '<td>'.$this->formatNumber($ttest[2]['n'],0).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['n'],0).'</td>';
#povprečje
- echo '<td>'.$this->formatNumber($ttest[2]['x'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['x'],3).'</td>';
#varianca
- echo '<td>'.$this->formatNumber($ttest[2]['s2'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['s2'],3).'</td>';
#standardna napaka
- echo '<td>'.$this->formatNumber($ttest[2]['se'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['se'],3).'</td>';
#margini
- echo '<td>'.$this->formatNumber($ttest[2]['margin'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['margin'],3).'</td>';
+
echo '</tr>';
+
+
echo '</table>';
}
@@ -1171,7 +1228,7 @@ class SurveyTTest function checkboxSubCondition($checkCondition) {
$cnt = $this->checkSubConditionsActive();
- $sub_Conditions = $this->sessionData['ttest']['sub_conditions'];
+ $sub_Conditions = isset($this->sessionData['ttest']['sub_conditions'])?$this->sessionData['ttest']['sub_conditions']:array();
if (is_array($sub_Conditions) && count($sub_Conditions) > 0) {
foreach ($sub_Conditions AS $sub_condition) {
if ($sub_condition == $checkCondition) {
@@ -1190,9 +1247,9 @@ class SurveyTTest $cnt = 0;
- $needle = $this->sessionData['ttest']['spr2'];
+ $needle = isset($this->sessionData['ttest']['spr2'])?$this->sessionData['ttest']['spr2']:"";
$length = strlen($needle);
- $sub_Conditions = $this->sessionData['ttest']['sub_conditions'];
+ $sub_Conditions = isset($this->sessionData['ttest']['sub_conditions'])?$this->sessionData['ttest']['sub_conditions']:array();
if (is_array($sub_Conditions) && count($sub_Conditions) > 0) {
foreach ($sub_Conditions AS $haystack) {
$cnt += (int)(substr($haystack, 0, $length) === $needle);
|