Skip to content

Commit a9734b5

Browse files
tohyzhongBlerarghRichDom2185martin-henzsayomaki
authored
Leaderboard (#3113)
* Leaderboard create course config, leaderboard page routing, leaderboard sql query for all users in course * added support for Top Leaderboard Display (select number of entries to show) * Background and default avatar for Leaderboard * Leaderboard Routing * Leaderboard Dropdown for all leaderboard pages * Overall and Contest leaderboard (leaderboard + retrieval from backend) * Button in Ground Control to manually trigger contest score calculation (updates DB table answers with scores) * [*not working] Support redirecting to contest voting workspace for code display * prettier changes * Fix import order in AssessmentWorkspace component * Refactor contest score calculation logic in Ground Control * Modularisation of Leaderboard subcomponents * Formatting changes * Dropdown, csv Export, Podium fixes * Set filename for Contests and Overall Leaderboard csv * Use no payload type * Remove unused parameter * Refactor LeaderboardExportButton to accept dynamic type and update filename logic * Add contests state and actions to leaderboard management. Added top X for contest Leaderboard (create course dropdown and course admin panel) Added Top X for assessment workspace contest leaderboard and fixed export contest leaderboard (assessment workspace) Fixed Leaderboard dropdown to show only published contests and omit voting assessments. * Add DispatchContestXp functionality and button to issue contest XP in ground control * Refactor leaderboard components to use slice for top entries instead of filter * Remove duplicate import of getAllContests and clean up imports in LeaderboardSaga; adjust import order in GroundControlConfigureCell * Updated contest details fetching for manual url entry * Refactor ContestLeaderboard to filter top entries by rank and adjust pagination settings * Temporary removal of Achievements column in leaderboard and added default sample profile pictures * Remove console.log statements from leaderboard saga and components * Fix: Tied contest popular vote/scores exceeding visible entries limit will still be shown * Fix: Update ContestEntry type to include rank and adjust assessment workspace leaderboard ranking logic * Fix: Use logical checking to circumvent setTimeout usage * Refactor: Clean up unused type declarations and reorganize imports in assessment and leaderboard components * Refactor: Improve code formatting and consistency across leaderboard components * Refactor: Remove unnecessary console.log from ContestLeaderboard component * Remove files not supposed to be committed * Revert incorrect DTS changes * Avoid spaces in file names * Standardize reducer import * Fix inconsistent HTML label for * Organize imports * Added support for retrieving only relevant rows in leaderboard page * Refactor leaderboard data handling to support pagination and update related actions and types * Updated leaderboard podium logic * Enhance leaderboard functionality to support visible entries in contest scores and popular votes, update API endpoints, and refactor export button logic. * Update Contest Leaderboard export to support all users * Refactor leaderboard saga and actions for improved readability and maintainability; update ContestLeaderboard and OverallLeaderboard components for better state management and data retrieval. * Fix API endpoint in getScoreLeaderboard and disable pagination page size selector in OverallLeaderboard * Updated leaderboard display backend requests to use query parameters; Offset calculation shifted from backend to frontend * Refactor leaderboard export button to escape code fields and update column names for clarity; enhance data handling in CSV export. * Fix API endpoints in getScoreLeaderboard and getPopularVoteLeaderboard by removing 'admin' from the URL path. * Refactor leaderboard saga handlers to use action type constants * Minor formatting fix * Add fromContestLeaderboard property to defaultProps in AssessmentWorkspace tests * Removed obsolete snapshots * Update post-merge * Standardize import * Remove unused comment --------- Co-authored-by: Blerargh <[email protected]> Co-authored-by: Richard Dominick <[email protected]> Co-authored-by: Martin Henz <[email protected]> Co-authored-by: sayomaki <[email protected]>
1 parent a1da3e6 commit a9734b5

File tree

51 files changed

+1916
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1916
-17
lines changed

public/assets/Sample_Profile_1.jpg

6.84 KB
Loading

public/assets/Sample_Profile_2.jpg

8.79 KB
Loading

public/assets/Sample_Profile_3.jpg

10.8 KB
Loading

public/assets/Sample_Profile_4.jpg

75.7 KB
Loading

public/assets/Sample_Profile_5.jpg

17.9 KB
Loading

public/assets/Sample_Profile_6.jpg

6.9 KB
Loading

public/assets/Sample_Profile_7.jpg

14 KB
Loading

src/assets/default-avatar.jpg

57 KB
Loading
2.55 MB
Loading

src/commons/application/ApplicationTypes.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Chapter, Language, type SourceError, type Value, Variant } from 'js-sla
22

33
import type { AchievementState } from '../../features/achievement/AchievementTypes';
44
import type { DashboardState } from '../../features/dashboard/DashboardTypes';
5+
import type { LeaderboardState } from '../../features/leaderboard/LeaderboardTypes';
56
import type { PlaygroundState } from '../../features/playground/PlaygroundTypes';
67
import { PlaybackStatus, RecordingStatus } from '../../features/sourceRecorder/SourceRecorderTypes';
78
import type { StoriesEnvState, StoriesState } from '../../features/stories/StoriesTypes';
@@ -26,6 +27,7 @@ import type { VscodeState as VscodeState } from './types/VscodeTypes';
2627
export type OverallState = {
2728
readonly router: RouterState;
2829
readonly achievement: AchievementState;
30+
readonly leaderboard: LeaderboardState;
2931
readonly playground: PlaygroundState;
3032
readonly session: SessionState;
3133
readonly stories: StoriesState;
@@ -345,6 +347,16 @@ export const defaultAchievement: AchievementState = {
345347
assessmentOverviews: []
346348
};
347349

350+
export const defaultLeaderboard: LeaderboardState = {
351+
userXp: [],
352+
paginatedUserXp: { rows: [], userCount: 0 },
353+
contestScore: [],
354+
contestPopularVote: [],
355+
code: '',
356+
contests: [],
357+
initialRun: {}
358+
};
359+
348360
const getDefaultLanguageConfig = (): SALanguage => {
349361
const languageConfig = ALL_LANGUAGES.find(
350362
sublang =>
@@ -604,6 +616,7 @@ export const defaultVscode: VscodeState = {
604616
export const defaultState: OverallState = {
605617
router: defaultRouter,
606618
achievement: defaultAchievement,
619+
leaderboard: defaultLeaderboard,
607620
dashboard: defaultDashboard,
608621
playground: defaultPlayground,
609622
session: defaultSession,

0 commit comments

Comments
 (0)