File tree Expand file tree Collapse file tree
hwproj.front/src/components/Solutions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,13 @@ const StudentSolutionsPage: FC<RouteComponentProps<IStudentSolutionsPageProps>>
6060
6161 const getNextUnratedSolution = async ( ) => {
6262 const unratedSolutions = await ApiSingleton . solutionsApi . apiSolutionsUnratedSolutionsGet ( taskId )
63- const nextUnratedSolution = unratedSolutions . unratedSolutions ! . filter ( t => t . student ! . userId !== studentId ) [ 0 ]
63+ const nextUnratedSolution = unratedSolutions . unratedSolutions !
64+ . filter ( t => t . student ! . userId !== studentId )
65+ . sort ( ( s1 , s2 ) => {
66+ const cm1 = `${ s1 . student ! . surname } ${ s1 . student ! . name } `
67+ const cm2 = `${ s2 . student ! . surname } ${ s2 . student ! . name } `
68+ return cm1 . localeCompare ( cm2 )
69+ } ) [ 0 ]
6470
6571 if ( nextUnratedSolution ) {
6672 window . location . assign ( `/task/${ nextUnratedSolution . taskId } /${ nextUnratedSolution . student ! . userId } ` )
You can’t perform that action at this time.
0 commit comments