Randomizacija vrednosti v vprasanju - podatki - popravek buga vrstnega reda
This commit is contained in:
parent
293387ffff
commit
e021f87b41
@ -3254,12 +3254,12 @@ class SurveyDataCollect{
|
||||
}
|
||||
|
||||
$this->_array_random = array();
|
||||
|
||||
$i=0;
|
||||
|
||||
// Preberemo vsa VPRASANJA ki imajo vklopljeno randomizacijo
|
||||
$_qry_random_spr = sisplet_query("SELECT s.id, s.variable FROM srv_spremenljivka s, srv_grupa g
|
||||
WHERE g.ank_id='".$this->sid."' AND s.gru_id=g.id AND s.random='1'
|
||||
ORDER BY s.vrstni_red");
|
||||
ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
|
||||
if (!$_qry_random_spr) {
|
||||
$this->trigerError('get_random', mysqli_error($GLOBALS['connect_db']));
|
||||
}
|
||||
@ -3269,11 +3269,14 @@ class SurveyDataCollect{
|
||||
|
||||
// Napolnimo array z randomiziranimi vprasanji
|
||||
if ($cnt_rows > 0) {
|
||||
|
||||
|
||||
while ($row = mysqli_fetch_array($_qry_random_spr)) {
|
||||
|
||||
$this->_array_random[$row['id']]['id'] = $row['id'];
|
||||
$this->_array_random[$row['id']]['variable'] = $row['variable'];
|
||||
$this->_array_random[$row['id']]['type'] = 'spr';
|
||||
$this->_array_random[$i]['id'] = $row['id'];
|
||||
$this->_array_random[$i]['variable'] = $row['variable'];
|
||||
$this->_array_random[$i]['type'] = 'spr';
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3296,9 +3299,9 @@ class SurveyDataCollect{
|
||||
|
||||
while ($row = mysqli_fetch_array($_qry_random_blok)) {
|
||||
|
||||
$this->_array_random[$row['id']]['id'] = $row['id'];
|
||||
$this->_array_random[$row['id']]['variable'] = $row['label'];
|
||||
$this->_array_random[$row['id']]['number'] = $row['number'];
|
||||
$this->_array_random[$i]['id'] = $row['id'];
|
||||
$this->_array_random[$i]['variable'] = $row['label'];
|
||||
$this->_array_random[$i]['number'] = $row['number'];
|
||||
|
||||
// Napolnimo string z id-ji blokov
|
||||
$this->_str_blocks .= $prefix.$row['id'];
|
||||
@ -3306,12 +3309,14 @@ class SurveyDataCollect{
|
||||
|
||||
// Blok ima randomizirane bloke
|
||||
if($row['random'] == -2){
|
||||
$this->_array_random[$row['id']]['type'] = 'blok_blok';
|
||||
$this->_array_random[$i]['type'] = 'blok_blok';
|
||||
}
|
||||
// Blok ima randomizirana vprasanja
|
||||
else{
|
||||
$this->_array_random[$row['id']]['type'] = 'blok_spr';
|
||||
}
|
||||
$this->_array_random[$i]['type'] = 'blok_spr';
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user