Commit 4be4cd00 by peema_phongam

exam advance english

parent 4d7fc6ec
...@@ -315,17 +315,17 @@ ...@@ -315,17 +315,17 @@
getMaxScoreType1(data){ getMaxScoreType1(data){
let result = 0 let result = 0
if (data.value != undefined && data.value != '' && data.value != null){ if (data.value != undefined && data.value != '' && data.value != null){
result = parseInt(data.value) result = parseFloat(data.value)
} }
return result return result
} }
getMaxScoreType2(data){ getMaxScoreType2(data){
return parseInt(Math.max.apply(null, data.choice.map((obj) => obj.value))) return parseFloat(Math.max.apply(null, data.choice.map((obj) => obj.value)))
} }
getScoreType1(data){ getScoreType1(data){
let result = 0 let result = 0
if (data.status != undefined && data.status != ''){ if (data.status != undefined && data.status != ''){
result = parseInt(data.status) result = parseFloat(data.status)
} }
return result return result
} }
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
if (this.getMaxScoreType2(data) != 0){ if (this.getMaxScoreType2(data) != 0){
if (objsel !== undefined && objsel.value){ if (objsel !== undefined && objsel.value){
result = parseInt(objsel.value) result = parseFloat(objsel.value)
} }
} }
...@@ -346,7 +346,7 @@ ...@@ -346,7 +346,7 @@
let chkobj = data.choice.find((ch) => ch.isanswer != ch.answer ) let chkobj = data.choice.find((ch) => ch.isanswer != ch.answer )
if (this.getMaxScoreType1(data) != 0 && chkobj === undefined){ if (this.getMaxScoreType1(data) != 0 && chkobj === undefined){
result = parseInt(data.value) result = parseFloat(data.value)
} }
return result return result
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
let chkobj = data.sentence.find((sen) => sen.answer != sen.value) let chkobj = data.sentence.find((sen) => sen.answer != sen.value)
if (this.getMaxScoreType1(data) != 0 && chkobj === undefined){ if (this.getMaxScoreType1(data) != 0 && chkobj === undefined){
result = parseInt(data.value) result = parseFloat(data.value)
} }
return result return result
...@@ -366,7 +366,7 @@ ...@@ -366,7 +366,7 @@
let chkobj = data.left.find((lf) => lf.answer != lf.value) let chkobj = data.left.find((lf) => lf.answer != lf.value)
if (this.getMaxScoreType1(data) != 0 && chkobj === undefined){ if (this.getMaxScoreType1(data) != 0 && chkobj === undefined){
result = parseInt(data.value) result = parseFloat(data.value)
} }
return result return result
......
...@@ -30,48 +30,91 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog' ...@@ -30,48 +30,91 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog'
56- F 56- F
*/ */
if ($scope.isDHASAdvanceEnglish) { if ($scope.isDHASAdvanceEnglish) {
$scope.DHASAdvanceEnglishGrade = 'Unknown' $scope.ABAC = 'N/A'
$scope.UTCC = 'N/A'
let score = $scope.question.getRealScore($scope.question.getQuestion()) let score = $scope.question.getRealScore($scope.question.getQuestion())
let totalScore = (score) ? score : 0 let totalScore = (score) ? score : 0
totalScore = 50
switch (true) { switch (true) {
case (totalScore >= 0 && totalScore <= 56): case (totalScore >= 0 && totalScore <= 44):
$scope.DHASAdvanceEnglishGrade = 'F' $scope.ABAC = 'F'
$scope.UTCC = 'F'
break;
case (totalScore >= 45 && totalScore <= 46):
$scope.ABAC = 'F'
$scope.UTCC = 'D-'
break;
case (totalScore >= 47 && totalScore <= 48):
$scope.ABAC = 'F'
$scope.UTCC = 'D'
break;
case (totalScore === 49):
$scope.ABAC = 'F'
$scope.UTCC = 'D'
break;
case (totalScore >= 50 && totalScore <= 51):
$scope.ABAC = 'F'
$scope.UTCC = 'C-'
break;
case (totalScore >= 52 && totalScore <= 54):
$scope.ABAC = 'F'
$scope.UTCC = 'C'
break;
case (totalScore >= 55 && totalScore <= 56):
$scope.ABAC = 'F'
$scope.UTCC = 'C+'
break; break;
case (totalScore === 57): case (totalScore === 57):
$scope.DHASAdvanceEnglishGrade = 'D-' $scope.ABAC = 'D-'
$scope.UTCC = 'B-'
break;
case (totalScore === 58):
$scope.ABAC = 'D'
$scope.UTCC = 'B-'
break; break;
case (totalScore >= 58 && totalScore <= 59): case (totalScore === 59):
$scope.DHASAdvanceEnglishGrade = 'D' $scope.ABAC = 'D'
$scope.UTCC = 'B'
break; break;
case (totalScore === 60): case (totalScore === 60):
$scope.DHASAdvanceEnglishGrade = 'D+' $scope.ABAC = 'D+'
$scope.UTCC = 'B'
break; break;
case (totalScore === 61): case (totalScore === 61):
$scope.DHASAdvanceEnglishGrade = 'C-' $scope.ABAC = 'C-'
$scope.UTCC = 'B+'
break; break;
case (totalScore >= 62 && totalScore <= 63): case (totalScore >= 62 && totalScore <= 63):
$scope.DHASAdvanceEnglishGrade = 'C' $scope.ABAC = 'C'
$scope.UTCC = 'A-'
break; break;
case (totalScore >= 64 && totalScore <= 65): case (totalScore >= 64 && totalScore <= 65):
$scope.DHASAdvanceEnglishGrade = 'C+' $scope.ABAC = 'C+'
$scope.UTCC = 'A'
break; break;
case (totalScore === 66): case (totalScore === 66):
$scope.DHASAdvanceEnglishGrade = 'B-' $scope.ABAC = 'B-'
$scope.UTCC = 'A'
break; break;
case (totalScore >= 67 && totalScore <= 68): case (totalScore >= 67 && totalScore <= 68):
$scope.DHASAdvanceEnglishGrade = 'B' $scope.ABAC = 'B'
$scope.UTCC = 'A+'
break; break;
case (totalScore >= 69 && totalScore <= 70): case (totalScore >= 69 && totalScore <= 70):
$scope.DHASAdvanceEnglishGrade = 'B+' $scope.ABAC = 'B+'
$scope.UTCC = 'A+'
break; break;
case (totalScore >= 71 && totalScore <= 72): case (totalScore >= 71 && totalScore <= 72):
$scope.DHASAdvanceEnglishGrade = 'A-' $scope.ABAC = 'A-'
$scope.UTCC = 'A+'
break; break;
case (totalScore >= 73 && totalScore <= 75): case (totalScore >= 73 && totalScore <= 75):
$scope.DHASAdvanceEnglishGrade = 'A' $scope.ABAC = 'A'
$scope.UTCC = 'A+'
break; break;
case (totalScore >= 76): case (totalScore >= 76):
$scope.DHASAdvanceEnglishGrade = 'A+' $scope.ABAC = 'A+'
$scope.UTCC = 'A+'
break; break;
} }
} }
...@@ -132,7 +175,6 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog' ...@@ -132,7 +175,6 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog'
$scope.examdata.topic.eng === "แบบสำรวจบุคลิกภาพ Personality Inventory test" $scope.examdata.topic.eng === "แบบสำรวจบุคลิกภาพ Personality Inventory test"
if($scope.isDHASPIT) { if($scope.isDHASPIT) {
$scope.scoreDHASPIT = $scope.question.getDHASPIT(router) $scope.scoreDHASPIT = $scope.question.getDHASPIT(router)
console.log($scope.scoreDHASPIT)
} }
//</editor-fold> //</editor-fold>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<div class='row' ng-if="isDHASAdvanceEnglish"> <div class='row' ng-if="isDHASAdvanceEnglish">
<div class='col-xs-0 col-sm-3 col-md-3'></div> <div class='col-xs-0 col-sm-3 col-md-3'></div>
<div class='col-xs-12 col-sm-6 col-md-6'> <div class='col-xs-12 col-sm-6 col-md-6'>
<h4 class='control-label'>Grade: {{DHASAdvanceEnglishGrade}}</h4> <h4 class='control-label'>Grade: {{UTCC}} (UTCC Norm), {{ABAC}} (ABAC Norm)</h4>
</div> </div>
</div> </div>
<div class='row' ng-if="isDHASAbstractReasoning"> <div class='row' ng-if="isDHASAbstractReasoning">
......
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