123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906 |
- app.controller('LoginCtrl', [ '$rootScope', '$scope', '$http', '$location', '$q', '$timeout', '$sce', function($rootScope, $scope, $http, $location, $q, $timeout, $sce) {
- $scope.currStep = 'LoginName';
- $scope.clientMac = '';
- // $scope.launchFullscreen = function(element) {
- // if (document.documentElement.requestFullscreen) {
- // document.documentElement.requestFullscreen();
- // } else if (document.documentElement.mozRequestFullScreen) {
- // document.documentElement.mozRequestFullScreen();
- // } else if (document.documentElement.webkitRequestFullscreen) {
- // document.documentElement.webkitRequestFullscreen();
- // } else if (document.documentElement.msRequestFullscreen) {
- // document.documentElement.msRequestFullscreen();
- // }
- // }
- $scope.isWillCheckPhoneCode = false;
- $scope.checkCodeForm = {
- phone_code : ""
- }
- $scope.sendPhoneCodeSuccess = "";
- $scope.aliPlayer = null;
- $scope.changeLogin = function($event) {
- if ($event.target.value == '' || $event.target.value.length < 3)
- return;
- if ($event.keyCode == 13) {
- $('#login_pass').focus();
- }
- }
-
- $scope.changeLoginName = function($event) {
- if ($event.target.value == '' || $event.target.value.length < 3)
- return;
- if ($event.keyCode == 13) {
- $scope.queryJudge($.trim($event.target.value));
- }
- }
- $scope.showLoginName = function() {
- $scope.group = undefined;
- $scope.room = undefined;
- $scope.judge = undefined;
- $scope.currStep = 'LoginName';
- $timeout(function() {
- $('#login_name').focus();
- }, 100);
- }
- $scope.queryJudge = function(login_name) {
- var login_pass = document.getElementById('login_pass');
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/info/loginname.htm',
- data : {
- login_name : document.getElementById('login_name').value,
- login_pass : (login_pass== undefined || login_pass == '') ? '': login_pass.value
- }
- }, function(response) {
- $scope.group = response.map.Room.group;
- $scope.room = response.map.Room;
- $scope.judge = response.map.Judge;
- $scope.disArr = response.map.discipline;
- // 单独评分 手机短信验证
- $scope.isWillCheckPhoneCode = (($scope.ParamMap['ExamJudgeGradeType'] !== undefined && $scope.ParamMap['ExamJudgeGradeType'].param_value == 'Judge') ? true : false);
- if (!$scope.isWillCheckPhoneCode)
- $scope.currStep = 'ConfrimJudge';
- })
- }
- $scope.sendPhoneCode = function() {
- $rootScope.ajaxRequest({
- url : '../exam/judge/sendPhoneCode.htm',
- data : {
- judge_id : $scope.judge.judge_id
- }
- }, function(response) {
- if (response.success) {
- $rootScope.sendPhoneCodeSuccess = true;
- $scope.codeCountDown = 30;
- $scope.countDownFn();
- $scope.checkPhoneCodeSucMsg = "短信验证码发送成功,30秒后未收到可重新发送!";
- } else {
- $scope.checkPhoneCodeErrMsg = response.errorMsg;
- }
- })
- }
- $scope.checkPhoneCode = function() {
- if ($scope.checkCodeForm.phone_code.length == 0) {
- alert('请输入手机验证码!');
- return;
- }
- $rootScope.ajaxRequest({
- url : '../exam/judge/checkPhoneCode.htm',// TODO
- data : {
- phone_code : $scope.checkCodeForm.phone_code
- }
- }, function(response) {
- if (response.success) {
- $scope.isWillCheckPhoneCode = false;
- $scope.currStep = 'ConfrimJudge';
- }
- })
- }
- $scope.countDownFn = function() {
- $timeout(function() {
- console.log($rootScope.codeCountDown);
- $scope.codeCountDown--;
- if ($scope.codeCountDown > 0) {
- $scope.countDownFn();
- }
- }, 1000);
- }
- $scope.showVideo = function(){
- var v = $('#video-player');
- v.html('');
- v.css("background-color","");
-
- $scope.aliPlayer = new Aliplayer({
- "id": "video-player",
- "source": $scope.currentStd.material_file,
- "width": "930px",
- "height": "600px",
- "autoplay": false,
- "isLive": false,
- "rePlay": false,
- "playsinline": true,
- "preload": true,
- "controlBarVisibility": "hover",
- "useH5Prism": true
- }, function (player) {
- /*
- player.on('autoplay',function(data){
- // 浏览器支持自动播放
- if(!data.paramData){
- // 自动播放
- player.play();
- }else{
- // 提示用户点击播放
- }
-
- })
- */
-
- }
- );
- }
-
- $scope.closeVideo = function(){
- $scope.aliPlayer.dispose();
- }
- $scope.changeVideoSource = function(std) {
- $scope.aliPlayer.loadByUrl(std.material_file);
- }
- $scope.showGroup = function() {
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/group/list.htm',
- data : {
- exam_date : '2020-02-12'
- }
- }, function(response) {
- $scope.groupArray = response.array;
- $scope.currStep = 'ChooseGroup';
- })
- }
- $scope.chooseGroup = function(group) {
- $scope.group = group;
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/room/list.htm',
- data : {
- exam_date : '2020-02-12',
- ly_group_id : group.ly_group_id
- }
- }, function(response) {
- $scope.roomArray = response.array;
- $scope.currStep = 'ChooseRoom';
- })
- }
- $scope.chooseRoom = function(room) {
- $scope.room = room;
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/judge/list.htm',
- data : {
- ly_room_id : room.ly_room_id
- }
- }, function(response) {
- $scope.judgeArray = response.array;
- $scope.currStep = 'ChooseJudge';
- })
- }
- $scope.chooseJudge = function(judge) {
- $scope.judge = judge;
- $scope.currStep = 'ConfrimJudge';
- }
- $scope.judgeLogin = function() {
- // 生成mac
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/login.htm',
- data : {
- ly_room_id : $scope.room.ly_room_id,
- judge_id : $scope.judge.judge_id,
- login_name : $scope.judge.login_name,
- client_mac : ($scope.judge.room_id + '_' + $scope.judge.judge_seq + "_" + $scope.judge.room_id + "_" + $scope.clientMac)
- }
- }, function(response) {
- $scope.ExamParamMap = response.map;
- var key = "";
- angular.forEach(response.map.Judge.des_type, function(k) {
- if (k == '1')
- key += response.map.Judge.judge_id;
- else if (k == '2')
- key += response.map.Judge.judge_seq;
- else if (k == '3')
- key += response.map.Judge.login_name;
- else if (k == '4')
- key += $scope.room.ly_room_id;
- else if (k == '5')
- key += $scope.room.room_key;
- else if (k == '6')
- key += $scope.room.ly_group_id;
- else if (k == '7')
- key += $scope.room.ly_agent_id;
- });
- // 444111
- if (key.length < 16) {
- var len = 16 - key.length;
- for (var i = 0; i < len; i++)
- key = "0" + key;
- }
- key = key.substring(0, 16);
- response.map.Judge.des_key = key;
- response.map.Judge.real_exam_seq = 0;
- $scope.judge = response.map.Judge;
- $scope.StdArray = [];
- $scope.nextExamSeq();
- $scope.currStep = 'Examing';
- $scope.scoreStdTotal = 0;
- })
- }
- /***************************************************************************
- * 评分相关函数
- */
- $scope.getParamValue = function(param_name, default_value) {
- if ($scope.ParamMap == undefined)
- return undefined;
- if ($scope.ParamMap[param_name] == undefined)
- return default_value;
- return $scope.ParamMap[param_name].param_value;
- }
- /***************************************************************************
- * 查找下一个考生
- */
- $scope.nextExamSeq = function() {
- if ($scope.judge == undefined)
- return;
- if ($scope.group.judge_cache_num <= $scope.StdArray.length) {
- // 超出等待限制
- $timeout($scope.nextExamSeq, parseInt($scope.getParamValue('NextExamSeqTicketSeconds', '5000'), 10));
- return;
- }
- $scope.last_next_time = new Date();
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/std/next.htm',
- data : $scope.judge,
- error : function() {
- // 网络错误等情况,要考虑延迟的问题
- $timeout($scope.nextExamSeq, parseInt($scope.getParamValue('NextExamSeqTicketSeconds', '5000'), 10));
- }
- }, function(data) {
- $scope.lastRequestTime = data.map.QueryNextTime;
- $scope.jsonValue = angular.toJson(data);
- var std = data.map.ExamStd;
- if (data.map.ExVideo && data.map.ExVideo['video_file'])
- std['material_file'] = data.map.ExVideo['video_file'];
- if (data.map.RealExamSeq) {
- $scope.judge.real_exam_seq = data.map.RealExamSeq;
- }
- if (std && std.std_id) {
- // 是否是新考生
- var flag = true;
- for (var k = 0; k < $scope.StdArray.length; k++) {
- if ($scope.StdArray[k].std_id - std.std_id == 0) {
- flag = false;
- return;
- }
- }
- if (flag) {
- std.SubjectArray = data.map.SubjectArray;
- var avoid = false;
- angular.forEach(std.SubjectArray, function(sb) {
- if (sb.judge_avoid == 'Active') {
- avoid = true;
- } else {
- if (sb.judge_record_score != undefined && sb.judge_record_score != sb.judge_score) {
- sb.judge_score = sb.judge_record_score;
- }
- }
- });
- // 该考生被回避
- if (avoid) {
- angular.forEach(std.SubjectArray, function(sb) {
- sb.judge_avoid = 'Active';
- sb.judge_score = undefined;
- sb.judge_record_score = undefined;
- });
- std.avoid_flag = 'Active';
- } else {
- std.avoid_flag = undefined;
- }
- std.tracksArray = data.map.TracksArry;
- $scope.StdArray.push(std);
- // 如果当前考生不为空,判断是否焦点要自动下移
- if ($scope.currentStd != undefined) {
- // 判断是否给过分
- var score_flag = true;
- angular.forEach($scope.currentStd.SubjectArray, function(sb) {
- if (sb.judge_score == undefined && sb.judge_avoid != 'Active') {
- score_flag = false;
- }
- });
- if (score_flag) {
- // 所有科目已经给过分,光标下移
- //$scope.chooseStd(std);
- }
- } else {
- $scope.chooseStd(std);
- }
- $scope.checkGradeTotol();
- }
- $scope.judge.real_exam_seq = std.real_exam_seq;
- // 有新考生,1秒轮询
- $timeout($scope.nextExamSeq, 1000);
- } else {
- // 没有新考生,按照规定的时间去轮询
- $timeout($scope.nextExamSeq, parseInt($scope.getParamValue('NextExamSeqTicketSeconds', '5000'), 10));
- }
- });
- }
- /***************************************************************************
- * 选择某个考生
- */
- $scope.chooseStd = function(std) {
- var avoid = false;
- $scope.disciplineFlag = 'InActive';
- angular.forEach(std.SubjectArray, function(sb) {
- if (sb.judge_avoid == 'Active') {
- avoid = true;
- } else {
- // if (sb.judge_record_score != undefined &&
- // sb.judge_record_score !=
- // sb.judge_score) {
- // sb.judge_score = sb.judge_record_score;
- // }
- }
- });
- // 该考生被回避
- if (avoid) {
- angular.forEach(std.SubjectArray, function(sb) {
- sb.judge_avoid = 'Active';
- sb.judge_score = undefined;
- sb.judge_record_score = undefined;
- });
- std.avoid_flag = 'Active';
- } else {
- std.avoid_flag = undefined;
- }
- $scope.currentStd = std;
- // 首次自动加载初始化视频
- if ($scope.currentStd && $scope.getParamValue('JudgeVideoScore', 'InActive') == 'Active'
- && $scope.currentStd.separate_score == 'Active') {
- setTimeout(function() {
- var v = document.getElementById('video-player');
- if (v) {
- $scope.showVideo();
- $scope.first_load = false;
- }
- }, 2000);
- }
- if (std.SubjectArray.length == 1) {
- $scope.chooseSubject(std.SubjectArray[0]);
- } else {
- $scope.scoreStep = 'subjectPanel';
- }
- }
- /***************************************************************************
- * 点击列表选择某个考生
- */
- $scope.clickChooseStd = function(std) {
- $scope.disciplineFlag = 'InActive';
- var avoid = false;
- angular.forEach(std.SubjectArray, function(sb) {
- if (sb.judge_avoid == 'Active') {
- avoid = true;
- } else {
- // if (sb.judge_record_score != undefined &&
- // sb.judge_record_score !=
- // sb.judge_score) {
- // sb.judge_score = sb.judge_record_score;
- // }
- }
- });
- // 该考生被回避
- if (avoid) {
- angular.forEach(std.SubjectArray, function(sb) {
- sb.judge_avoid = 'Active';
- sb.judge_score = undefined;
- sb.judge_record_score = undefined;
- });
- std.avoid_flag = 'Active';
- } else {
- std.avoid_flag = undefined;
- }
- $scope.currentStd = std;
- //开启评委视频评分
- if($scope.getParamValue('JudgeVideoScore', 'InActive') == 'Active' && $scope.currentStd.separate_score == 'Active') {
- $scope.changeVideoSource(std);
- }
- if (std.SubjectArray.length == 1) {
- $scope.chooseSubject(std.SubjectArray[0]);
- } else {
- $scope.scoreStep = 'subjectPanel';
- }
- }
- /***************************************************************************
- * 选择评分科目(多科目情况下)
- */
- $scope.chooseSubject = function(sb) {
- $scope.disciplineFlag = 'InActive';
- if ($scope.currentStd.avoid_flag == 'Active')
- return;
- $scope.currentSubject = sb;
- for (var i = 0; i < $scope.ExamParamMap['SubjectScore_' + sb.subject_id].length; i++) {
- var score = $scope.ExamParamMap['SubjectScore_' + sb.subject_id][i];
- if (score.master_flag == 'Active') {
- $scope.chooseScore(score)
- break;
- }
- }
- $scope.scoreStep = 'scorePanel';
- }
- /***************************************************************************
- * 选择评分区间
- */
- $scope.chooseScore = function(score) {
- var array = new Array();
- for (var value = score.score_max; value >= score.score_min; value = value - (score.score_tick)) {
- var score_value = value;
- if (value < score.score_min)
- score_value = score.score_min;
- array.push({
- score_value : score_value
- });
- }
- $scope.currentScore = score;
- $scope.scoreArray = array;
- }
- /***************************************************************************
- * 对某个科目进行评分(未提交)
- */
- $scope.gradeScore = function(score_value) {
- $scope.disciplineFlag = "InActive";
- var obj = angular.extend({}, $scope.judge, {
- judge_score : score_value,
- std_subject_id : $scope.currentSubject.std_subject_id,
- discipline_id: $scope.currentSubject.discipline_id
- });
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/std/record.htm',
- data : obj
- }, function(response) {
- $scope.currentSubject.judge_score = score_value;
- $scope.checkGradeTotol();
- if ($scope.currentStd.SubjectArray.length > 1) {
- $scope.scoreStep = 'subjectPanel';
- }
- })
- }
- /***************************************************************************
- * 回避或者取消回避
- */
- $scope.avoidStd = function() {
- var obj = angular.extend({}, $scope.judge, {
- judge_avoid : $scope.currentStd.avoid_flag == 'Active' ? 'InActive' : 'Active',
- std_subject_id : $scope.currentStd.SubjectArray[0].std_subject_id
- });
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/std/avoid.htm',
- data : obj
- }, function(response) {
- $scope.currentStd.avoid_flag = ($scope.currentStd.avoid_flag == 'Active' ? undefined : 'Active');
- angular.forEach($scope.currentStd.SubjectArray, function(sb) {
- sb.judge_score = undefined;
- sb.judge_record_score = undefined;
- sb.judge_avoid = $scope.currentStd.avoid_flag;
- });
- $scope.checkGradeTotol();
- })
- }
- /***************************************************************************
- * 判断已经评分的数量
- */
- $scope.checkGradeTotol = function() {
- var total = 0;
- angular.forEach($scope.StdArray, function(std) {
- var flag = true;
- angular.forEach(std.SubjectArray, function(sb) {
- if (sb.judge_avoid != 'Active' && sb.judge_score == undefined)
- flag = false;
- });
- if (flag) {
- std.score_flag = true;
- total++;
- } else {
- std.score_flag = false;
- }
- });
- $scope.scoreStdTotal = total;
- }
- /***************************************************************************
- * 提交前确认
- */
- $scope.confirmScore = function() {
- var flag = new Array();
- for (var i = 0; i < $scope.StdArray.length; i++) {
- flag.push($scope.StdArray[i].score_flag);
- }
- var truePosition = flag.lastIndexOf(true);
- var falsePosition = flag.indexOf(false);
- if (truePosition > falsePosition && falsePosition != -1) {
- alert('前面的考生未打分,请打分后在提交分数!');
- $scope.clickChooseStd($scope.StdArray[falsePosition]);
- return;
- }
- var array = new Array();
- for (var i = 0; i < $scope.StdArray.length; i++) {
- if ($scope.StdArray[i].score_flag == true) {
- var confirm_score_value = "";
- for (var k = 0; k < $scope.StdArray[i].SubjectArray.length; k++) {
- var subject = $scope.StdArray[i].SubjectArray[k];
- confirm_score_value = confirm_score_value + (k > 0 ? "、" : "") + subject.subject_name + "【" + (subject.judge_avoid == 'Active' ? "回避" : subject.judge_score) + "】";
- }
- $scope.StdArray[i].confirm_score_value = confirm_score_value;
- array.push($scope.StdArray[i]);
- } else {
- break;
- }
- }
- if (array.length == 0)
- return;
- $scope.confirmStdArray = array;
- if ($scope.getParamValue('ShowJudgeSign', 'InActive') == 'Active') {
- $scope.setStdNumber(array);
- }
- $scope.currStep = 'ConfirmScore';
- }
- /***************************************************************************
- * 查看分数
- */
- $scope.lookScore = function() {
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/judge/lookScore.htm',
- data : {
- room_id : $scope.room.ly_room_id,
- judge_id : $scope.judge.judge_id
- }
- }, function(response) {
- $scope.stdScoreArray = response.array;
- });
- $scope.currStep = 'LookScore';
- }
- // 选中上一个考生
- $scope.chooseLastStd = function() {
- $scope.disciplineFlag = 'InActive';
- // 当前选中考生
- var curStd = $scope.currentStd;
- if (!curStd)
- return;
- for (var k = 0; k < $scope.StdArray.length; k++) {
- var std = $scope.StdArray[k];
- if (std.std_id === curStd.std_id) {
- if (k > 0) {
- $scope.currentStd = $scope.StdArray[k - 1];
- if($scope.getParamValue('JudgeVideoScore', 'InActive') == 'Active' && $scope.currentStd.separate_score == 'Active') {
- $scope.changeVideoSource($scope.currentStd);
- }
- $scope.clickChooseStd($scope.currentStd);
- break;
- } else {
- alert('已经是第一个考生!')
- }
- }
- }
- }
- // 选中下一个考生
- $scope.chooseNextStd = function() {
- $scope.disciplineFlag = 'InActive';
- // 当前选中考生
- var curStd = $scope.currentStd;
- if (!curStd)
- return;
- for (var k = 0; k < $scope.StdArray.length; k++) {
- var std = $scope.StdArray[k];
- if (std.std_id === curStd.std_id) {
- if ((k + 1) < $scope.StdArray.length) {
- $scope.currentStd = $scope.StdArray[k + 1];
- if($scope.getParamValue('JudgeVideoScore', 'InActive') == 'Active' && $scope.currentStd.separate_score == 'Active') {
- $scope.changeVideoSource($scope.currentStd);
- }
- $scope.clickChooseStd($scope.currentStd);
- break;
- } else {
- // 无下一个考生 提示 TODO
- alert('已经是最后一个考生!')
- }
- }
- }
- }
- // aes加密
- $scope.aesValue = function(value) {
- var key = CryptoJS.enc.Utf8.parse($scope.judge.des_key);
- var str = CryptoJS.enc.Utf8.parse(value);
- var base64 = CryptoJS.enc.Base64.stringify(str);
- var encrypted = CryptoJS.AES.encrypt(str, key, {
- mode : CryptoJS.mode.ECB,
- padding : CryptoJS.pad.Pkcs7
- });
- return encrypted.toString();
- }
- /***************************************************************************
- * 提交分数
- */
- $scope.submitScore = function() {
- // && !$("#signature")[0].contentWindow.flag
- if ($scope.getParamValue('ShowJudgeSign', 'InActive') == 'Active' && $("#signature")[0].contentWindow.document.getElementById('saveBtn').disabled) {
- alert('提交分数前,请先保存签名!');
- return;
- }
- if ($scope.getParamValue('ShowJudgeSign', 'InActive') == 'Active') {
- $("#signature")[0].contentWindow.saveSignature();
- }
- var std = undefined;
- $scope.commitScoreFlag = true;
- for (var i = 0; i < $scope.confirmStdArray.length; i++) {
- if ($scope.confirmStdArray[i].commit_flag != true) {
- std = $scope.confirmStdArray[i];
- break;
- }
- }
- if (std == undefined) {
- $scope.commitScoreFlag = undefined;
- $scope.currentSubject = undefined;
- $scope.currentScore = undefined;
- $scope.currentStd = undefined;
- // 已经完成评分
- $scope.confirmStdArray = [];
- $scope.currStep = 'Examing';
- if ($scope.StdArray.length > 0) {
- $scope.chooseStd($scope.StdArray[0]);
- }
- return;
- }
- if ($scope.requestingStdId == undefined) {
- $scope.requestingStdId = std.std_id;
- $scope.submitStdScore(std);
- }
- // 1秒钟等待
- $timeout($scope.submitScore, 1000);
- }
- /***************************************************************************
- * 提交分数,单个考生
- */
- $scope.submitStdScore = function(std) {
- angular.forEach(std.SubjectArray, function(sb) {
- sb.room_id = $scope.room.ly_room_id;
- sb.agent_id = $scope.judge.agent_id;
- sb.judge_id = $scope.judge.judge_id;
- sb.judge_seq = $scope.judge.judge_seq;
- sb.real_exam_seq = std.real_exam_seq;
- if (sb.judge_avoid == 'Active')
- std.judge_avoid = 'Active';
- });
- var data = angular.extend({}, $scope.judge, {
- score_json : $scope.aesValue(angular.toJson(std.SubjectArray)),
- std_id : std.std_id,
- real_exam_seq : std.real_exam_seq,
- judge_avoid : std.judge_avoid,
- remark : std.remark,
- discipline_id: std.discipline_id
- });
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/std/score.htm',
- data : data,
- error : function() {
- // $scope.submitStdScore(std);
- // 出现评分分差,跳转到打分界面
- $scope.confirmStdArray = [];
- $scope.requestingStdId = undefined;
- }
- }, function(response) {
- std.commit_flag = true;
- $scope.scoreStdTotal = $scope.scoreStdTotal - 1;
- // 移除队列
- for (var i = 0; i < $scope.StdArray.length; i++) {
- if ($scope.StdArray[i].std_id == std.std_id) {
- $scope.StdArray.splice(i, 1);
- break;
- }
- }
- $scope.requestingStdId = undefined;
- })
- }
- $scope.cancelConfirm = function() {
- $scope.currStep = 'Examing';
- //是否开启视频评分
- if($scope.getParamValue('JudgeVideoScore', 'InActive') == 'Active' && $scope.currentStd.separate_score == 'Active') {
- setTimeout(function() {
- var v = document.getElementById('video-player');
- if (v) {
- $scope.showVideo();
- $scope.first_load = false;
- }
-
- }, 1000);
- }
- }
- $scope.showJudge = function() {
- $scope.modifyJudge = angular.extend({}, $scope.judge, {});
- // 显示评分版
- $('#judgeModal').modal('show')
- }
- $scope.changeJudge = function() {
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/judge/modify.htm',
- data : $scope.modifyJudge
- }, function(response) {
- $scope.judge = response.entity;
- // todo 更优雅的提醒方式
- alert('评委信息已修改!')
- })
- }
- $scope.exitJudge = function() {
- $scope.judge = undefined;
- $scope.currentSubject = undefined;
- $scope.currentScore = undefined;
- $scope.currentStd = undefined;
- $scope.scoreStdTotal = 0;
- $scope.StdArray = [];
- $scope.confirmStdArray = undefined;
- $scope.requestingStdId == undefined;
- if ($scope.groupArray != undefined) {
- $scope.chooseRoom($scope.room);
- } else {
- $scope.currStep = 'LoginName';
- }
- }
- $scope.getBatchName = function(tracks) {
- var current_batch = 1;
- angular.forEach($scope.currentStd.tracksArray, function(t) {
- if (t.tracks_batch > current_batch)
- current_batch = t.tracks_batch;
- });
- if (current_batch == 1) {
- return '';
- }
- if (tracks.tracks_batch == 2)
- return '复试:'
- return '三试:'
- }
- $scope.getTracksClass = function(tracks) {
- var current_batch = 1;
- angular.forEach($scope.currentStd.tracksArray, function(t) {
- if (t.tracks_batch > current_batch)
- current_batch = t.tracks_batch;
- });
- if (current_batch == tracks.tracks_batch) {
- return 'text-success';
- }
- return '';
- }
- $scope.login = function() {
- var login_name = document.getElementById('login_name').value;
- if (!login_name) {
- alert('请输入评委登录账号!');
- return;
- }
- $scope.queryJudge($.trim(login_name));
- //$scope.launchFullscreen();
- }
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/param.htm'
- }, function(response) {
- var map = {};
- for (var i = 0; i < response.array.length; i++) {
- map[response.array[i].param_name] = response.array[i];
- }
- $scope.ParamMap = map;
- if ($scope.getParamValue('JudgeLoginType', 'LoginName') == 'ChooseGroup') {
- $scope.showGroup();
- }
- });
- /***************************************************************************
- * 获取客户端的MAC地址
- */
- $rootScope.ajaxRequest({
- url : '../exam/judge/grade/judge/getMac.htm'
- }, function(response) {
- if (response) {
- $scope.clientMac = response.entity;
- }
- });
- /***************************************************************************
- * 获取提交考生的起止序号
- */
- $scope.setStdNumber = function(array) {
- $scope.numberBetween = "";
- for (var i = 0; i < array.length; i++) {
- if (i == 0) {
- $scope.numberBetween += array[i].real_exam_echo;
- }
- if (i == array.length - 1) {
- $scope.numberBetween += "~" + array[i].real_exam_echo;
- }
- }
- }
- // 清除签名
- $scope.clearCanvas = function() {
- $("#signature")[0].contentWindow.clearCanvas();
- }
- // 保存签名
- $scope.saveSignature = function() {
- if ($("#signature")[0].contentWindow.document.getElementById('saveBtn').disabled) {
- alert('保存签名前,请先签名!');
- return;
- }
- $("#signature")[0].contentWindow.saveSignature();
- }
-
- //标记违纪
- $scope.stdDiscipline = function() {
- $scope.disciplineFlag = 'Active';
- }
- $timeout(function() {
- $('#login_name').focus();
- // $scope.launchFullscreen();
- }, 100);
- } ]);
|