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

Implement isGradingPublished (plus related features) #2856

Merged
merged 112 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
ab3653f
Dummy publish grading function
josh1248 Mar 2, 2024
8f8f63b
Merge branch 'source-academy:master' into publishGrading
josh1248 Mar 3, 2024
d8ba3c8
skeleton redux loop for publishGrading, update GradingOverview
josh1248 Mar 3, 2024
2af18ea
New column filter for isPublished (WIP)
josh1248 Mar 3, 2024
0b2530f
Merge branch 'source-academy:master' into publishGrading
josh1248 Mar 6, 2024
a7377ee
Implement anticipated backend format and route implementations for pu…
josh1248 Mar 12, 2024
925a277
Remove misleading devnote and simplify message contents
josh1248 Mar 12, 2024
663e428
fix: Change gradingOverviews to use backend response
GabrielCWT Mar 13, 2024
96ea90d
Readjust publish button from HTML icon button to Blueprintjs text button
josh1248 Mar 15, 2024
625bd44
Publish and unpublish buttons set up
josh1248 Mar 15, 2024
ced3f83
set up frontend-only type submissionProgress derived from backend sta…
josh1248 Mar 15, 2024
39bfe25
Implement derived submissionProgress frontend field from status and i…
josh1248 Mar 19, 2024
d0295fc
Improve type safety in Grading page
josh1248 Mar 19, 2024
ab6d433
Implement business logic to disable unsubmission if published or not …
josh1248 Mar 19, 2024
c4be360
Use notPublished param in backend
josh1248 Mar 19, 2024
5c67421
minor type safety change
josh1248 Mar 19, 2024
a34fc67
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Mar 20, 2024
781b97c
Update new actions post-merge conflicts
RichDom2185 Mar 20, 2024
b479dad
Update tests
josh1248 Mar 20, 2024
8698f13
Update jsdocs and field names from ungraded to unpublished
josh1248 Mar 20, 2024
8f3fc2e
adjust field names in test from unpublishedFilter to publishedFilter
josh1248 Mar 20, 2024
0f8e168
Merge branch 'master' into publishGrading
RichDom2185 Mar 21, 2024
ddcc9be
Updated showGrading to be based on published status
josh1248 Mar 22, 2024
e08f6ed
Update getAssessmentOverviews to compute submission progress
GabrielCWT Mar 22, 2024
b6f3d96
Fix tests
josh1248 Mar 22, 2024
0e55239
Scaffold function for comprehensive progress status (WIP)
josh1248 Mar 22, 2024
1f4510c
Update RequestsSaga.ts
josh1248 Mar 22, 2024
d132b07
fix crash
josh1248 Mar 22, 2024
40d024b
Introduce soon-to-be comprehensive field into table
josh1248 Mar 22, 2024
a0cd176
Merge branch 'source-academy:master' into publishGrading
josh1248 Mar 22, 2024
b6c5c2f
Shift conversion functions into utils
josh1248 Mar 22, 2024
06cea01
Update business logic using comprehensive state
josh1248 Mar 22, 2024
9e4833f
Introduce progress status to assessment overviews
josh1248 Mar 22, 2024
2953187
clean up display of progressStatus
josh1248 Mar 22, 2024
9f62a90
remove derived submissionProgress field, add in status field from bac…
josh1248 Mar 22, 2024
a0c6224
remove direct gradingStatus use in grading page
josh1248 Mar 22, 2024
89c8bff
remove gradingStatus from assessments
josh1248 Mar 22, 2024
fe9bcac
Remove more references to gradingStatus
josh1248 Mar 22, 2024
654996f
Replace references to gradingStatus with progress
josh1248 Mar 22, 2024
ae6bc4e
there is a lot of reference to gradingStatus.
josh1248 Mar 22, 2024
0767ae3
Replace gradingStatus with progress in testing
josh1248 Mar 24, 2024
e8bbb0c
Merge branch 'source-academy:master' into publishGrading
josh1248 Mar 24, 2024
dcf8fb1
Fully remove gradingStatus and replace with progress
josh1248 Mar 24, 2024
ee498bd
Fix accidental import
josh1248 Mar 24, 2024
586b0a8
Update to use new backend parameter names in backend
josh1248 Mar 24, 2024
f5e2ec3
Remove isPublished field entirely from grading overviews to avoid con…
josh1248 Mar 24, 2024
6c128d8
Update tests
josh1248 Mar 24, 2024
c571e9c
Dummy publish all button in ground control
josh1248 Mar 24, 2024
f027618
redux loop for publishall and unpublishall (part 1)
josh1248 Mar 24, 2024
d309239
Remove re-autograde for published or non-submitted assessments
josh1248 Mar 24, 2024
3620389
Add publishAll button
josh1248 Mar 24, 2024
3fe33ca
Replace deprecated ag-grid functions with current versions
josh1248 Mar 24, 2024
aa81f75
Merge branch 'source-academy:master' into publishGrading
josh1248 Mar 24, 2024
32ee7c7
Implement unpublish all button
josh1248 Mar 25, 2024
4f5c302
Add unique key, avoid specialkey flag from react
josh1248 Mar 25, 2024
6519a7c
Fix button layout
josh1248 Mar 25, 2024
02286da
Fix button format
josh1248 Mar 25, 2024
a7d7809
Merge branch 'source-academy:master' into publishGrading
josh1248 Mar 25, 2024
b99dc81
increase width for accessibility
josh1248 Mar 25, 2024
0491e0a
autoPublish settings inserted into admin panel configs
josh1248 Mar 26, 2024
03a4a48
cleanup of isAutoPublished field within assessment configs
josh1248 Mar 26, 2024
2349bff
update tests for assessmentConfiguration
josh1248 Mar 26, 2024
b14e0a0
remove un-needed import
josh1248 Mar 26, 2024
9706754
remove debug-only submissionStatus in grading submissions table
josh1248 Mar 26, 2024
b7352bc
Revert accidental removal of XP field
josh1248 Mar 26, 2024
50eb959
bp5-minimal tag to clean up bulk publishing buttons - thanks gabriel :)
josh1248 Mar 26, 2024
31437fd
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Mar 26, 2024
c5262e7
Fix errors post-merge
RichDom2185 Mar 26, 2024
b1993a9
Fix lint error
RichDom2185 Mar 26, 2024
b740a71
Merge branch 'master' into publishGrading
RichDom2185 Mar 26, 2024
2424751
feat: Implement published and unpublished notifications and remove de…
GabrielCWT Mar 27, 2024
1cfaa3a
chore: Remove commented code
GabrielCWT Mar 27, 2024
7978ad2
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Apr 1, 2024
c4f7b7c
Fix compile error
RichDom2185 Apr 1, 2024
597c1d3
Remove unnecessary typecast
RichDom2185 Apr 1, 2024
589466b
Remove unnecessary typecast
RichDom2185 Apr 1, 2024
cab890a
Remove unused import
RichDom2185 Apr 1, 2024
bce5035
update notification types to reflect backend
josh1248 Apr 1, 2024
0dce635
change notification types to reflect backend changes
josh1248 Apr 1, 2024
8a3c18a
remove git stash artifacts
josh1248 Apr 1, 2024
c108ffb
remove git stash artefacts
josh1248 Apr 1, 2024
61f11c0
add tooltips, update assessment fields
josh1248 Apr 1, 2024
f9170c0
remove development artifacts
josh1248 Apr 1, 2024
bd575de
Merge branch 'master' into publishGrading
RichDom2185 Apr 2, 2024
aaecc24
remove TODO comment as issue has been raised
josh1248 Apr 2, 2024
3dc7790
Update GradingUtils.ts jsdocs
josh1248 Apr 3, 2024
c5e7f67
Merge branch 'source-academy:master' into publishGrading
josh1248 Apr 3, 2024
3137bb2
linting
josh1248 Apr 3, 2024
89b2eb9
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Apr 6, 2024
b1e0b94
Merge branch 'source-academy:master' into publishGrading
josh1248 Apr 7, 2024
526b938
readjust progress statuses and conversion functions
josh1248 Apr 7, 2024
d210429
update colours and logos
josh1248 Apr 7, 2024
10a2856
Merge branch 'source-academy:master' into publishGrading
josh1248 Apr 8, 2024
f51114e
expose backend isGradingPublished field and update tests
josh1248 Apr 8, 2024
e09a856
update assessment cards to show purely based on isGradingPublished st…
josh1248 Apr 8, 2024
bf5352f
remove hardcoded assessment status
josh1248 Apr 8, 2024
05616df
linting
josh1248 Apr 8, 2024
b259586
revert yarn lock change
josh1248 Apr 8, 2024
c072160
Update yarn.lock
josh1248 Apr 8, 2024
ebd233d
update mocks and tests
josh1248 Apr 8, 2024
32099a3
remove un-needed import
josh1248 Apr 8, 2024
146d257
linting
josh1248 Apr 8, 2024
3e02b47
Merge branch 'master' into publishGrading
RichDom2185 Apr 10, 2024
76e1d9b
Merge branch 'master' into publishGrading
RichDom2185 Apr 10, 2024
8671cea
Use enum values instead of strings for color keys
RichDom2185 Apr 10, 2024
904b6ca
Use prop over BP CSS API
RichDom2185 Apr 10, 2024
3c9a91c
Merge branch 'master' into publishGrading
RichDom2185 Apr 10, 2024
4ed7a2d
remove un-needed field calculation, fix typos
josh1248 Apr 11, 2024
f75edda
update student username to show nusnet id instead of duplicating stud…
josh1248 Apr 11, 2024
4c0b8a0
Merge branch 'master' into publishGrading
RichDom2185 Apr 11, 2024
e9c57af
Merge branch 'master' into publishGrading
martin-henz Apr 13, 2024
2bc3ec5
Merge branch 'master' into publishGrading
RichDom2185 Apr 13, 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
4 changes: 2 additions & 2 deletions src/commons/XMLParser/XMLParserHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
AssessmentType,
BaseQuestion,
emptyLibrary,
GradingStatuses,
IMCQQuestion,
IProgrammingQuestion,
Library,
Expand Down Expand Up @@ -72,6 +71,7 @@ const makeAssessmentOverview = (result: any, maxXpVal: number): AssessmentOvervi
return {
type: capitalizeFirstLetter(rawOverview.kind) as AssessmentType,
isManuallyGraded: true, // TODO: This is temporarily hardcoded to true. To be redone when overhauling MissionControl
isPublished: false,
closeAt: rawOverview.duedate,
coverImage: rawOverview.coverimage,
id: EDITING_ID,
Expand All @@ -84,8 +84,8 @@ const makeAssessmentOverview = (result: any, maxXpVal: number): AssessmentOvervi
shortSummary: task.WEBSUMMARY ? task.WEBSUMMARY[0] : '',
status: AssessmentStatuses.attempting,
story: rawOverview.story,
isGradingPublished: false,
xp: 0,
gradingStatus: 'none' as GradingStatuses,
maxTeamSize: 1,
hasVotingFeatures: false
};
Expand Down
24 changes: 13 additions & 11 deletions src/commons/achievement/utils/InsertFakeAchievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import {
coverImageUrl
} from '../../../features/achievement/AchievementConstants';
import { GoalType } from '../../../features/achievement/AchievementTypes';
import { AssessmentConfiguration, AssessmentOverview } from '../../assessment/AssessmentTypes';
import {
AssessmentConfiguration,
AssessmentOverview,
AssessmentStatuses
} from '../../assessment/AssessmentTypes';
import AchievementInferencer from './AchievementInferencer';
import { isExpired, isReleased } from './DateHelper';

