endian11
2021-01-19 d03184f15cd0b8ae073a33f964915b120f2eb7a1
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")