| | |
| | | |
| | | "id":0, |
| | | "question": "请开启前照灯", |
| | | "flag":1 |
| | | "flag":1, |
| | | "wrong_code":41701 |
| | | |
| | | }, |
| | | { |
| | | "id":1, |
| | | "question": "夜间在没有路灯,照明不良条件下行驶", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41709 |
| | | }, |
| | | { |
| | | "id":2, |
| | | "question": "请将前照灯变换成远光", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41701 |
| | | }, |
| | | { |
| | | |
| | | "id":3, |
| | | "question": "夜间在窄路与非机动车会车", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41704 |
| | | }, |
| | | { |
| | | |
| | | "id":4, |
| | | "question": "夜间同方向近距离跟车行驶", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41702 |
| | | }, |
| | | { |
| | | "id":5, |
| | | "question": "夜间在道路上发生故障,妨碍交通又难以移动", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41701 |
| | | }, |
| | | { |
| | | "id":6, |
| | | "question": "夜间在窄桥与非机动车会车", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41704 |
| | | }, |
| | | { |
| | | "id":7, |
| | | "question": "雾天行驶", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41709 |
| | | }, |
| | | |
| | | { |
| | | "id":8, |
| | | "question": "夜间与机动车会车", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41704 |
| | | }, |
| | | { |
| | | "id":9, |
| | | "question": "夜间通过没有交通信号灯控制的路口", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41703 |
| | | }, |
| | | { |
| | | |
| | | "id":10, |
| | | "question": "夜间通过急弯、坡路", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41703 |
| | | }, |
| | | { |
| | | "id":11, |
| | | "question": "夜间超越前方车辆", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41706 |
| | | }, |
| | | { |
| | | "id":12, |
| | | "question": "在路边临时停车", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41708 |
| | | }, |
| | | { |
| | | "id":13, |
| | | "question": "夜间路口左转弯", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41701 |
| | | }, |
| | | { |
| | | "id":14, |
| | | "question": "夜间路口右转弯", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41701 |
| | | }, |
| | | { |
| | | "id":15, |
| | | "question": "夜间在照明良好的道路上行驶", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41701 |
| | | }, |
| | | { |
| | | "id":16, |
| | | "question": "夜间直行通过路口", |
| | | "flag":0 |
| | | "flag":0, |
| | | "wrong_code":41705 |
| | | } |
| | | ] |
| | |
| | | |
| | | private int flag; |
| | | |
| | | private int wrong_code; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | |
| | | this.question = question; |
| | | } |
| | | |
| | | public int getWrong_code() { |
| | | return wrong_code; |
| | | } |
| | | |
| | | public void setWrong_code(int wrong_code) { |
| | | this.wrong_code = wrong_code; |
| | | } |
| | | |
| | | public int getFlag() { |
| | | return flag; |
| | |
| | | private String tts; |
| | | private List<Integer> process; |
| | | private List<Integer> solution; |
| | | |
| | | private int wrong_code; |
| | | public QuestionBean(int i, String s) { |
| | | this.item =i; |
| | | this.tts = s; |
| | |
| | | |
| | | } |
| | | |
| | | public int getWrong_code() { |
| | | return wrong_code; |
| | | } |
| | | |
| | | public void setWrong_code(int wrong_code) { |
| | | this.wrong_code = wrong_code; |
| | | } |
| | | |
| | | public void parseSolutionAndProcess(String content){ |
| | | solution.clear(); |
| | | process.clear(); |
| | |
| | | |
| | | tempQs.clear() |
| | | val list = WorkRoomDataBase.getWorkRoomDataBase(applicationContext).lightUseQuestionsDao.lightUseQuestionsNoLive() |
| | | val listQuests=WorkRoomDataBase.getWorkRoomDataBase(applicationContext).lightAllQuestionsDao.allLightQuestions |
| | | Log.i("AYJiaKao",list.size.toString()) |
| | | tempQs.add(QuestionBean(100, "下面将进行模拟夜间行驶场景灯光使用的考试,请按语音指令在5秒内做出相应的灯光操作"))//提示下面将进行灯光考试 |
| | | |
| | | if (list.size>5){ |
| | | var questbean = QuestionBean(list[0].id,list[0].question) |
| | | questbean.parseSolutionAndProcess(list[0].answer) |
| | | questbean.wrong_code = listQuests[list[0].id].wrong_code |
| | | tempQs.add(questbean) |
| | | val a = Utils.getRandomInts(4, list.size) |
| | | for (i in a.indices) { |
| | |
| | | Log.i("AYJiaKao",te.toString()) |
| | | var questbean = QuestionBean(te.id,te.question) |
| | | questbean.parseSolutionAndProcess(te.answer) |
| | | questbean.wrong_code = listQuests[te.id].wrong_code |
| | | tempQs.add(questbean) |
| | | |
| | | } |
| | |
| | | |
| | | var questbean = QuestionBean(list[i].id,list[i].question) |
| | | questbean.parseSolutionAndProcess(list[i].answer) |
| | | questbean.wrong_code = listQuests[i].wrong_code |
| | | tempQs.add(questbean) |
| | | } |
| | | } |
| | |
| | | |
| | | MyLog.i("开始发送灯光,考试项共有"+simulateNightBean.question.size) |
| | | MyLog.i("开始发送灯光,gson="+gson.toJson(simulateNightBean)) |
| | | // AYSdk.getInstance().sendCmd(0x8012, gson.toJson(simulateNightBean)) |
| | | AYSdk.getInstance().sendCmd(0x8012, gson.toJson(simulateNightBean)) |
| | | |
| | | //发送考试状态 |
| | | MyLog.i("查到的考试type=$examType") |