| | |
| | | |
| | | failedProjViewModel = ViewModelProviders.of(this).get(FailedProjViewModel.class); |
| | | |
| | | failedProjViewModel.getFailedProjectsForIII(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; |
| | | 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(),f.getUtc())); |
| | | item_conents.add(f.getItem_content()); |
| | | Collections.sort(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.sort(mArrayList); |
| | | // mScoreAdapter.addDatas(mArrayList); |
| | | // mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | failedProjViewModel.getFailedProjectsForI(Constant.TEST_STU_ID).observe(this, new Observer<List<FailedProj_select>>() { |
| | | failedProjViewModel.getFailedProjects(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; |
| | | 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(),f.getUtc())); |
| | | item_conents.add(f.getItem_content()); |
| | | Collections.sort(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.sort(mArrayList); |
| | | // mScoreAdapter.addDatas(mArrayList); |
| | | // mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | 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(),f.getUtc())); |
| | | item_conents.add(f.getItem_content()); |
| | | Collections.sort(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; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | examStatusViewModel = ViewModelProviders.of(this).get(ExamStatusViewModel.class); |
| | | examStatusViewModel.getExamStatus().observe(this, new Observer<List<ExamStatus>>() { |
| | | @Override |