File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -214,11 +214,11 @@ const ChallengeListPage = () => {
214214 if ( difficultyParams . length === 1 ) {
215215 const diffParam = difficultyParams [ 0 ] ;
216216 if ( diffParam === 'easy' ) {
217- difficultyParams = [ '1' , '2' ] ;
217+ difficultyParams = [ '1' ] ;
218218 } else if ( diffParam === 'medium' ) {
219- difficultyParams = [ '3 ' , '4 ' ] ;
219+ difficultyParams = [ '2 ' , '3 ' ] ;
220220 } else if ( diffParam === 'hard' ) {
221- difficultyParams = [ '5' ] ;
221+ difficultyParams = [ '4' , ' 5'] ;
222222 }
223223 }
224224
Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ import { useMediaQuery } from 'react-responsive';
1111const getDifficultyCounts = ( ) => {
1212 const counts = { easy : 0 , medium : 0 , hard : 0 } ;
1313 challenges . forEach ( challenge => {
14- // 匹配挑战列表页面的难度分类 :
15- // easy: 1-2星 , medium: 3-4星 , hard: 5星
16- if ( challenge . difficulty <= 2 ) counts . easy ++ ;
17- else if ( challenge . difficulty <= 4 ) counts . medium ++ ;
18- else if ( challenge . difficulty === 5 ) counts . hard ++ ;
14+ // 匹配新的难度分类 :
15+ // easy: 1星 , medium: 2-3星 , hard: 4- 5星
16+ if ( challenge . difficulty === 1 ) counts . easy ++ ;
17+ else if ( challenge . difficulty === 2 || challenge . difficulty === 3 ) counts . medium ++ ;
18+ else if ( challenge . difficulty >= 4 ) counts . hard ++ ;
1919 } ) ;
2020 return counts ;
2121} ;
You can’t perform that action at this time.
0 commit comments