作者 何书鹏
1 个管道 的构建 通过 耗费 6 秒

问卷选项处理成数据

... ... @@ -34,7 +34,10 @@ class Questionnaire extends Api
"list": [{ //题目列表
"id": 1, //题目ID
"title": "测定混凝土立方体抗压强度时,标准试件的尺寸是( )㎜。", //题目
"option": "[{\"name\":\"A\",\"gender\":\"100\\u00d7100\\u00d7100\"},{\"name\":\"B\",\"gender\":\"150\\u00d7150\\u00d7150\"},{\"name\":\"C\",\"gender\":\"200\\u00d7200\\u00d7200\"},{\"name\":\"D\",\"gender\":\"70.7\\u00d770.7\\u00d770.7\"}]", //题目选项
"option": [{ //题目选项
"key": "A", //选项
"value": "1" //选项内容
}],
"type": "1", //题目类型:1=单选题,2=多选题,3=判断题,4=简答题
}]
}
... ... @@ -43,6 +46,9 @@ class Questionnaire extends Api
public function questionList()
{
$list = QuestionnaireQuestion::field('id,title,option,type')->select();
foreach ($list as $v){
$v->option = json_decode($v['option'],true);
}
$this->success('成功',compact('list'));
}
... ...
... ... @@ -3517,7 +3517,10 @@
"list": [{ //题目列表
"id": 1, //题目ID
"title": "测定混凝土立方体抗压强度时,标准试件的尺寸是( )㎜。", //题目
"option": "[{\"name\":\"A\",\"gender\":\"100\\u00d7100\\u00d7100\"},{\"name\":\"B\",\"gender\":\"150\\u00d7150\\u00d7150\"},{\"name\":\"C\",\"gender\":\"200\\u00d7200\\u00d7200\"},{\"name\":\"D\",\"gender\":\"70.7\\u00d770.7\\u00d770.7\"}]", //题目选项
"option": [{ //题目选项
"key": "A", //选项
"value": "1" //选项内容
}],
"type": "1", //题目类型:1=单选题,2=多选题,3=判断题,4=简答题
}]
}
... ... @@ -24366,7 +24369,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2021-04-27 13:29:02 </div>
Generated on 2021-04-28 19:04:05 </div>
<div class="col-md-6" align="right">
<a href="./" target="_blank">企智帮</a>
</div>
... ...