mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fix listing of questions for quota
This commit is contained in:
@@ -196,9 +196,12 @@ if ($questionnaire_id != false)
|
||||
|
||||
$rs = lime_list_questions($questionnaire_id);
|
||||
|
||||
var_dump($rs); die(); //TODO: make sure query below works with this function
|
||||
|
||||
display_chooser($rs,"sgqa","sgqa",true,"questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id",true,true,false,true,"form-group");
|
||||
for ($i=0; $i<count($rs); $i++)
|
||||
{
|
||||
$rs[$i]['description'] = substr(strip_tags($rs[$i]['question']),0,400);
|
||||
$rs[$i]['value'] = $rs[$i]['title'];
|
||||
}
|
||||
display_chooser($rs,"sgqa","sgqa",true,"questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id",true,true,array('title',$sgqa),true,"form-group");
|
||||
|
||||
print "<div class='clearfix'></div>";
|
||||
|
||||
@@ -244,13 +247,16 @@ if ($questionnaire_id != false)
|
||||
|
||||
$rs = lime_list_answeroptions($questionnaire_id,$sgqa);
|
||||
|
||||
//TODO: Check this result
|
||||
var_dump($rs); die();
|
||||
$list = array();
|
||||
|
||||
if (!isset($rs) || empty($rs))
|
||||
foreach($rs['answeroptions'] as $key=>$val) {
|
||||
$list[] = array('code' => $key, 'answer' => $val['answer']);
|
||||
}
|
||||
|
||||
if (!isset($rs['answeroptions']) || is_string($rs['answeroptions']))
|
||||
print "<p class='well text-info'>" . T_("No labels defined for this question") ."</p>";
|
||||
else
|
||||
xhtml_table($rs,array('code','title'),array(T_("Code value"), T_("Description")));
|
||||
xhtml_table($list,array('code','answer'),array(T_("Code value"), T_("Description")));
|
||||
|
||||
|
||||
print "</div>";
|
||||
|
||||
@@ -133,14 +133,15 @@ function lime_list_answeroptions($qid,$qcode)
|
||||
if ($q !== false)
|
||||
{
|
||||
|
||||
foreach($q as $qid => $val) {
|
||||
if ($val['title'] == $qcode) {
|
||||
$qp = $limeRPC->get_question_properties($limeKey,$qid,array('answeroptions'));
|
||||
if (!isset($qp['status'])) {
|
||||
$ret = $qp;
|
||||
}
|
||||
break;
|
||||
foreach($q as $tmp => $val) {
|
||||
if ($val['title'] == $qcode) {
|
||||
limerpc_init_qid($qid);
|
||||
$qp = $limeRPC->get_question_properties($limeKey,$val['qid'],array('answeroptions'));
|
||||
if (!isset($qp['status'])) {
|
||||
$ret = $qp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user