function assessmentCompleted(assessmentOverview: AssessmentOverview): boolean {
return (
assessmentOverview.gradingStatus === 'graded' ||
(!assessmentOverview.isManuallyGraded && assessmentOverview.status === 'submitted')
);
function assessmentPublished(assessmentOverview: AssessmentOverview): boolean {
return assessmentOverview.isGradingPublished;
}

function insertFakeAchievements(
Expand All @@ -34,7 +35,8 @@ function insertFakeAchievements(
// Reduce clutter for achievements that cannot be earned at that point
if (
!isReleased(new Date(assessmentOverview.openAt)) ||
(isExpired(new Date(assessmentOverview.closeAt)) && assessmentOverview.status !== 'submitted')
(isExpired(new Date(assessmentOverview.closeAt)) &&
assessmentOverview.status !== AssessmentStatuses.submitted)
) {
return;
}
Expand All @@ -53,7 +55,7 @@ function insertFakeAchievements(
requiredCompletionFrac: 0
}
},
assessmentOverview.status === 'submitted'
assessmentOverview.status === AssessmentStatuses.submitted
);

// goal for assessment grading
Expand All @@ -69,14 +71,14 @@ function insertFakeAchievements(
requiredCompletionFrac: 0
}
},
assessmentOverview.gradingStatus === 'graded'
assessmentOverview.isGradingPublished
);
}

