lizhanwei
2020-01-15 18ffd0ba7e9387b01d2420770d2bb6672a58eac4
app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java
@@ -133,6 +133,7 @@
                    currTotalScore -=item_id;
                    if (currTotalScore < Constant.PASSING_SCORE){
                        MyLog.i(TAG,"低于80,不合格");
                        stopExam();
                    }
                    MyLog.i(TAG,"监测到有失败项目加入,通知UI更新颜色");
@@ -289,17 +290,7 @@
                break;
            case R.id.tv_stop:
                Toast.makeText(_mActivity, "结束考试", Toast.LENGTH_SHORT).show();
                OneTimeWorkRequest examStatusInitWork = OneTimeWorkRequest.from(ExamStatusInitWorker.class);
                WorkManager.getInstance(_mActivity).enqueue(examStatusInitWork);
                try {
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("exam", 0);
                    String examJson = jsonObject.toString();
                    Log.i(TAG, "onClick: " + examJson);
                    AYSdk.getInstance().sendCmd(Constant.EXAM_STATUS, examJson);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                stopExam();
                break;
            case R.id.btn_return:
                _mActivity.onBackPressed();
@@ -307,6 +298,20 @@
        }
    }
    private void stopExam() {
        OneTimeWorkRequest examStatusInitWork = OneTimeWorkRequest.from(ExamStatusInitWorker.class);
        WorkManager.getInstance(_mActivity).enqueue(examStatusInitWork);
        try {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("exam", 0);
            String examJson = jsonObject.toString();
            Log.i(TAG, "onClick: " + examJson);
            AYSdk.getInstance().sendCmd(Constant.EXAM_STATUS, examJson);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
    private ICEventListener icEventListener = new ICEventListener() {
        @Override
        public void onCEvent(String topic, int msgCode, int resultCode, Object obj) {