File tree Expand file tree Collapse file tree 1 file changed +7
-23
lines changed Expand file tree Collapse file tree 1 file changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -63,29 +63,13 @@ function calculateRank({
6363
6464 const normalizedScore = normalcdf ( score , TOTAL_VALUES , ALL_OFFSETS ) * 100 ;
6565
66- let level = "" ;
67-
68- if ( normalizedScore < RANK_S_VALUE ) {
69- level = "S+" ;
70- }
71- if (
72- normalizedScore >= RANK_S_VALUE &&
73- normalizedScore < RANK_DOUBLE_A_VALUE
74- ) {
75- level = "S" ;
76- }
77- if (
78- normalizedScore >= RANK_DOUBLE_A_VALUE &&
79- normalizedScore < RANK_A2_VALUE
80- ) {
81- level = "A++" ;
82- }
83- if ( normalizedScore >= RANK_A2_VALUE && normalizedScore < RANK_A3_VALUE ) {
84- level = "A+" ;
85- }
86- if ( normalizedScore >= RANK_A3_VALUE && normalizedScore < RANK_B_VALUE ) {
87- level = "B+" ;
88- }
66+ const level = ( ( ) => {
67+ if ( normalizedScore < RANK_S_VALUE ) return "S+" ;
68+ if ( normalizedScore >= RANK_S_VALUE && normalizedScore < RANK_DOUBLE_A_VALUE ) return "S" ;
69+ if ( normalizedScore >= RANK_DOUBLE_A_VALUE && normalizedScore < RANK_A2_VALUE ) return "A++" ;
70+ if ( normalizedScore >= RANK_A2_VALUE && normalizedScore < RANK_A3_VALUE ) return "A+"
71+ if ( normalizedScore >= RANK_A3_VALUE && normalizedScore < RANK_B_VALUE ) return "B+"
72+ } ) ( )
8973
9074 return { level, score : normalizedScore } ;
9175}
You can’t perform that action at this time.
0 commit comments