diff --git a/admin/quotarow.php b/admin/quotarow.php index 9d35a2be..c3b1a23a 100755 --- a/admin/quotarow.php +++ b/admin/quotarow.php @@ -431,22 +431,27 @@ if ($questionnaire_id != false) $lime_sid = $db->GetOne($sql); - $ssgqa = "''"; + $ssgqa = ""; if (isset($_GET['sgqa'])) - $ssgqa = $db->qstr($_GET['sgqa']); + $ssgqa = $_GET['sgqa']; include_once("../functions/functions.limesurvey.php"); $rsgqa = lime_list_questions($questionnaire_id); - //TODO: check output matches - var_dump($rsgqa); die(); if (!empty($rsgqa)) { print "
"; print "

" . T_("Add restriction based on answered questions") . "

"; - print ""; - display_chooser($rsgqa,"sgqa","sgqa",true,"edit=edit&qsqri=$qsqri"); + print ""; + + for ($i=0; $i @@ -464,18 +469,22 @@ if ($questionnaire_id != false) if (isset($_GET['sgqa'])) { $sgqa = $_GET['sgqa']; - $qid = explode("X", $sgqa); - $qid = $qid[2]; - $rsc = lime_list_answeroptions($questionnaire_id,$sgqa); - //TODO: check output matches - var_dump($rsc); die(); + + $list = array(); + + foreach($rsc['answeroptions'] as $key=>$val) { + $list[] = array('code' => $key, 'answer' => $val['answer']); + } + + + } - if (!isset($rsc) || empty($rsc)) + if (!isset($rsc['answeroptions']) || is_string($rsc['answeroptions'])) print "

" . T_("No labels defined for this question") ."

"; else - xhtml_table($rsc,array('code','title'),array(T_("Code value"), T_("Description"))); + xhtml_table($list,array('code','answer'),array(T_("Code value"), T_("Description"))); } else { print ""; } print "
";