Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assessment Configurability in Ground Control #2863

Merged
merged 39 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7574548
Change hasTokenCounter to hasVotingAttributes in Assessment Config. E…
jayjay19630 Mar 20, 2024
f934853
Rename hasVotingAttributes to hasVotingFeatures
jayjay19630 Mar 20, 2024
4a45bf6
Create dialog box for configuration in ground control
jayjay19630 Mar 20, 2024
3e3c2f7
Create dialog box for configurations with voting config toggles
jayjay19630 Mar 21, 2024
b0aabfb
Combine toggleHasTokenCounter and toggleVotingFeatures into configure…
jayjay19630 Mar 21, 2024
cea6f31
Create backend request for updating configurations
jayjay19630 Mar 21, 2024
3f02090
Add message for updating assessment configurations
jayjay19630 Mar 21, 2024
bb452ce
Isolate hastokencounter as its own field
jayjay19630 Mar 21, 2024
0eb08ef
Add non-functional voting controls
jayjay19630 Mar 21, 2024
452c78c
Fix tests
jayjay19630 Mar 21, 2024
b948ae4
Add new column for token counter in admin panel
jayjay19630 Mar 21, 2024
ace43d8
Fix bugs relating to tokencounter switch
jayjay19630 Mar 21, 2024
afdbfe5
Remove unnecessary maxwidth property on tokencounter switch
jayjay19630 Mar 21, 2024
4b313c5
Fix bug where toggling tokencounter would request voting features to …
jayjay19630 Mar 21, 2024
4298cac
Create footer text to clarify usage of hastokencounter and hasVotingF…
jayjay19630 Mar 22, 2024
505c115
Align text on configure dialogbox
jayjay19630 Mar 22, 2024
3f1efe5
Merge branch 'source-academy:master' into EnhancedGroundControl
jayjay19630 Mar 22, 2024
99de1d1
Merge branch 'master' into EnhancedGroundControl
RichDom2185 Mar 22, 2024
b133005
Merge branch 'master' into EnhancedGroundControl
RichDom2185 Mar 23, 2024
712c106
Fix tests post-merge
RichDom2185 Mar 23, 2024
4574a23
Merge branch 'EnhancedGroundControl' of github.com:jayjay19630/source…
jayjay19630 Mar 23, 2024
702a12f
Fix imports
jayjay19630 Mar 23, 2024
aa7e428
Add close dialog upon saving
jayjay19630 Mar 23, 2024
b9b3e99
Uncapitalise letters in config dialog
jayjay19630 Mar 23, 2024
9e576ce
Change label from has token counter to enable token counter
jayjay19630 Mar 23, 2024
25aeab1
Code quality improvements
jayjay19630 Mar 23, 2024
3cb1a26
Merge branch 'master' into EnhancedGroundControl
martin-henz Mar 24, 2024
cb739e2
Merge branch 'master' into EnhancedGroundControl
RichDom2185 Mar 24, 2024
8e572ec
Merge branch 'master' into EnhancedGroundControl
RichDom2185 Mar 24, 2024
7e4f846
Create new section for team-related configurations
jayjay19630 Mar 25, 2024
cc0dfa1
Merge branch 'EnhancedGroundControl' of github.com:jayjay19630/source…
jayjay19630 Mar 25, 2024
9607708
Merge branch 'master' into EnhancedGroundControl
RichDom2185 Mar 26, 2024
5a76713
Fix code quality per suggestion
jayjay19630 Mar 26, 2024
a2d0a00
Merge branch 'EnhancedGroundControl' of github.com:jayjay19630/source…
jayjay19630 Mar 26, 2024
b491f3f
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Mar 26, 2024
fd1c900
Fix errors post-merge
RichDom2185 Mar 26, 2024
1f22fa5
Fix lint errors
RichDom2185 Mar 26, 2024
fe12814
Merge branch 'master' into EnhancedGroundControl
RichDom2185 Mar 26, 2024
ea9a82f
Merge branch 'master' into EnhancedGroundControl
RichDom2185 Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/commons/XMLParser/XMLParserHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ const makeAssessmentOverview = (result: any, maxXpVal: number): AssessmentOvervi
story: rawOverview.story,
xp: 0,
gradingStatus: 'none' as GradingStatuses,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
};
};

