| | |
| | | failedProjViewModel.getFailedProjectsForIII(Constant.TEST_STU_ID).observe(this, new Observer<List<FailedProj_select>>() { |
| | | @Override |
| | | public void onChanged(List<FailedProj_select> failedProj_selects) { |
| | | MyLog.i("现在是路考状态,监视路考数据失败项目"); |
| | | if (ExamPlatformData.getInstance().getExamType()>ExamPlatformData.EXAM_TYPE_ChangKAO){ |
| | | MyLog.i("现在是路考状态,监视路考数据失败项目"); |
| | | if (failedProj_selects != null && failedProj_selects.size()>0){ |
| | | |
| | | item_id = 0; |
| | | currTotalScore = 100; |
| | | mArrayList.clear(); |
| | | item_conents.clear(); |
| | | for (FailedProj_select f : |
| | | failedProj_selects) { |
| | | item_id += f.getScore_deducting(); |
| | | Log.i(TAG, "onChanged: " + f.toString()); |
| | | mArrayList.add(new ScoreBean(f.getScore_deducting(), f.getItem_content(), f.getDeducting_reason())); |
| | | item_conents.add(f.getItem_content()); |
| | | Collections.reverse(mArrayList); |
| | | mScoreAdapter.addDatas(mArrayList); |
| | | MyLog.i("item_score="+item_id); |
| | | } |
| | | MyLog.i("没扣分之前得分:"+currTotalScore); |
| | | currTotalScore -=item_id; |
| | | MyLog.i("路考当前得分:"+currTotalScore); |
| | | if (currTotalScore < Constant.PASSING_SCORE){ |
| | | MyLog.i("路考低于80,不合格"+currTotalScore); |
| | | // ExamPlatformData.getInstance().getTTS().speak("考试不合格"); |
| | | // stopExam(); |
| | | } |
| | | MyLog.i("路考监测到有失败项目加入,通知UI更新颜色"); |
| | | mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | }else{ |
| | | MyLog.i(TAG,"路考失败项目数据表被清空更新UI"); |
| | | item_id = 0; |
| | | mArrayList.clear(); |
| | | item_conents.clear(); |
| | | Collections.reverse(mArrayList); |
| | | mScoreAdapter.addDatas(mArrayList); |
| | | mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | failedProjViewModel.getFailedProjectsForI(Constant.TEST_STU_ID).observe(this, new Observer<List<FailedProj_select>>() { |
| | | @Override |
| | | public void onChanged(List<FailedProj_select> failedProj_selects) { |
| | | if (ExamPlatformData.getInstance().getExamType()<=ExamPlatformData.EXAM_TYPE_ChangKAO){ |
| | | MyLog.i("现在是场考状态,监视路考数据失败项目"); |
| | | if (failedProj_selects != null && failedProj_selects.size()>0){ |
| | | |
| | | item_id = 0; |
| | |
| | | } |
| | | MyLog.i("没扣分之前得分:"+currTotalScore); |
| | | currTotalScore -=item_id; |
| | | MyLog.i("路考当前得分:"+currTotalScore); |
| | | MyLog.i("当前得分:"+currTotalScore); |
| | | if (currTotalScore < Constant.PASSING_SCORE){ |
| | | MyLog.i("路考低于80,不合格"+currTotalScore); |
| | | ExamPlatformData.getInstance().getTTS().speak("考试不合格"); |
| | | stopExam(); |
| | | MyLog.i("场考低于80,不合格"+currTotalScore); |
| | | // ExamPlatformData.getInstance().getTTS().speak("考试不合格"); |
| | | // stopExam(); |
| | | } |
| | | MyLog.i("路考监测到有失败项目加入,通知UI更新颜色"); |
| | | MyLog.i("场考监测到有失败项目加入,通知UI更新颜色"); |
| | | mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | }else{ |
| | | MyLog.i(TAG,"路考失败项目数据表被清空更新UI"); |
| | | MyLog.i(TAG,"场考失败项目数据表被清空更新UI"); |
| | | item_id = 0; |
| | | mArrayList.clear(); |
| | | item_conents.clear(); |
| | |
| | | mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | failedProjViewModel.getFailedProjectsForI(Constant.TEST_STU_ID).observe(this, new Observer<List<FailedProj_select>>() { |
| | | @Override |
| | | public void onChanged(List<FailedProj_select> failedProj_selects) { |
| | | MyLog.i("现在是场考状态,监视路考数据失败项目"); |
| | | if (failedProj_selects != null && failedProj_selects.size()>0){ |
| | | |
| | | item_id = 0; |
| | | currTotalScore = 100; |
| | | mArrayList.clear(); |
| | | item_conents.clear(); |
| | | for (FailedProj_select f : |
| | | failedProj_selects) { |
| | | item_id += f.getScore_deducting(); |
| | | Log.i(TAG, "onChanged: " + f.toString()); |
| | | mArrayList.add(new ScoreBean(f.getScore_deducting(), f.getItem_content(), f.getDeducting_reason())); |
| | | item_conents.add(f.getItem_content()); |
| | | Collections.reverse(mArrayList); |
| | | mScoreAdapter.addDatas(mArrayList); |
| | | MyLog.i("item_score="+item_id); |
| | | } |
| | | MyLog.i("没扣分之前得分:"+currTotalScore); |
| | | currTotalScore -=item_id; |
| | | MyLog.i("当前得分:"+currTotalScore); |
| | | if (currTotalScore < Constant.PASSING_SCORE){ |
| | | MyLog.i("场考低于80,不合格"+currTotalScore); |
| | | ExamPlatformData.getInstance().getTTS().speak("考试不合格"); |
| | | stopExam(); |
| | | } |
| | | MyLog.i("场考监测到有失败项目加入,通知UI更新颜色"); |
| | | mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | }else{ |
| | | MyLog.i(TAG,"场考失败项目数据表被清空更新UI"); |
| | | item_id = 0; |
| | | mArrayList.clear(); |
| | | item_conents.clear(); |
| | | Collections.reverse(mArrayList); |
| | | mScoreAdapter.addDatas(mArrayList); |
| | | mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | @Override |
| | | public void changKao() { |
| | | exam_type = 2; |
| | | |
| | | ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.EXAMING_MODE); |
| | | iv_head.getDrawable().setLevel(1); |
| | | ExamPlatformData.getInstance().setExamType(exam_type); |
| | | examStatusViewModel.updateStartExam(exam_type); |
| | |
| | | |
| | | @Override |
| | | public void luKao() { |
| | | ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.EXAMING_MODE); |
| | | exam_type = 3; |
| | | ExamPlatformData.getInstance().setExamType(exam_type); |
| | | examStatusViewModel.updateStartExam(exam_type); |
| | |
| | | MyLog.i(TAG,"结束考试"); |
| | | |
| | | sns.clear(); |
| | | |
| | | //设置模式为NONE 0 |
| | | ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.MODE_NONE); |
| | | //恢复初始数据 |
| | | OneTimeWorkRequest examStatusInitWork = OneTimeWorkRequest.from(ExamStatusInitWorker.class); |
| | | WorkManager.getInstance(_mActivity).enqueue(examStatusInitWork); |
| | | item_id = 0; |
| | | currTotalScore = 100; |
| | | failedProjViewModel.deleteAll(); |
| | | |
| | | tv_total_score.setText(String.valueOf(currTotalScore)); |
| | | iv_head.getDrawable().setLevel(0); |
| | | |
| | | |
| | | ExamPlatformData.getInstance().getTTS().speak("结束考试"); |
| | | examStatusViewModel.updateStartExam(Constant.NONE_BEEN_START_EXAM); |
| | | sendExamJson(0,0);//结束考试 exstart=0 |