Commit 4be4cd00 by peema_phongam

exam advance english

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