Commit d03b679c by peema_phongam

single choice float score

parent 4be4cd00
...@@ -517,7 +517,7 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog' ...@@ -517,7 +517,7 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog'
templateUrl: '../JS/AngularTools/JobRouter/exam/preview.singlechoice.html', templateUrl: '../JS/AngularTools/JobRouter/exam/preview.singlechoice.html',
link: function($scope, element, attr){ link: function($scope, element, attr){
$scope.getMaxScore = function(){ $scope.getMaxScore = function(){
return parseInt(Math.max.apply(null, $scope.obj.choice.map(ch => ch.value))) return parseFloat(Math.max.apply(null, $scope.obj.choice.map(ch => ch.value)))
} }
$scope.getScore = function(){ $scope.getScore = function(){
...@@ -526,7 +526,7 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog' ...@@ -526,7 +526,7 @@ angular.module('myHR').controller('PreviewExam', ['$scope', '$http', '$mdDialog'
if ($scope.getMaxScore() != 0){ if ($scope.getMaxScore() != 0){
if (objselect != undefined && (objselect.value != '' && objselect.value != null)){ if (objselect != undefined && (objselect.value != '' && objselect.value != null)){
result = parseInt(objselect.value) result = parseFloat(objselect.value)
} }
} }
......
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
<div class='row'> <div class='row'>
<div class='col-xs-1 col-sm-1 col-md-1'></div> <div class='col-xs-1 col-sm-1 col-md-1'></div>
<div class='col-xs-10 col-sm-10 col-md-10'> <div class='col-xs-10 col-sm-10 col-md-10'>
<label class='score-show'>Score: {{ getScore() }} / {{ getMaxScore() }}</div> <label class='score-show'>Score: {{ getScore() }} / {{ getMaxScore() }}</label>
</div> </div>
</div> </div>
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