瀏覽代碼

Change conversion algorithm from x/100 to A-F grade

Gaël Métais 10 年之前
父節點
當前提交
249cfa21e3
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      front/src/js/directives/gradeDirective.js

+ 5 - 5
front/src/js/directives/gradeDirective.js

@@ -11,19 +11,19 @@ gradeDirective.directive('grade', function() {
         replace: true,
         replace: true,
         controller : function($scope) {
         controller : function($scope) {
             $scope.getGrade = function(score) {
             $scope.getGrade = function(score) {
-                if (score >= 85) {
+                if (score > 80) {
                     return 'A';
                     return 'A';
                 }
                 }
-                if (score >= 65) {
+                if (score > 60) {
                     return 'B';
                     return 'B';
                 }
                 }
-                if (score >= 45) {
+                if (score > 40) {
                     return 'C';
                     return 'C';
                 }
                 }
-                if (score >= 30) {
+                if (score > 20) {
                     return 'D';
                     return 'D';
                 }
                 }
-                if (score >= 15) {
+                if (score > 0) {
                     return 'E';
                     return 'E';
                 }
                 }
                 return 'F';
                 return 'F';