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 32 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 @@ -84,7 +84,8 @@ const makeAssessmentOverview = (result: any, maxXpVal: number): AssessmentOvervi
status: AssessmentStatuses.attempting,
story: rawOverview.story,
xp: 0,
gradingStatus: 'none' as GradingStatuses
gradingStatus: 'none' as GradingStatuses,
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 @@ -296,6 +296,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -305,6 +306,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -314,6 +316,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
}
Expand Down Expand Up @@ -501,7 +504,8 @@ test('updateAssessmentOverviews generates correct action object', () => {
status: 'not_attempted',
story: null,
xp: 0,
gradingStatus: 'none'
gradingStatus: 'none',
hasVotingFeatures: false
}
];
const action = updateAssessmentOverviews(overviews);
Expand Down Expand Up @@ -681,6 +685,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -690,6 +695,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -699,6 +705,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -708,6 +715,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
},
Expand All @@ -717,6 +725,7 @@ test('updateAssessmentTypes generates correct action object', () => {
isManuallyGraded: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 48,
earlySubmissionXp: 200
}
Expand All @@ -735,6 +744,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 @@ -158,7 +158,8 @@ test('SET_ASSESSMENT_CONFIGURATIONS works correctly', () => {
earlySubmissionXp: 200,
isManuallyGraded: false,
displayInDashboard: true,
hasTokenCounter: false
hasTokenCounter: false,
hasVotingFeatures: false
},
{
assessmentConfigId: 1,
Expand All @@ -170,7 +171,8 @@ test('SET_ASSESSMENT_CONFIGURATIONS works correctly', () => {
earlySubmissionXp: 200,
isManuallyGraded: false,
displayInDashboard: true,
hasTokenCounter: false
hasTokenCounter: false,
hasVotingFeatures: false
},
{
assessmentConfigId: 1,
Expand All @@ -182,7 +184,8 @@ test('SET_ASSESSMENT_CONFIGURATIONS works correctly', () => {
earlySubmissionXp: 200,
isManuallyGraded: false,
displayInDashboard: true,
hasTokenCounter: false
hasTokenCounter: false,
hasVotingFeatures: false
}
];

Expand Down Expand Up @@ -337,7 +340,8 @@ const assessmentOverviewsTest1: AssessmentOverview[] = [
status: AssessmentStatuses.not_attempted,
story: null,
xp: 0,
gradingStatus: GradingStatuses.none
gradingStatus: GradingStatuses.none,
hasVotingFeatures: false
}
];

Expand All @@ -356,7 +360,8 @@ const assessmentOverviewsTest2: AssessmentOverview[] = [
status: AssessmentStatuses.attempted,
story: null,
xp: 1,
gradingStatus: GradingStatuses.grading
gradingStatus: GradingStatuses.grading,
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 @@ -97,6 +99,7 @@ export type AssessmentConfiguration = {
hoursBeforeEarlyXpDecay: number;
earlySubmissionXp: number;
hasTokenCounter: boolean;
hasVotingFeatures: boolean;
};

export interface IProgrammingQuestion extends BaseQuestion {
Expand Down Expand Up @@ -243,7 +246,8 @@ export const overviewTemplate = (): AssessmentOverview => {
status: AssessmentStatuses.not_attempted,
story: 'mission',
xp: 0,
gradingStatus: 'none'
gradingStatus: 'none',
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 @@ -251,16 +251,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 @@ -108,7 +116,8 @@ const mockUnopenedAssessmentsOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.not_attempted,
story: 'mission-1',
xp: 0,
gradingStatus: GradingStatuses.none
gradingStatus: GradingStatuses.none,
hasVotingFeatures: false
}
];

Expand Down Expand Up @@ -139,7 +148,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.attempted,
story: 'mission-1',
xp: 1,
gradingStatus: GradingStatuses.none
gradingStatus: GradingStatuses.none,
hasVotingFeatures: false
},
{
type: 'Missions',
Expand All @@ -155,7 +165,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.attempting,
story: 'mission-2',
xp: 2,
gradingStatus: GradingStatuses.none
gradingStatus: GradingStatuses.none,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -171,7 +182,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.not_attempted,
story: 'sidequest-2.1',
xp: 3,
gradingStatus: GradingStatuses.none
gradingStatus: GradingStatuses.none,
hasVotingFeatures: false
},
{
type: 'Paths',
Expand All @@ -187,7 +199,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.not_attempted,
story: null,
xp: 0,
gradingStatus: GradingStatuses.excluded
gradingStatus: GradingStatuses.excluded,
hasVotingFeatures: false
},
{
type: 'Others',
Expand All @@ -204,7 +217,8 @@ const mockOpenedAssessmentsOverviews: AssessmentOverview[] = [
story: 'sidequest-2.1',
xp: 3,
gradingStatus: GradingStatuses.none,
private: true
private: true,
hasVotingFeatures: false
}
];

Expand All @@ -223,7 +237,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.submitted,
story: 'mission-3',
xp: 800,
gradingStatus: GradingStatuses.grading
gradingStatus: GradingStatuses.grading,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -239,7 +254,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.submitted,
story: null,
xp: 500,
gradingStatus: GradingStatuses.none
gradingStatus: GradingStatuses.none,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -255,7 +271,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.submitted,
story: null,
xp: 150,
gradingStatus: GradingStatuses.graded
gradingStatus: GradingStatuses.graded,
hasVotingFeatures: false
},
{
type: 'Quests',
Expand All @@ -271,7 +288,8 @@ const mockClosedAssessmentOverviews: AssessmentOverview[] = [
status: AssessmentStatuses.submitted,
story: null,
xp: 100,
gradingStatus: GradingStatuses.excluded
gradingStatus: GradingStatuses.excluded,
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