Expand Down
12 changes: 11 additions & 1 deletion src/commons/application/actions/__tests__/SessionActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -344,6 +345,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -353,6 +355,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
}
Expand Down Expand Up @@ -541,7 +544,8 @@ test('updateAssessmentOverviews generates correct action object', () => {
story: null,
xp: 0,
gradingStatus: 'none',
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
}
];
const action = updateAssessmentOverviews(overviews);
Expand Down Expand Up @@ -769,6 +773,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -778,6 +783,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -787,6 +793,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -796,6 +803,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -805,6 +813,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
}
Expand All @@ -823,6 +832,7 @@ test('deleteAssessmentConfig generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
};
Expand Down
15 changes: 10 additions & 5 deletions src/commons/application/reducers/__tests__/SessionReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ test('SET_ASSESSMENT_CONFIGURATIONS works correctly', () => {
earlySubmissionXp: 200,
isManuallyGraded: false,
displayInDashboard: true,
hasTokenCounter: false
hasTokenCounter: false,
hasVotingFeatures: false
},
{
assessmentConfigId: 1,
Expand All @@ -171,7 +172,8 @@ test('SET_ASSESSMENT_CONFIGURATIONS works correctly', () => {
earlySubmissionXp: 200,
isManuallyGraded: false,
displayInDashboard: true,
hasTokenCounter: false
hasTokenCounter: false,
hasVotingFeatures: false
},
{
assessmentConfigId: 1,
Expand All @@ -183,7 +185,8 @@ test('SET_ASSESSMENT_CONFIGURATIONS works correctly', () => {
earlySubmissionXp: 200,
isManuallyGraded: false,
displayInDashboard: true,
hasTokenCounter: false
hasTokenCounter: false,
hasVotingFeatures: false
}
];

Expand Down Expand Up @@ -339,7 +342,8 @@ const assessmentOverviewsTest1: AssessmentOverview[] = [
story: null,
xp: 0,
gradingStatus: GradingStatuses.none,
maxTeamSize: 5
maxTeamSize: 5,
hasVotingFeatures: false
}
];

Expand All @@ -359,7 +363,8 @@ const assessmentOverviewsTest2: AssessmentOverview[] = [
story: null,
xp: 1,
gradingStatus: GradingStatuses.grading,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
}
];

Expand Down
6 changes: 5 additions & 1 deletion src/commons/assessment/AssessmentTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export type AssessmentOverview = {
gradingStatus: GradingStatus;
id: number;
isPublished?: boolean;
hasVotingFeatures: boolean;
hasTokenCounter?: boolean;
maxXp: number;
number?: string; // For mission control
openAt: string;
Expand Down Expand Up @@ -98,6 +100,7 @@ export type AssessmentConfiguration = {
hoursBeforeEarlyXpDecay: number;
earlySubmissionXp: number;
hasTokenCounter: boolean;
hasVotingFeatures: boolean;
};

export interface IProgrammingQuestion extends BaseQuestion {
Expand Down Expand Up @@ -246,7 +249,8 @@ export const overviewTemplate = (): AssessmentOverview => {
story: 'mission',
xp: 0,
gradingStatus: 'none',
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
};
};

Expand Down
1 change: 1 addition & 0 deletions src/commons/assessment/__tests__/Assessment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const mockAssessmentProps = assertType<AssessmentProps>()({
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
}
Expand Down
8 changes: 2 additions & 6 deletions src/commons/assessmentWorkspace/AssessmentWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,12 @@ const AssessmentWorkspace: React.FC<AssessmentWorkspaceProps> = props => {
* Handles toggling enabling and disabling token counter depending on assessment properties
*/
useEffect(() => {
if (props.assessmentConfiguration.hasTokenCounter) {
if (assessment?.hasTokenCounter) {
handleEnableTokenCounter();
} else {
handleDisableTokenCounter();
}
}, [
props.assessmentConfiguration.hasTokenCounter,
handleEnableTokenCounter,
handleDisableTokenCounter
]);
}, [assessment?.hasTokenCounter, handleEnableTokenCounter, handleDisableTokenCounter]);

/**
* Handles toggling of relevant SideContentTabs when mobile breakpoint it hit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const defaultProps = assertType<AssessmentWorkspaceProps>()({
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand Down
40 changes: 29 additions & 11 deletions src/commons/mocks/AssessmentMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: false,
hasVotingFeatures: false,
earlySubmissionXp: 200
},
{
Expand All @@ -32,6 +33,7 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: false,
hasVotingFeatures: false,
earlySubmissionXp: 200
},
{
Expand All @@ -41,6 +43,7 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: false,
hasVotingFeatures: false,
earlySubmissionXp: 200
},
{
Expand All @@ -49,7 +52,8 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
isManuallyGraded: true,
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: true,
hasTokenCounter: false,
hasVotingFeatures: true,
earlySubmissionXp: 200
},
{
Expand All @@ -59,6 +63,7 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: false,
hasVotingFeatures: false,
earlySubmissionXp: 200
}
],
Expand All @@ -70,6 +75,7 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: false,
hasVotingFeatures: false,
earlySubmissionXp: 200
},
{
Expand All @@ -79,6 +85,7 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: false,
hasVotingFeatures: false,
earlySubmissionXp: 200
},
{
Expand All @@ -88,6 +95,7 @@ export const mockAssessmentConfigurations: AssessmentConfiguration[][] = [
displayInDashboard: true,
hoursBeforeEarlyXpDecay: 48,
hasTokenCounter: false,
hasVotingFeatures: false,
earlySubmissionXp: 200
}
]
Expand All @@ -109,7 +117,8 @@ const mockUnopenedAssessmentsOverviews: AssessmentOverview[] = [
story: 'mission-1',
xp: 0,
gradingStatus: GradingStatuses.none,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
}
];

Expand Down Expand Up @@ -141,7 +150,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
story: 'mission-1',
xp: 1,
gradingStatus: GradingStatuses.none,
maxTeamSize: 4
maxTeamSize: 4,
hasVotingFeatures: false
},
{
type: 'Missions',
Expand All @@ -158,7 +168,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
story: 'mission-2',
xp: 2,
gradingStatus: GradingStatuses.none,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -175,7 +186,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
story: 'sidequest-2.1',
xp: 3,
gradingStatus: GradingStatuses.none,
maxTeamSize: 2
maxTeamSize: 2,
hasVotingFeatures: false
},
{
type: 'Paths',
Expand All @@ -192,7 +204,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
story: null,
xp: 0,
gradingStatus: GradingStatuses.excluded,
maxTeamSize: 2
maxTeamSize: 2,
hasVotingFeatures: false
},
{
type: 'Others',
Expand All @@ -210,7 +223,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
xp: 3,
gradingStatus: GradingStatuses.none,
private: true,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
}
];

Expand All @@ -230,7 +244,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
story: 'mission-3',
xp: 800,
gradingStatus: GradingStatuses.grading,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -247,7 +262,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
story: null,
xp: 500,
gradingStatus: GradingStatuses.none,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -264,7 +280,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
story: null,
xp: 150,
gradingStatus: GradingStatuses.graded,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -281,7 +298,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
story: null,
xp: 100,
gradingStatus: GradingStatuses.excluded,
maxTeamSize: 1
maxTeamSize: 1,
hasVotingFeatures: false
}
];

Expand Down
1 change: 1 addition & 0 deletions src/commons/profile/__tests__/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const assessmentConfigurations: AssessmentConfiguration[] = [
isManuallyGraded: false,
displayInDashboard: false,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 0,
earlySubmissionXp: 0
}));
Expand Down
Loading
Loading