-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use configured DEFAULT_GRADE_DESIGNATIONS (#1227)
Support was recently added to edx-platform to add customisised default grade designations, this change adds support for them to this MFE as well to bring it to partiy with the edx-platform UI It also refactors the grading-settings page to use React Query and updates the logic used when partitioning grades by default to make it work better when there are more than 5 partitions. Co-authored-by: Farhaan Bukhsh <[email protected]>
- Loading branch information
1 parent
774728a
commit 4d4adce
Showing
12 changed files
with
316 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; | ||
import { getCourseSettings, getGradingSettings, sendGradingSettings } from './api'; | ||
|
||
export const useGradingSettings = (courseId: string) => ( | ||
useQuery({ | ||
queryKey: ['gradingSettings', courseId], | ||
queryFn: () => getGradingSettings(courseId), | ||
}) | ||
); | ||
|
||
export const useCourseSettings = (courseId: string) => ( | ||
useQuery({ | ||
queryKey: ['courseSettings', courseId], | ||
queryFn: () => getCourseSettings(courseId), | ||
}) | ||
); | ||
|
||
export const useGradingSettingUpdater = (courseId: string) => { | ||
const queryClient = useQueryClient(); | ||
return useMutation({ | ||
mutationFn: (settings) => sendGradingSettings(courseId, settings), | ||
onSettled: () => { | ||
queryClient.invalidateQueries({ queryKey: ['gradingSettings', courseId] }); | ||
}, | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.