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);
|
$rs = lime_list_questions($questionnaire_id);
|
||||||
|
|
||||||
var_dump($rs); die(); //TODO: make sure query below works with this function
|
for ($i=0; $i<count($rs); $i++)
|
||||||
|
{
|
||||||
display_chooser($rs,"sgqa","sgqa",true,"questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id",true,true,false,true,"form-group");
|
$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>";
|
print "<div class='clearfix'></div>";
|
||||||
|
|
||||||
@@ -244,13 +247,16 @@ if ($questionnaire_id != false)
|
|||||||
|
|
||||||
$rs = lime_list_answeroptions($questionnaire_id,$sgqa);
|
$rs = lime_list_answeroptions($questionnaire_id,$sgqa);
|
||||||
|
|
||||||
//TODO: Check this result
|
$list = array();
|
||||||
var_dump($rs); die();
|
|
||||||
|
|
||||||
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>";
|
print "<p class='well text-info'>" . T_("No labels defined for this question") ."</p>";
|
||||||
else
|
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>";
|
print "</div>";
|
||||||
|
|||||||
@@ -133,14 +133,15 @@ function lime_list_answeroptions($qid,$qcode)
|
|||||||
if ($q !== false)
|
if ($q !== false)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach($q as $qid => $val) {
|
foreach($q as $tmp => $val) {
|
||||||
if ($val['title'] == $qcode) {
|
if ($val['title'] == $qcode) {
|
||||||
$qp = $limeRPC->get_question_properties($limeKey,$qid,array('answeroptions'));
|
limerpc_init_qid($qid);
|
||||||
if (!isset($qp['status'])) {
|
$qp = $limeRPC->get_question_properties($limeKey,$val['qid'],array('answeroptions'));
|
||||||
$ret = $qp;
|
if (!isset($qp['status'])) {
|
||||||
}
|
$ret = $qp;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user