inferencer.insertFakeAchievement({
uuid: idString,
title: assessmentOverview.title,
xp: assessmentCompleted(assessmentOverview)
xp: assessmentPublished(assessmentOverview)
? assessmentOverview.xp
: assessmentOverview.maxXp,
isVariableXp: false,
Expand All @@ -98,7 +100,7 @@ function insertFakeAchievements(
});

// if completed, add the uuid into the appropriate array
if (assessmentCompleted(assessmentOverview)) {
if (assessmentPublished(assessmentOverview)) {
assessmentTypes.forEach((type, idx) => {
if (type === assessmentOverview.type) {
categorisedUuids[idx].push(idString);
Expand Down
22 changes: 18 additions & 4 deletions src/commons/application/actions/SessionActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createAction } from '@reduxjs/toolkit';
import {
paginationToBackendParams,
ungradedToBackendParams
unpublishedToBackendParams
} from 'src/features/grading/GradingUtils';
import { OptionType } from 'src/pages/academy/teamFormation/subcomponents/TeamFormationForm';

Expand Down Expand Up @@ -54,6 +54,7 @@ import {
LOGOUT_GOOGLE,
NotificationConfiguration,
NotificationPreference,
PUBLISH_GRADING,
REAUTOGRADE_ANSWER,
REAUTOGRADE_SUBMISSION,
REMOVE_GITHUB_OCTOKIT_OBJECT_AND_ACCESS_TOKEN,
Expand All @@ -74,6 +75,7 @@ import {
SUBMIT_GRADING_AND_CONTINUE,
TimeOption,
Tokens,
UNPUBLISH_GRADING,
UNSUBMIT_SUBMISSION,
UPDATE_ASSESSMENT,
UPDATE_ASSESSMENT_CONFIGS,
Expand Down Expand Up @@ -134,7 +136,7 @@ export const fetchGrading = createAction(FETCH_GRADING, (submissionId: number) =
/**
* @param filterToGroup - param that when set to true, only shows submissions under the group
* of the grader
* @param gradedFilter - backend params to filter to ungraded
* @param publishedFilter - backend params to filter to unpublished
* @param pageParams - param that contains offset and pageSize, informing backend about how
* many entries, starting from what offset, to get
* @param filterParams - param that contains columnFilters converted into JSON for
Expand All @@ -144,10 +146,10 @@ export const fetchGradingOverviews = createAction(
FETCH_GRADING_OVERVIEWS,
(
filterToGroup = true,
gradedFilter = ungradedToBackendParams(false),
publishedFilter = unpublishedToBackendParams(false),
pageParams = paginationToBackendParams(0, 10),
filterParams = {}
) => ({ payload: { filterToGroup, gradedFilter, pageParams, filterParams } })
) => ({ payload: { filterToGroup, publishedFilter, pageParams, filterParams } })
);

export const fetchTeamFormationOverviews = createAction(
Expand Down Expand Up @@ -326,6 +328,18 @@ export const unsubmitSubmission = createAction(UNSUBMIT_SUBMISSION, (submissionI
payload: { submissionId }
}));

/**
* Publishing / unpublishing actions
*/

export const publishGrading = createAction(PUBLISH_GRADING, (submissionId: number) => ({
payload: { submissionId }
}));

export const unpublishGrading = createAction(UNPUBLISH_GRADING, (submissionId: number) => ({
payload: { submissionId }
}));

/**
* Notification actions
*/
Expand Down
52 changes: 40 additions & 12 deletions src/commons/application/actions/__tests__/SessionActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import { Chapter, Variant } from 'js-slang/dist/types';
import { mockStudents } from 'src/commons/mocks/UserMocks';
import {
paginationToBackendParams,
ungradedToBackendParams
unpublishedToBackendParams
} from 'src/features/grading/GradingUtils';

import { GradingOverviews, GradingQuery } from '../../../../features/grading/GradingTypes';
import { TeamFormationOverview } from '../../../../features/teamFormation/TeamFormationTypes';
import { Assessment, AssessmentOverview } from '../../../assessment/AssessmentTypes';
import {
Assessment,
AssessmentConfiguration,
AssessmentOverview,
AssessmentStatuses,
ProgressStatuses
} from '../../../assessment/AssessmentTypes';
import { Notification } from '../../../notificationBadge/NotificationBadgeTypes';
import { GameState, Role, Story } from '../../ApplicationTypes';
import {
Expand Down Expand Up @@ -172,7 +178,7 @@ test('fetchGradingOverviews generates correct default action object', () => {
type: FETCH_GRADING_OVERVIEWS,
payload: {
filterToGroup: true,
gradedFilter: ungradedToBackendParams(false),
publishedFilter: unpublishedToBackendParams(false),
pageParams: paginationToBackendParams(0, 10),
filterParams: {}
}
Expand All @@ -181,15 +187,15 @@ test('fetchGradingOverviews generates correct default action object', () => {

test('fetchGradingOverviews generates correct action object', () => {
const filterToGroup = false;
const gradedFilter = ungradedToBackendParams(true);
const publishedFilter = unpublishedToBackendParams(true);
const pageParams = { offset: 123, pageSize: 456 };
const filterParams = { abc: 'xxx', def: 'yyy' };
const action = fetchGradingOverviews(filterToGroup, gradedFilter, pageParams, filterParams);
const action = fetchGradingOverviews(filterToGroup, publishedFilter, pageParams, filterParams);
expect(action).toEqual({
type: FETCH_GRADING_OVERVIEWS,
payload: {
filterToGroup: filterToGroup,
gradedFilter: gradedFilter,
publishedFilter: publishedFilter,
pageParams: pageParams,
filterParams: filterParams
}
Expand Down Expand Up @@ -328,11 +334,12 @@ test('setCourseRegistration generates correct action object', () => {
});

test('setAssessmentConfigurations generates correct action object', () => {
const assesmentConfigurations = [
const assesmentConfigurations: AssessmentConfiguration[] = [
{
assessmentConfigId: 1,
type: 'Mission1',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand All @@ -343,6 +350,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
assessmentConfigId: 2,
type: 'Mission2',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand All @@ -353,6 +361,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
assessmentConfigId: 3,
type: 'Mission3',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand Down Expand Up @@ -533,6 +542,7 @@ test('updateAssessmentOverviews generates correct action object', () => {
{
type: 'Missions',
isManuallyGraded: true,
isPublished: false,
closeAt: 'test_string',
coverImage: 'test_string',
id: 0,
Expand All @@ -541,10 +551,10 @@ test('updateAssessmentOverviews generates correct action object', () => {
openAt: 'test_string',
title: 'test_string',
shortSummary: 'test_string',
status: 'not_attempted',
status: AssessmentStatuses.not_attempted,
story: null,
xp: 0,
gradingStatus: 'none',
isGradingPublished: false,
maxTeamSize: 1,
hasVotingFeatures: false
}
Expand Down Expand Up @@ -595,9 +605,10 @@ test('updateGradingOverviews generates correct action object', () => {
studentUsername: 'E0123456',
studentUsernames: [],
submissionId: 1,
submissionStatus: 'attempting',
isGradingPublished: false,
progress: ProgressStatuses.attempting,
groupName: 'group',
gradingStatus: 'excluded',
submissionStatus: AssessmentStatuses.attempting,
questionCount: 6,
gradedCount: 0
}
Expand Down Expand Up @@ -772,6 +783,7 @@ test('updateAssessmentTypes generates correct action object', () => {
assessmentConfigId: 1,
type: 'Missions',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand All @@ -782,6 +794,7 @@ test('updateAssessmentTypes generates correct action object', () => {
assessmentConfigId: 2,
type: 'Quests',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand All @@ -791,7 +804,8 @@ test('updateAssessmentTypes generates correct action object', () => {
{
assessmentConfigId: 3,
type: 'Paths',
isManuallyGraded: true,
isManuallyGraded: false,
isGradingAutoPublished: true,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand All @@ -802,6 +816,7 @@ test('updateAssessmentTypes generates correct action object', () => {
assessmentConfigId: 4,
type: 'Contests',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand All @@ -810,8 +825,20 @@ test('updateAssessmentTypes generates correct action object', () => {
},
{
assessmentConfigId: 5,
type: 'PEs',
isManuallyGraded: false,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
hoursBeforeEarlyXpDecay: 0,
earlySubmissionXp: 0
},
{
assessmentConfigId: 6,
type: 'Others',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand All @@ -831,6 +858,7 @@ test('deleteAssessmentConfig generates correct action object', () => {
assessmentConfigId: 1,
type: 'Mission1',
isManuallyGraded: true,
isGradingAutoPublished: false,
displayInDashboard: true,
hasTokenCounter: false,
hasVotingFeatures: false,
Expand Down
Loading
Loading