Commit 5121a8ba by peema_phongam

Supervisory Readiness test

parent cefafbc7
......@@ -176,16 +176,29 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog'
$scope.scoreDHASPIT = $scope.question.getDHASPIT(router)
}
//</editor-fold>
//<editor-fold desc="ข้อสอบที่ 2 ความพร้อมหัวหน้างาน Supervisory Readiness test">
$scope.isDHASSupReadTest = $scope.examdata.topic.tha === "ข้อสอบที่ 2 ความพร้อมหัวหน้างาน Supervisory Readiness test" ||
$scope.examdata.topic.eng === "ข้อสอบที่ 2 ความพร้อมหัวหน้างาน Supervisory Readiness test"
$scope.isDHASSupReadTest = $scope.examdata.topic.tha.includes("ความพร้อมหัวหน้างาน") ||
$scope.examdata.topic.eng.includes("ความพร้อมหัวหน้างาน")
if ($scope.isDHASSupReadTest) {
//Set 3
let setThreeScore = 0
$scope.question.question[2].ansgroup.forEach(($item) => {
let sumSentence = 12
$item.ansgroup.sentence.forEach(($sentence) => {
let choiceScore = Math.abs($sentence.value - $sentence.answer) * -1
sumSentence += choiceScore
})
setThreeScore += sumSentence
})
//Set 1 + 2
$scope.question.question.splice(2, 1)
let setOneTwoScore = $scope.question.getRealScore($scope.question.getQuestion())
$scope.DHASSupReadTestGrade = 'Unknown'
let score = $scope.question.getRealScore($scope.question.getQuestion())
let totalScore = (score) ? score : 0
$scope.DHASSupReadTestScore = setThreeScore + setOneTwoScore
let totalScore = ($scope.DHASSupReadTestScore) ? $scope.DHASSupReadTestScore : 0
switch (true) {
case (totalScore >= 0 && totalScore <= 129):
$scope.DHASSupReadTestGrade = 'F'
......@@ -378,6 +391,7 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog'
return listbtn
}
$scope.checkSummaryPassing = function(){
let classname = ''
if ($scope.examdata.evaluate.isevaluate){
......@@ -387,7 +401,6 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog'
classname = 'summary-fail'
}
}
return classname
}
......
......@@ -29,7 +29,7 @@
<div class='md-dialog-content'>
<div class='row'>
<div class='col-xs-12 col-sm-12 col-md-12'>
<md-card ng-hide="isDHASPIT">
<md-card ng-hide="isDHASPIT || isDHASSupReadTest">
<md-card-title>
<md-card-title-text>
<center><h2 class='header'>Summary of Result</h2></center>
......@@ -78,6 +78,48 @@
</md-card-content>
</md-card>
<md-card ng-if="isDHASSupReadTest">
<md-card-title>
<md-card-title-text>
<center><h2 class='header'>Summary of Result</h2></center>
</md-card-title-text>
</md-card-title>
<md-card-content>
<div class='row'>
<div class='col-xs-0 col-sm-3 col-md-3'></div>
<div class='col-xs-12 col-sm-6 col-md-6'>
<h4 class='control-label summary-total'>Max score: 200</h4>
</div>
</div>
<div class='row'>
<div class='col-xs-0 col-sm-3 col-md-3'></div>
<div class='col-xs-12 col-sm-6 col-md-6'>
<h4 class='control-label summary-passing' >Applicant's score: {{ DHASSupReadTestScore }}</h4>
</div>
</div>
<div class='row' ng-if="isDHASSupReadTest">
<div class='col-xs-0 col-sm-3 col-md-3'></div>
<div class='col-xs-12 col-sm-6 col-md-6'>
<h4 class='control-label'>Grade: {{DHASSupReadTestGrade}}</h4>
</div>
</div>
</md-card-content>
</md-card>
<md-card ng-if="isDHASPIT">
<md-card-title>
<md-card-title-text>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment