endian11
2021-01-19 d03184f15cd0b8ae073a33f964915b120f2eb7a1
增加wrong_code
4个文件已修改
75 ■■■■ 已修改文件
app/src/main/assets/lightAlldefault.json 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/DB/lightdb/LightQuestion.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/bean/SimulateNightBean.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/util/DataInit.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/assets/lightAlldefault.json
@@ -4,91 +4,108 @@
    "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
  }
]
app/src/main/java/safeluck/drive/evaluation/DB/lightdb/LightQuestion.java
@@ -18,6 +18,8 @@
    private int flag;
    private int wrong_code;
    public int getId() {
        return id;
    }
@@ -34,7 +36,13 @@
        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;
app/src/main/java/safeluck/drive/evaluation/bean/SimulateNightBean.java
@@ -40,7 +40,7 @@
        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;
@@ -66,6 +66,14 @@
        }
        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();
app/src/main/java/safeluck/drive/evaluation/util/DataInit.kt
@@ -81,12 +81,14 @@
    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) {
@@ -94,6 +96,7 @@
            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)
        }
@@ -102,6 +105,7 @@
        var questbean = QuestionBean(list[i].id,list[i].question)
        questbean.parseSolutionAndProcess(list[i].answer)
            questbean.wrong_code = listQuests[i].wrong_code
        tempQs.add(questbean)
    }
    }
@@ -111,7 +115,7 @@
    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")