| | |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.ScheduledExecutorService; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.Constant; |
| | |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor; |
| | | import safeluck.drive.evaluation.util.FileUtil; |
| | | import safeluck.drive.evaluation.util.Utils; |
| | | import safeluck.drive.evaluation.viewmodels.ExitExamViewModel; |
| | | import safeluck.drive.evaluation.widget.StatusDialog; |
| | | |
| | | /**单机训练UI |
| | |
| | | view = inflater.inflate(R.layout.layout_train_fragment, container, false); |
| | | initView(view); |
| | | |
| | | |
| | | |
| | | failedProjViewModel = ViewModelProviders.of(this).get(FailedProjViewModel.class); |
| | | routeLineViewModel = ViewModelProviders.of(this).get(RouteLineViewModel.class); |
| | | routeLineViewModel.getRouteBeans().observe(this, new Observer<List<RouteBean>>() { |
| | |
| | | } |
| | | }); |
| | | |
| | | // 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); |
| | | // } |
| | | // 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>>() { |
| | | // @Override |
| | | // public void onChanged(List<FailedProj_select> failedProj_selects) { |
| | | // if (ExamPlatformData.getInstance().getExamType()<=ExamPlatformData.EXAM_TYPE_ChangKAO){ |
| | | // 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); |
| | | // } |
| | | // 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 (currTotalScore < Constant.PASSING_SCORE){ |
| | | MyLog.i("低于80,不合格"+currTotalScore); |
| | | } |
| | | if (currTotalScore<0){ |
| | | ExamPlatformData.getInstance().setCurTotalScore(0); |
| | | }else{ |
| | | ExamPlatformData.getInstance().setCurTotalScore(currTotalScore); |
| | | } |
| | | MyLog.i("监测到有失败项目加入,通知UI更新颜色"); |
| | | mHandler.obtainMessage(ADD_DATA).sendToTarget(); |
| | | }else{ |