ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 会诊答卷页面 ![](./img/2019-01-18_175222.png) http://course.wmxuetang.com/index.php?r=croom/assessment/diagnosis&aeid=2459369 ``` /** * 会诊答卷页面 * @author chenzsh 2015/5/21 */ public function actionDiagnosis() { $this->layout = "/layouts/assessment_diagnosis_layout"; $aeid = Yii::app()->request->getParam('aeid') ; //aeid $assignmentItemID = Yii::app()->request->getParam('assignmentItemID') ; $ae = AnswerExam::model()->findByPk($aeid) ; // wkwke.'.tbAnswerExam' $uid = Yii::app()->user->id ; if(!$ae || $ae->fdStatus == 1) ResponseUtils::exception(1,'该试卷不存在或已经完成') ; if($ae->fdUserID != $uid) ResponseUtils::exception(403) ; if(!$_GET['formKetangTagID'] && !$record =AssessmentService::factory()->getAssessmentRecord(array('aeid'=> $aeid ,'with' => 'tag'))) ResponseUtils::exception(1,'该试卷不存在或已经完成') ; if(!V2UserService::factory()->isVip($uid,WK::XUETANG) && $record->fdTypeID > 1) ResponseUtils::exception(1,'您还不是学员,请购买会员加入我们吧') ; if($_GET['formKetangTagID']) $lev1Tag = Tag::model()->findByPk($_GET['formKetangTagID']) ; else $lev1Tag = AssessmentService::factory()->getAssessmentTag($record->fdAssessmentID) ; $spend = $ae->fdUsed * 1000 ; $examID = $ae->fdExamID ; $lev3Tag = $record->tag ?: null ; $schoolType = WeikeService::factory()->getWKInteger(WK::SECTION_ATTR_ID,$lev1Tag->id) ; $subject = WeikeService::factory()->getWKInteger(WK::SUJT_ATTR_ID,$lev1Tag->id) ; $data['assessmentid'] = $record->fdAssessmentID ; $data['recordid'] = $record->id ; $data['type'] = $record->fdTypeID ; $data['eid'] = $ae->fdExamID ; $data['examID'] = $ae->fdExamID ; $data['aeid'] = $aeid; $data['title'] = $lev1Tag->fdName ; $data['tagID'] = $lev1Tag->id ; $data['schoolType'] = Yii::app()->params['SCHOOLTYPE_ARR_NAME'][$schoolType->fdValue] ; $data['subject'] = Yii::app()->params['SUBJECT_ARR'][$subject->fdValue] ; $data['schoolTypeID'] = $schoolType->fdValue ; $data['subjectID'] = $subject->fdValue ; $data['spend'] = $spend ; $data['examTime'] = $ae->_exam->fdSpend ; $data['rate'] = $ae->fdRate ; $data['situation'] = V2AnswerService::factory()->getSituation($aeid,$examID) ; $data['assignmentItemID'] = $assignmentItemID ; if($record->fdTypeID == WK::ASSESSMENT_CURE){ $data['boxData'] = array( 'lev3TagID' => $lev3Tag ? $lev3Tag->id : 0 , 'lev3Title' => $lev3Tag ? $lev3Tag->fdName : '' , 'reviewTagID' => AssessmentService::factory()->getReviewTagID($record->fdAssessmentID) , 'preScoreRate'=> AssessmentService::factory()->getAvgScoreRate($record->fdAssessmentID) , 'targetRate' => AssessmentService::factory()->getTargetRate($record->fdAssessmentID) , 'allSche' => AssessmentService::factory()->countAllSche($record->fdAssessmentID) , 'finishSche' => AssessmentService::factory()->countCureFinishSche($record->fdAssessmentID) , 'finishCount' => AssessmentService::factory()->countAssessmentRecords(array('assessmentID'=>$record->fdAssessmentID,'typeID'=>WK::ASSESSMENT_CURE,'finish'=>true)) , 'isReview' => 0 ) ; $curTagID = $record->fdTagID ; $flag = AssessmentService::factory()->getAssessmentRecord(array( 'assessmentID' => $record->fdAssessmentID , 'typeID' => $record->fdTypeID, 'finish' => true , 'tagID' => $curTagID , 'order' => 'answerExam.fdScoreRate DESC' )) ; if($flag){ $data['boxData']['isReview'] = 1 ; $data['boxData']['curMaxScoreRate'] = $flag->answerExam->fdScoreRate ; } } if($record->fdTypeID == WK::ASSESSMENT_CONSULTATION){ $guideType = WK::CROOM_CONSULTATION_GUIDE ; $view = 'diagnosis_consultation' ; }elseif($record->fdTypeID == WK::ASSESSMENT_CURE){ $guideType = WK::CROOM_CURE_GUIDE ; $view = 'diagnosis_cure' ; }elseif($record->fdTypeID == WK::ASSESSMENT_DETECTION){ $guideType = WK::CROOM_DETECTION_GUIDE ; $view = 'diagnosis_detection' ; } $json = CJSON::encode(array('data'=>$data,'status'=>0,'msg'=>'success')) ; $guide = UserService::factory()->getItemValue(array('userID'=>$uid,'itemID'=>$guideType)) ? 1:0 ; $this->render($view,array( 'data' => $json ,'guide'=>$guide)); } ``` ## 数据表:wkwke.tbTaskSchedule ``` CREATE TABLE `tbTaskSchedule` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fdTagID` int(11) DEFAULT NULL COMMENT '任务系统章节对应的ID,\r\n 对应到tbTag.id', `fdName` varchar(256) DEFAULT NULL COMMENT '章节名称', `fdLevel` int(11) DEFAULT NULL COMMENT '任务系统章节所在层级', `fdLeft` int(11) DEFAULT NULL COMMENT '任务系统节点哈希树left', `fdRight` int(11) DEFAULT NULL COMMENT '任务系统节点哈希树right', `fdLvl` int(11) DEFAULT NULL COMMENT '任务系统节点哈希树所在层级', `fdParentID` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK_Reference_2` (`fdTagID`) ) ENGINE=MyISAM AUTO_INCREMENT=447 DEFAULT CHARSET=utf8; ```