@instructure/platform-grades 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssignmentGroupScoresTable.d.ts +11 -0
- package/dist/components/AssignmentGroupScoresTable.d.ts.map +1 -0
- package/dist/components/AssignmentScoresTable.d.ts +24 -0
- package/dist/components/AssignmentScoresTable.d.ts.map +1 -0
- package/dist/components/CollapsibleSection.d.ts +3 -0
- package/dist/components/CollapsibleSection.d.ts.map +1 -0
- package/dist/components/FeedbackIndicator.d.ts +6 -0
- package/dist/components/FeedbackIndicator.d.ts.map +1 -0
- package/dist/components/ScoreDisplay.d.ts +7 -0
- package/dist/components/ScoreDisplay.d.ts.map +1 -0
- package/dist/components/SubmissionStatusPill.d.ts +14 -0
- package/dist/components/SubmissionStatusPill.d.ts.map +1 -0
- package/dist/components/TotalScoreHeading.d.ts +10 -0
- package/dist/components/TotalScoreHeading.d.ts.map +1 -0
- package/dist/graphql/queries.d.ts +3 -0
- package/dist/graphql/queries.d.ts.map +1 -0
- package/dist/graphql/schemas.d.ts +8 -0
- package/dist/graphql/schemas.d.ts.map +1 -0
- package/dist/graphql/types.d.ts +16 -0
- package/dist/graphql/types.d.ts.map +1 -0
- package/dist/hooks/useGetCourseScores.d.ts +9 -0
- package/dist/hooks/useGetCourseScores.d.ts.map +1 -0
- package/dist/hooks/useGetCourseSettings.d.ts +8 -0
- package/dist/hooks/useGetCourseSettings.d.ts.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +471 -0
- package/dist/mocks/fixtures.d.ts +9 -0
- package/dist/mocks/fixtures.d.ts.map +1 -0
- package/dist/pages/ScoresPage.d.ts +13 -0
- package/dist/pages/ScoresPage.d.ts.map +1 -0
- package/dist/types/props.d.ts +39 -0
- package/dist/types/props.d.ts.map +1 -0
- package/dist/types/scores.d.ts +98 -0
- package/dist/types/scores.d.ts.map +1 -0
- package/dist/utils/dataTransformers.d.ts +4 -0
- package/dist/utils/dataTransformers.d.ts.map +1 -0
- package/dist/utils/scoresUtils.d.ts +5 -0
- package/dist/utils/scoresUtils.d.ts.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AssignmentGroupWeight } from '../types/scores';
|
|
2
|
+
export interface AssignmentGroupScoresTableProps {
|
|
3
|
+
groups: AssignmentGroupWeight[];
|
|
4
|
+
labels?: {
|
|
5
|
+
caption?: string;
|
|
6
|
+
assignmentGroup?: string;
|
|
7
|
+
weight?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function AssignmentGroupScoresTable({ groups, labels, }: AssignmentGroupScoresTableProps): React.ReactElement;
|
|
11
|
+
//# sourceMappingURL=AssignmentGroupScoresTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignmentGroupScoresTable.d.ts","sourceRoot":"","sources":["../../src/components/AssignmentGroupScoresTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAE5D,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/B,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAQD,wBAAgB,0BAA0B,CAAC,EACzC,MAAM,EACN,MAAM,GACP,EAAE,+BAA+B,GAAG,KAAK,CAAC,YAAY,CA6BtD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AssignmentLevelScore } from '../types/scores';
|
|
2
|
+
export interface AssignmentScoresTableProps {
|
|
3
|
+
scores: AssignmentLevelScore[];
|
|
4
|
+
restrictQuantitativeData?: boolean;
|
|
5
|
+
onAssignmentClick?: (assignmentId: string) => void;
|
|
6
|
+
labels?: {
|
|
7
|
+
caption?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
dueDate?: string;
|
|
10
|
+
status?: string;
|
|
11
|
+
result?: string;
|
|
12
|
+
feedback?: string;
|
|
13
|
+
noAssignments?: string;
|
|
14
|
+
};
|
|
15
|
+
statusLabels?: {
|
|
16
|
+
submitted?: string;
|
|
17
|
+
notSubmitted?: string;
|
|
18
|
+
late?: string;
|
|
19
|
+
excused?: string;
|
|
20
|
+
missing?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function AssignmentScoresTable({ scores, onAssignmentClick, labels, statusLabels, }: AssignmentScoresTableProps): React.ReactElement;
|
|
24
|
+
//# sourceMappingURL=AssignmentScoresTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssignmentScoresTable.d.ts","sourceRoot":"","sources":["../../src/components/AssignmentScoresTable.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAQ3D,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC9B,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,aAAa,CAAC,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,YAAY,CAAC,EAAE;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAyCD,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,iBAAiB,EACjB,MAAM,EACN,YAAY,GACb,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,CAyFjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollapsibleSection.d.ts","sourceRoot":"","sources":["../../src/components/CollapsibleSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAE7D,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,eAAuB,EACvB,QAAQ,GACT,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAM9C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScoresComment } from '../types/scores';
|
|
2
|
+
export interface FeedbackIndicatorProps {
|
|
3
|
+
comments: ScoresComment[];
|
|
4
|
+
}
|
|
5
|
+
export declare function FeedbackIndicator({ comments }: FeedbackIndicatorProps): React.ReactElement;
|
|
6
|
+
//# sourceMappingURL=FeedbackIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedbackIndicator.d.ts","sourceRoot":"","sources":["../../src/components/FeedbackIndicator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CAe1F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ScoreDisplayProps {
|
|
2
|
+
score: string | number | null;
|
|
3
|
+
gradingType: string;
|
|
4
|
+
pointsPossible: number | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function ScoreDisplay({ score, gradingType, pointsPossible, }: ScoreDisplayProps): React.ReactElement;
|
|
7
|
+
//# sourceMappingURL=ScoreDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScoreDisplay.d.ts","sourceRoot":"","sources":["../../src/components/ScoreDisplay.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,cAAc,GACf,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAExC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AssignmentLevelScore } from '../types/scores';
|
|
2
|
+
export interface SubmissionStatusPillProps {
|
|
3
|
+
score: AssignmentLevelScore;
|
|
4
|
+
labels?: {
|
|
5
|
+
submitted?: string;
|
|
6
|
+
notSubmitted?: string;
|
|
7
|
+
late?: string;
|
|
8
|
+
excused?: string;
|
|
9
|
+
missing?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare function calculateSubmissionStatus(score: AssignmentLevelScore, labels: Required<NonNullable<SubmissionStatusPillProps['labels']>>): string;
|
|
13
|
+
export declare function SubmissionStatusPill({ score, labels, }: SubmissionStatusPillProps): React.ReactElement;
|
|
14
|
+
//# sourceMappingURL=SubmissionStatusPill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmissionStatusPill.d.ts","sourceRoot":"","sources":["../../src/components/SubmissionStatusPill.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE3D,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,oBAAoB,CAAA;IAC3B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAUD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,oBAAoB,EAC3B,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACjE,MAAM,CAYR;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,MAAM,GACP,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,CAchD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TotalScoreHeadingProps } from '../types/props';
|
|
2
|
+
export interface TotalScoreHeadingFullProps extends TotalScoreHeadingProps {
|
|
3
|
+
hasScoredActivities: boolean;
|
|
4
|
+
labels?: {
|
|
5
|
+
total?: string;
|
|
6
|
+
noActivities?: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function TotalScoreHeading({ currentScore, currentGrade, restrictQuantitativeData, hideFinalGrade, hasScoredActivities, labels, }: TotalScoreHeadingFullProps): React.ReactElement | null;
|
|
10
|
+
//# sourceMappingURL=TotalScoreHeading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TotalScoreHeading.d.ts","sourceRoot":"","sources":["../../src/components/TotalScoreHeading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAQ5D,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACxE,mBAAmB,EAAE,OAAO,CAAA;IAC5B,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,YAAY,CAAC,EAAE,MAAM,CAAA;KACtB,CAAA;CACF;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,MAAM,GACP,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAkBxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/graphql/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,iBAAiB,EAAE,YAyD/B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { CourseSettings, ScoresEnrollment } from '../types/scores';
|
|
3
|
+
export declare const ScoresEnrollmentSchema: ZodType<ScoresEnrollment>;
|
|
4
|
+
export declare const CourseSettingsResponseSchema: ZodType<{
|
|
5
|
+
id: number;
|
|
6
|
+
settings: CourseSettings;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/graphql/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AA2EvE,eAAO,MAAM,sBAAsB,EAAE,OAAO,CAAC,gBAAgB,CAU3D,CAAA;AAEF,eAAO,MAAM,4BAA4B,EAAE,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAA;CAAE,CAOvF,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ScoresEnrollment } from '../types/scores';
|
|
2
|
+
export interface GetCourseScoresData {
|
|
3
|
+
legacyNode: ScoresEnrollment;
|
|
4
|
+
}
|
|
5
|
+
export interface GetCourseScoresVariables {
|
|
6
|
+
enrollmentId: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GetCourseSettingsData {
|
|
10
|
+
id: number;
|
|
11
|
+
settings: {
|
|
12
|
+
restrict_quantitative_data: boolean | null;
|
|
13
|
+
hide_final_grade: boolean | null;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graphql/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,gBAAgB,CAAA;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE;QACR,0BAA0B,EAAE,OAAO,GAAG,IAAI,CAAA;QAC1C,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAA;KACjC,CAAA;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { ScoresEnrollment } from '../types/scores';
|
|
3
|
+
export interface UseGetCourseScoresOptions {
|
|
4
|
+
enrollmentId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function useGetCourseScores({ enrollmentId, userId, enabled, }: UseGetCourseScoresOptions): UseQueryResult<ScoresEnrollment, Error>;
|
|
9
|
+
//# sourceMappingURL=useGetCourseScores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetCourseScores.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetCourseScores.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,uBAAuB,CAAA;AAIrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,YAAY,EACZ,MAAM,EACN,OAAc,GACf,EAAE,yBAAyB,GAAG,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAiBrE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { CourseSettings } from '../types/scores';
|
|
3
|
+
export interface UseGetCourseSettingsOptions {
|
|
4
|
+
courseId: string;
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function useGetCourseSettings({ courseId, enabled, }: UseGetCourseSettingsOptions): UseQueryResult<CourseSettings, Error>;
|
|
8
|
+
//# sourceMappingURL=useGetCourseSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetCourseSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetCourseSettings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,uBAAuB,CAAA;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,OAAc,GACf,EAAE,2BAA2B,GAAG,cAAc,CAAC,cAAc,EAAE,KAAK,CAAC,CAerE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type { ScoresPageFullProps, ScoresPageLabels } from './pages/ScoresPage';
|
|
2
|
+
export { ScoresPage } from './pages/ScoresPage';
|
|
3
|
+
export type { AssignmentGroupScoresTableProps as AssignmentGroupScoresTableComponentProps } from './components/AssignmentGroupScoresTable';
|
|
4
|
+
export { AssignmentGroupScoresTable } from './components/AssignmentGroupScoresTable';
|
|
5
|
+
export type { AssignmentScoresTableProps as AssignmentScoresTableComponentProps } from './components/AssignmentScoresTable';
|
|
6
|
+
export { AssignmentScoresTable } from './components/AssignmentScoresTable';
|
|
7
|
+
export { CollapsibleSection } from './components/CollapsibleSection';
|
|
8
|
+
export type { FeedbackIndicatorProps } from './components/FeedbackIndicator';
|
|
9
|
+
export { FeedbackIndicator } from './components/FeedbackIndicator';
|
|
10
|
+
export type { ScoreDisplayProps } from './components/ScoreDisplay';
|
|
11
|
+
export { ScoreDisplay } from './components/ScoreDisplay';
|
|
12
|
+
export type { SubmissionStatusPillProps } from './components/SubmissionStatusPill';
|
|
13
|
+
export { calculateSubmissionStatus, SubmissionStatusPill } from './components/SubmissionStatusPill';
|
|
14
|
+
export type { TotalScoreHeadingFullProps } from './components/TotalScoreHeading';
|
|
15
|
+
export { TotalScoreHeading } from './components/TotalScoreHeading';
|
|
16
|
+
export type { UseGetCourseScoresOptions } from './hooks/useGetCourseScores';
|
|
17
|
+
export { useGetCourseScores } from './hooks/useGetCourseScores';
|
|
18
|
+
export type { UseGetCourseSettingsOptions } from './hooks/useGetCourseSettings';
|
|
19
|
+
export { useGetCourseSettings } from './hooks/useGetCourseSettings';
|
|
20
|
+
export type { CollapsibleSectionProps, ScoreOptionsInputProps, ScoresPageProps, TotalScoreHeadingProps, } from './types/props';
|
|
21
|
+
export type { AssignmentGroupLevelScores, AssignmentGroupWeight, AssignmentLevelScore, CourseSettings, GradingType, GradingTypeValue, ScoresAssignment, ScoresAssignmentGroup, ScoresComment, ScoresCourse, ScoresEnrollment, ScoresGrade, ScoresSubmission, SubmissionStatus, SubmissionType, } from './types/scores';
|
|
22
|
+
export { transformAssignmentGroupScores, transformAssignmentScores } from './utils/dataTransformers';
|
|
23
|
+
export { formatScore, getTotalScore, isNonNumericGradingType, shouldUseFormattedGrade, } from './utils/scoresUtils';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAI/C,YAAY,EAAE,+BAA+B,IAAI,wCAAwC,EAAE,MAAM,yCAAyC,CAAA;AAC1I,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACpF,YAAY,EAAE,0BAA0B,IAAI,mCAAmC,EAAE,MAAM,oCAAoC,CAAA;AAC3H,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,YAAY,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACnG,YAAY,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,YAAY,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAGnE,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,GACvB,MAAM,eAAe,CAAA;AAGtB,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EACL,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner as F } from "@instructure/ui-spinner";
|
|
3
|
+
import { Text as g } from "@instructure/ui-text";
|
|
4
|
+
import { View as T } from "@instructure/ui-view";
|
|
5
|
+
import { useState as x, useCallback as q, useMemo as v } from "react";
|
|
6
|
+
import { Table as d } from "@instructure/ui-table";
|
|
7
|
+
import { Pill as $ } from "@instructure/ui-pill";
|
|
8
|
+
import { ToggleDetails as H } from "@instructure/ui-toggle-details";
|
|
9
|
+
import { Heading as P } from "@instructure/ui-heading";
|
|
10
|
+
import { usePlatformUi as R } from "@instructure/platform-provider";
|
|
11
|
+
import { useQuery as w } from "@tanstack/react-query";
|
|
12
|
+
import { gql as k } from "graphql-tag";
|
|
13
|
+
import { z as r } from "zod";
|
|
14
|
+
import { canvasFetch as I } from "@instructure/platform-canvas-fetch";
|
|
15
|
+
const D = {
|
|
16
|
+
caption: "Assignment Group Totals",
|
|
17
|
+
assignmentGroup: "Assignment Group",
|
|
18
|
+
weight: "Weight"
|
|
19
|
+
};
|
|
20
|
+
function N({
|
|
21
|
+
groups: t,
|
|
22
|
+
labels: e
|
|
23
|
+
}) {
|
|
24
|
+
const n = {
|
|
25
|
+
caption: (e == null ? void 0 : e.caption) ?? D.caption,
|
|
26
|
+
assignmentGroup: (e == null ? void 0 : e.assignmentGroup) ?? D.assignmentGroup,
|
|
27
|
+
weight: (e == null ? void 0 : e.weight) ?? D.weight
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ h(d, { caption: n.caption, children: [
|
|
30
|
+
/* @__PURE__ */ o(d.Head, { children: /* @__PURE__ */ h(d.Row, { children: [
|
|
31
|
+
/* @__PURE__ */ o(d.ColHeader, { id: "group-name", children: n.assignmentGroup }),
|
|
32
|
+
/* @__PURE__ */ o(d.ColHeader, { id: "group-weight", children: n.weight })
|
|
33
|
+
] }) }),
|
|
34
|
+
/* @__PURE__ */ o(d.Body, { children: t.map((s) => /* @__PURE__ */ h(d.Row, { children: [
|
|
35
|
+
/* @__PURE__ */ o(d.Cell, { children: /* @__PURE__ */ o(g, { children: s.groupName }) }),
|
|
36
|
+
/* @__PURE__ */ o(d.Cell, { children: /* @__PURE__ */ h(g, { children: [
|
|
37
|
+
s.groupWeight,
|
|
38
|
+
"%"
|
|
39
|
+
] }) })
|
|
40
|
+
] }, s.groupId)) })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
const j = (t, e, n) => t ? n ?? "-" : e != null ? `${Math.round(e)}%` : "-", W = (t) => t === "letter_grade" || t === "gpa_scale" || t === "pass_fail", U = (t, e) => !!t || W(e), E = (t, e, n) => {
|
|
44
|
+
const s = n ?? 0;
|
|
45
|
+
return W(e) ? t !== null ? String(t) : "-" : `${t !== null ? t : "-"}/${s}`;
|
|
46
|
+
};
|
|
47
|
+
function B({ comments: t }) {
|
|
48
|
+
if (t.length === 0)
|
|
49
|
+
return /* @__PURE__ */ o(g, { children: "-" });
|
|
50
|
+
const e = t.some((n) => !n.read);
|
|
51
|
+
return /* @__PURE__ */ o(T, { as: "span", display: "inline-flex", children: /* @__PURE__ */ h(g, { children: [
|
|
52
|
+
e ? "• " : "",
|
|
53
|
+
t.length
|
|
54
|
+
] }) });
|
|
55
|
+
}
|
|
56
|
+
const _ = {
|
|
57
|
+
submitted: "Submitted",
|
|
58
|
+
notSubmitted: "Not Submitted",
|
|
59
|
+
late: "Late",
|
|
60
|
+
excused: "Excused",
|
|
61
|
+
missing: "Missing"
|
|
62
|
+
};
|
|
63
|
+
function Q(t, e) {
|
|
64
|
+
return t.state === "submitted" || t.state === "pending_review" || t.state === "graded" && t.score !== null ? e.submitted : t.excused ? e.excused : t.late ? e.late : t.missing ? e.missing : e.notSubmitted;
|
|
65
|
+
}
|
|
66
|
+
function M({
|
|
67
|
+
score: t,
|
|
68
|
+
labels: e
|
|
69
|
+
}) {
|
|
70
|
+
const n = {
|
|
71
|
+
submitted: (e == null ? void 0 : e.submitted) ?? _.submitted,
|
|
72
|
+
notSubmitted: (e == null ? void 0 : e.notSubmitted) ?? _.notSubmitted,
|
|
73
|
+
late: (e == null ? void 0 : e.late) ?? _.late,
|
|
74
|
+
excused: (e == null ? void 0 : e.excused) ?? _.excused,
|
|
75
|
+
missing: (e == null ? void 0 : e.missing) ?? _.missing
|
|
76
|
+
}, s = Q(t, n), a = s === n.late || s === n.missing ? "danger" : "info";
|
|
77
|
+
return /* @__PURE__ */ o($, { color: a, children: s });
|
|
78
|
+
}
|
|
79
|
+
const S = {
|
|
80
|
+
caption: "Assignment Scores",
|
|
81
|
+
name: "Name",
|
|
82
|
+
dueDate: "Due Date",
|
|
83
|
+
status: "Status",
|
|
84
|
+
result: "Result",
|
|
85
|
+
feedback: "Feedback",
|
|
86
|
+
noAssignments: "No assignments"
|
|
87
|
+
};
|
|
88
|
+
function z(t) {
|
|
89
|
+
return t ? new Date(t).toLocaleDateString(void 0, {
|
|
90
|
+
year: "numeric",
|
|
91
|
+
month: "short",
|
|
92
|
+
day: "numeric"
|
|
93
|
+
}) : "-";
|
|
94
|
+
}
|
|
95
|
+
function K(t, e, n) {
|
|
96
|
+
if (n === "none") return t;
|
|
97
|
+
const s = [...t].sort((i, a) => {
|
|
98
|
+
if (e === "name")
|
|
99
|
+
return i.name.localeCompare(a.name);
|
|
100
|
+
const c = i.dueAt ? new Date(i.dueAt).getTime() : 0, u = a.dueAt ? new Date(a.dueAt).getTime() : 0;
|
|
101
|
+
return c - u;
|
|
102
|
+
});
|
|
103
|
+
return n === "descending" ? s.reverse() : s;
|
|
104
|
+
}
|
|
105
|
+
function O({
|
|
106
|
+
scores: t,
|
|
107
|
+
onAssignmentClick: e,
|
|
108
|
+
labels: n,
|
|
109
|
+
statusLabels: s
|
|
110
|
+
}) {
|
|
111
|
+
const i = {
|
|
112
|
+
caption: (n == null ? void 0 : n.caption) ?? S.caption,
|
|
113
|
+
name: (n == null ? void 0 : n.name) ?? S.name,
|
|
114
|
+
dueDate: (n == null ? void 0 : n.dueDate) ?? S.dueDate,
|
|
115
|
+
status: (n == null ? void 0 : n.status) ?? S.status,
|
|
116
|
+
result: (n == null ? void 0 : n.result) ?? S.result,
|
|
117
|
+
feedback: (n == null ? void 0 : n.feedback) ?? S.feedback,
|
|
118
|
+
noAssignments: (n == null ? void 0 : n.noAssignments) ?? S.noAssignments
|
|
119
|
+
}, [a, c] = x("name"), [u, p] = x("none"), f = q(
|
|
120
|
+
(m, { id: A }) => {
|
|
121
|
+
const y = A;
|
|
122
|
+
y === a ? p((C) => C === "ascending" ? "descending" : "ascending") : (c(y), p("ascending"));
|
|
123
|
+
},
|
|
124
|
+
[a]
|
|
125
|
+
), G = v(
|
|
126
|
+
() => K(t, a, u),
|
|
127
|
+
[t, a, u]
|
|
128
|
+
), l = (m) => m === a ? u : "none";
|
|
129
|
+
return t.length === 0 ? /* @__PURE__ */ o(g, { children: i.noAssignments }) : /* @__PURE__ */ h(d, { caption: i.caption, hover: !!e, children: [
|
|
130
|
+
/* @__PURE__ */ o(d.Head, { renderSortLabel: "Sort by", children: /* @__PURE__ */ h(d.Row, { children: [
|
|
131
|
+
/* @__PURE__ */ o(
|
|
132
|
+
d.ColHeader,
|
|
133
|
+
{
|
|
134
|
+
id: "name",
|
|
135
|
+
onRequestSort: f,
|
|
136
|
+
sortDirection: l("name"),
|
|
137
|
+
children: i.name
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ o(
|
|
141
|
+
d.ColHeader,
|
|
142
|
+
{
|
|
143
|
+
id: "dueDate",
|
|
144
|
+
onRequestSort: f,
|
|
145
|
+
sortDirection: l("dueDate"),
|
|
146
|
+
children: i.dueDate
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ o(d.ColHeader, { id: "status", children: i.status }),
|
|
150
|
+
/* @__PURE__ */ o(d.ColHeader, { id: "result", children: i.result }),
|
|
151
|
+
/* @__PURE__ */ o(d.ColHeader, { id: "feedback", children: i.feedback })
|
|
152
|
+
] }) }),
|
|
153
|
+
/* @__PURE__ */ o(d.Body, { children: G.map((m) => /* @__PURE__ */ h(
|
|
154
|
+
d.Row,
|
|
155
|
+
{
|
|
156
|
+
onClick: e ? () => e(m.assignmentId) : void 0,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ o(d.Cell, { children: /* @__PURE__ */ o(g, { children: m.name }) }),
|
|
159
|
+
/* @__PURE__ */ o(d.Cell, { children: /* @__PURE__ */ o(g, { children: m.dueAt ? z(m.dueAt) : "-" }) }),
|
|
160
|
+
/* @__PURE__ */ o(d.Cell, { children: /* @__PURE__ */ o(M, { score: m, labels: s }) }),
|
|
161
|
+
/* @__PURE__ */ o(d.Cell, { children: /* @__PURE__ */ o(g, { children: E(m.score, m.gradingType, m.pointsPossible) }) }),
|
|
162
|
+
/* @__PURE__ */ o(d.Cell, { children: /* @__PURE__ */ o(B, { comments: m.comments }) })
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
m.assignmentId
|
|
166
|
+
)) })
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
function V({
|
|
170
|
+
title: t,
|
|
171
|
+
defaultExpanded: e = !1,
|
|
172
|
+
children: n
|
|
173
|
+
}) {
|
|
174
|
+
return /* @__PURE__ */ o(H, { summary: t, defaultExpanded: e, children: n });
|
|
175
|
+
}
|
|
176
|
+
const L = {
|
|
177
|
+
total: "Total: {{score}}",
|
|
178
|
+
noActivities: "There are no scored activities in this course."
|
|
179
|
+
};
|
|
180
|
+
function J({
|
|
181
|
+
currentScore: t,
|
|
182
|
+
currentGrade: e,
|
|
183
|
+
restrictQuantitativeData: n,
|
|
184
|
+
hideFinalGrade: s,
|
|
185
|
+
hasScoredActivities: i,
|
|
186
|
+
labels: a
|
|
187
|
+
}) {
|
|
188
|
+
const c = {
|
|
189
|
+
total: (a == null ? void 0 : a.total) ?? L.total,
|
|
190
|
+
noActivities: (a == null ? void 0 : a.noActivities) ?? L.noActivities
|
|
191
|
+
};
|
|
192
|
+
if (!i)
|
|
193
|
+
return /* @__PURE__ */ o(g, { children: c.noActivities });
|
|
194
|
+
if (s)
|
|
195
|
+
return null;
|
|
196
|
+
const u = j(n, t, e), p = c.total.replace("{{score}}", u);
|
|
197
|
+
return /* @__PURE__ */ o(P, { level: "h2", children: p });
|
|
198
|
+
}
|
|
199
|
+
const X = k`
|
|
200
|
+
query GetSubmissionScoresForCourse($enrollmentId: ID!, $userId: ID!) {
|
|
201
|
+
legacyNode(_id: $enrollmentId, type: Enrollment) {
|
|
202
|
+
... on Enrollment {
|
|
203
|
+
grades {
|
|
204
|
+
finalScore
|
|
205
|
+
finalGrade
|
|
206
|
+
currentScore
|
|
207
|
+
currentGrade
|
|
208
|
+
}
|
|
209
|
+
course {
|
|
210
|
+
applyGroupWeights
|
|
211
|
+
assignmentGroups {
|
|
212
|
+
_id
|
|
213
|
+
name
|
|
214
|
+
groupWeight
|
|
215
|
+
gradesConnection(filter: { enrollmentIds: [$enrollmentId] }) {
|
|
216
|
+
nodes {
|
|
217
|
+
currentScore
|
|
218
|
+
finalScore
|
|
219
|
+
state
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
assignmentsConnection {
|
|
223
|
+
nodes {
|
|
224
|
+
_id
|
|
225
|
+
name
|
|
226
|
+
pointsPossible
|
|
227
|
+
dueAt
|
|
228
|
+
gradingType
|
|
229
|
+
submissionsConnection(
|
|
230
|
+
filter: { includeUnsubmitted: true, userId: $userId }
|
|
231
|
+
) {
|
|
232
|
+
nodes {
|
|
233
|
+
state
|
|
234
|
+
late
|
|
235
|
+
excused
|
|
236
|
+
missing
|
|
237
|
+
score
|
|
238
|
+
grade
|
|
239
|
+
submissionStatus
|
|
240
|
+
commentsConnection {
|
|
241
|
+
nodes {
|
|
242
|
+
_id
|
|
243
|
+
read
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
submissionTypes
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
`, Y = r.enum([
|
|
257
|
+
"attendance",
|
|
258
|
+
"basic_lti_launch",
|
|
259
|
+
"discussion_topic",
|
|
260
|
+
"external_tool",
|
|
261
|
+
"media_recording",
|
|
262
|
+
"none",
|
|
263
|
+
"not_graded",
|
|
264
|
+
"on_paper",
|
|
265
|
+
"online_quiz",
|
|
266
|
+
"online_text_entry",
|
|
267
|
+
"online_upload",
|
|
268
|
+
"online_url",
|
|
269
|
+
"student_annotation",
|
|
270
|
+
"wiki_page"
|
|
271
|
+
]), Z = r.object({
|
|
272
|
+
_id: r.string(),
|
|
273
|
+
read: r.boolean()
|
|
274
|
+
}), b = r.object({
|
|
275
|
+
currentScore: r.number().nullable(),
|
|
276
|
+
finalScore: r.number().nullable(),
|
|
277
|
+
finalGrade: r.string().nullable(),
|
|
278
|
+
state: r.string()
|
|
279
|
+
}), ee = r.object({
|
|
280
|
+
state: r.string(),
|
|
281
|
+
submissionStatus: r.string(),
|
|
282
|
+
late: r.boolean(),
|
|
283
|
+
excused: r.boolean(),
|
|
284
|
+
missing: r.boolean(),
|
|
285
|
+
score: r.number().nullable(),
|
|
286
|
+
grade: r.string().nullable(),
|
|
287
|
+
commentsConnection: r.object({
|
|
288
|
+
nodes: r.array(Z)
|
|
289
|
+
})
|
|
290
|
+
}), te = r.object({
|
|
291
|
+
_id: r.string(),
|
|
292
|
+
name: r.string(),
|
|
293
|
+
dueAt: r.string().nullable(),
|
|
294
|
+
pointsPossible: r.number().nullable(),
|
|
295
|
+
gradingType: r.string(),
|
|
296
|
+
submissionsConnection: r.object({
|
|
297
|
+
nodes: r.array(ee)
|
|
298
|
+
}),
|
|
299
|
+
submissionTypes: r.array(Y)
|
|
300
|
+
}).strict(), ne = r.object({
|
|
301
|
+
_id: r.string(),
|
|
302
|
+
name: r.string(),
|
|
303
|
+
groupWeight: r.number().nullable(),
|
|
304
|
+
gradesConnection: r.object({
|
|
305
|
+
nodes: r.array(b)
|
|
306
|
+
}),
|
|
307
|
+
assignmentsConnection: r.object({
|
|
308
|
+
nodes: r.array(te)
|
|
309
|
+
})
|
|
310
|
+
}), re = r.object({
|
|
311
|
+
applyGroupWeights: r.boolean(),
|
|
312
|
+
assignmentGroups: r.array(ne)
|
|
313
|
+
}), ie = r.object({
|
|
314
|
+
grades: r.object({
|
|
315
|
+
finalScore: r.number().nullable(),
|
|
316
|
+
finalGrade: r.string().nullable(),
|
|
317
|
+
currentScore: r.number().nullable(),
|
|
318
|
+
currentGrade: r.string().nullable()
|
|
319
|
+
}).nullable(),
|
|
320
|
+
course: re
|
|
321
|
+
}), oe = r.object({
|
|
322
|
+
id: r.number(),
|
|
323
|
+
settings: r.object({
|
|
324
|
+
restrict_quantitative_data: r.boolean().nullable(),
|
|
325
|
+
hide_final_grade: r.boolean().nullable()
|
|
326
|
+
})
|
|
327
|
+
});
|
|
328
|
+
function ae({
|
|
329
|
+
enrollmentId: t,
|
|
330
|
+
userId: e,
|
|
331
|
+
enabled: n = !0
|
|
332
|
+
}) {
|
|
333
|
+
const { executeQuery: s } = R();
|
|
334
|
+
return w({
|
|
335
|
+
queryKey: ["courseScores", t, e],
|
|
336
|
+
enabled: n && !!t && !!e,
|
|
337
|
+
queryFn: async () => {
|
|
338
|
+
const i = await s(
|
|
339
|
+
X,
|
|
340
|
+
{ enrollmentId: t, userId: e }
|
|
341
|
+
);
|
|
342
|
+
return ie.parse(i.legacyNode);
|
|
343
|
+
},
|
|
344
|
+
gcTime: 0
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
function se({
|
|
348
|
+
courseId: t,
|
|
349
|
+
enabled: e = !0
|
|
350
|
+
}) {
|
|
351
|
+
return w({
|
|
352
|
+
queryKey: ["courseSettings", t],
|
|
353
|
+
enabled: e && !!t,
|
|
354
|
+
queryFn: async () => (await I(
|
|
355
|
+
{
|
|
356
|
+
path: `/api/v1/courses/${t}`,
|
|
357
|
+
params: { "include[]": "settings" }
|
|
358
|
+
},
|
|
359
|
+
oe
|
|
360
|
+
)).data.settings
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function ce(t, e) {
|
|
364
|
+
const { course: n, grades: s } = t, i = n.assignmentGroups.map((c) => ({
|
|
365
|
+
groupId: c._id,
|
|
366
|
+
groupName: c.name,
|
|
367
|
+
groupWeight: c.groupWeight ?? 0
|
|
368
|
+
}));
|
|
369
|
+
return {
|
|
370
|
+
totalScore: j(
|
|
371
|
+
e == null ? void 0 : e.restrict_quantitative_data,
|
|
372
|
+
s == null ? void 0 : s.currentScore,
|
|
373
|
+
s == null ? void 0 : s.currentGrade
|
|
374
|
+
),
|
|
375
|
+
applyGroupWeights: n.applyGroupWeights,
|
|
376
|
+
assignmentGroupWeights: i
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function de(t, e) {
|
|
380
|
+
return t.course.assignmentGroups.flatMap(
|
|
381
|
+
(n) => n.assignmentsConnection.nodes.map((s) => {
|
|
382
|
+
var u;
|
|
383
|
+
const i = s.submissionsConnection.nodes[0], c = U(
|
|
384
|
+
e == null ? void 0 : e.restrict_quantitative_data,
|
|
385
|
+
s.gradingType
|
|
386
|
+
) ? i == null ? void 0 : i.grade : (u = i == null ? void 0 : i.score) == null ? void 0 : u.toString();
|
|
387
|
+
return {
|
|
388
|
+
assignmentId: s._id,
|
|
389
|
+
name: s.name,
|
|
390
|
+
pointsPossible: s.pointsPossible ?? 0,
|
|
391
|
+
dueAt: s.dueAt ?? "",
|
|
392
|
+
score: c ?? null,
|
|
393
|
+
gradingType: s.gradingType,
|
|
394
|
+
state: (i == null ? void 0 : i.state) ?? "",
|
|
395
|
+
submissionStatus: (i == null ? void 0 : i.submissionStatus) ?? "",
|
|
396
|
+
comments: (i == null ? void 0 : i.commentsConnection.nodes) ?? [],
|
|
397
|
+
late: (i == null ? void 0 : i.late) ?? !1,
|
|
398
|
+
excused: (i == null ? void 0 : i.excused) ?? !1,
|
|
399
|
+
missing: (i == null ? void 0 : i.missing) ?? !1,
|
|
400
|
+
submissionTypes: s.submissionTypes
|
|
401
|
+
};
|
|
402
|
+
})
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
function De({
|
|
406
|
+
courseId: t,
|
|
407
|
+
enrollmentId: e,
|
|
408
|
+
userId: n,
|
|
409
|
+
onAssignmentClick: s,
|
|
410
|
+
onError: i,
|
|
411
|
+
labels: a
|
|
412
|
+
}) {
|
|
413
|
+
var l, m, A, y, C;
|
|
414
|
+
const c = ae({ enrollmentId: e, userId: n }), u = se({ courseId: t }), p = v(() => c.data ? ce(c.data, u.data) : null, [c.data, u.data]), f = v(() => c.data ? de(c.data, u.data) : [], [c.data, u.data]);
|
|
415
|
+
if (c.isPending)
|
|
416
|
+
return /* @__PURE__ */ o(F, { renderTitle: (a == null ? void 0 : a.loading) ?? "Loading..." });
|
|
417
|
+
if (c.isError)
|
|
418
|
+
return i && c.error && i(c.error), /* @__PURE__ */ o(T, { as: "div", padding: "medium", children: /* @__PURE__ */ o(g, { color: "danger", children: (a == null ? void 0 : a.error) ?? "Failed to load scores." }) });
|
|
419
|
+
const G = f.length > 0;
|
|
420
|
+
return /* @__PURE__ */ h(T, { as: "div", children: [
|
|
421
|
+
/* @__PURE__ */ o(T, { as: "div", padding: "small medium", children: /* @__PURE__ */ o(
|
|
422
|
+
J,
|
|
423
|
+
{
|
|
424
|
+
currentScore: (l = c.data.grades) == null ? void 0 : l.currentScore,
|
|
425
|
+
currentGrade: (m = c.data.grades) == null ? void 0 : m.currentGrade,
|
|
426
|
+
restrictQuantitativeData: (A = u.data) == null ? void 0 : A.restrict_quantitative_data,
|
|
427
|
+
hideFinalGrade: (y = u.data) == null ? void 0 : y.hide_final_grade,
|
|
428
|
+
hasScoredActivities: G,
|
|
429
|
+
labels: {
|
|
430
|
+
total: a == null ? void 0 : a.total,
|
|
431
|
+
noActivities: a == null ? void 0 : a.noActivities
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
) }),
|
|
435
|
+
(p == null ? void 0 : p.applyGroupWeights) && /* @__PURE__ */ o(V, { title: (a == null ? void 0 : a.assignmentGroupWeights) ?? "Assignment Group Weights", children: /* @__PURE__ */ o(N, { groups: p.assignmentGroupWeights }) }),
|
|
436
|
+
G && /* @__PURE__ */ o(
|
|
437
|
+
O,
|
|
438
|
+
{
|
|
439
|
+
scores: f,
|
|
440
|
+
restrictQuantitativeData: !!((C = u.data) != null && C.restrict_quantitative_data),
|
|
441
|
+
onAssignmentClick: s
|
|
442
|
+
}
|
|
443
|
+
)
|
|
444
|
+
] });
|
|
445
|
+
}
|
|
446
|
+
function ve({
|
|
447
|
+
score: t,
|
|
448
|
+
gradingType: e,
|
|
449
|
+
pointsPossible: n
|
|
450
|
+
}) {
|
|
451
|
+
return /* @__PURE__ */ o(g, { children: E(t, e, n) });
|
|
452
|
+
}
|
|
453
|
+
export {
|
|
454
|
+
N as AssignmentGroupScoresTable,
|
|
455
|
+
O as AssignmentScoresTable,
|
|
456
|
+
V as CollapsibleSection,
|
|
457
|
+
B as FeedbackIndicator,
|
|
458
|
+
ve as ScoreDisplay,
|
|
459
|
+
De as ScoresPage,
|
|
460
|
+
M as SubmissionStatusPill,
|
|
461
|
+
J as TotalScoreHeading,
|
|
462
|
+
Q as calculateSubmissionStatus,
|
|
463
|
+
E as formatScore,
|
|
464
|
+
j as getTotalScore,
|
|
465
|
+
W as isNonNumericGradingType,
|
|
466
|
+
U as shouldUseFormattedGrade,
|
|
467
|
+
ce as transformAssignmentGroupScores,
|
|
468
|
+
de as transformAssignmentScores,
|
|
469
|
+
ae as useGetCourseScores,
|
|
470
|
+
se as useGetCourseSettings
|
|
471
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CourseSettings, ScoresEnrollment } from '../types/scores';
|
|
2
|
+
export declare const mockEnrollmentData: ScoresEnrollment;
|
|
3
|
+
export declare const mockWeightedEnrollmentData: ScoresEnrollment;
|
|
4
|
+
export declare const mockEmptyEnrollmentData: ScoresEnrollment;
|
|
5
|
+
export declare const mockLetterGradeEnrollmentData: ScoresEnrollment;
|
|
6
|
+
export declare const mockCourseSettings: CourseSettings;
|
|
7
|
+
export declare const mockRestrictedCourseSettings: CourseSettings;
|
|
8
|
+
export declare const mockHiddenGradeCourseSettings: CourseSettings;
|
|
9
|
+
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/mocks/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvE,eAAO,MAAM,kBAAkB,EAAE,gBA6GhC,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,gBAMxC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,gBAWrC,CAAA;AAED,eAAO,MAAM,6BAA6B,EAAE,gBA8C3C,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,cAGhC,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,cAG1C,CAAA;AAED,eAAO,MAAM,6BAA6B,EAAE,cAG3C,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScoresPageProps } from '../types/props';
|
|
2
|
+
export interface ScoresPageLabels {
|
|
3
|
+
loading?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
assignmentGroupWeights?: string;
|
|
6
|
+
total?: string;
|
|
7
|
+
noActivities?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ScoresPageFullProps extends ScoresPageProps {
|
|
10
|
+
labels?: ScoresPageLabels;
|
|
11
|
+
}
|
|
12
|
+
export declare function ScoresPage({ courseId, enrollmentId, userId, onAssignmentClick, onError, labels, }: ScoresPageFullProps): React.ReactElement;
|
|
13
|
+
//# sourceMappingURL=ScoresPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScoresPage.d.ts","sourceRoot":"","sources":["../../src/pages/ScoresPage.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,iBAAiB,EACjB,OAAO,EACP,MAAM,GACP,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CA8D1C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AssignmentGroupWeight, AssignmentLevelScore, GradingType } from './scores';
|
|
2
|
+
export interface ScoresPageProps {
|
|
3
|
+
courseId: string;
|
|
4
|
+
enrollmentId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
/** Called when a student clicks an assignment row. Host handles navigation. */
|
|
7
|
+
onAssignmentClick?: (assignmentId: string) => void;
|
|
8
|
+
/** Called when a data fetch error occurs. */
|
|
9
|
+
onError?: (error: Error) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface AssignmentScoresTableProps {
|
|
12
|
+
scores: AssignmentLevelScore[];
|
|
13
|
+
restrictQuantitativeData: boolean;
|
|
14
|
+
/** Called when a student clicks an assignment row. Host handles navigation. */
|
|
15
|
+
onAssignmentClick?: (assignmentId: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface AssignmentGroupScoresTableProps {
|
|
18
|
+
groups: AssignmentGroupWeight[];
|
|
19
|
+
}
|
|
20
|
+
export interface TotalScoreHeadingProps {
|
|
21
|
+
currentScore: number | null | undefined;
|
|
22
|
+
currentGrade: string | null | undefined;
|
|
23
|
+
restrictQuantitativeData: boolean | null | undefined;
|
|
24
|
+
hideFinalGrade: boolean | null | undefined;
|
|
25
|
+
}
|
|
26
|
+
export interface CollapsibleSectionProps {
|
|
27
|
+
title: string;
|
|
28
|
+
defaultExpanded?: boolean;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export interface ScoreOptionsInputProps {
|
|
32
|
+
points: number;
|
|
33
|
+
gradingType: GradingType;
|
|
34
|
+
omitFromFinalGrade?: boolean;
|
|
35
|
+
onPointsChange: (value: number) => void;
|
|
36
|
+
onGradingTypeChange: (value: GradingType) => void;
|
|
37
|
+
onOmitFromFinalGradeChange?: (value: boolean) => void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/types/props.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAIxF,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD,6CAA6C;IAC7C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC9B,wBAAwB,EAAE,OAAO,CAAA;IACjC,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD;AAED,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,qBAAqB,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACvC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACvC,wBAAwB,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;IACpD,cAAc,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAID,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,WAAW,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,mBAAmB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IACjD,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACtD"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for the grades feature.
|
|
3
|
+
* Ported from canvas-horizon learner app scores types and Zod schemas.
|
|
4
|
+
*/
|
|
5
|
+
export type SubmissionType = 'attendance' | 'basic_lti_launch' | 'discussion_topic' | 'external_tool' | 'media_recording' | 'none' | 'not_graded' | 'on_paper' | 'online_quiz' | 'online_text_entry' | 'online_upload' | 'online_url' | 'student_annotation' | 'wiki_page';
|
|
6
|
+
export type GradingTypeValue = 'points' | 'percent' | 'letter_grade' | 'gpa_scale' | 'pass_fail' | 'not_graded';
|
|
7
|
+
export interface GradingType {
|
|
8
|
+
id: GradingTypeValue;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
export type SubmissionStatus = 'submitted' | 'unsubmitted' | 'late' | 'missing' | 'excused' | 'extended' | 'graded' | 'resubmitted';
|
|
12
|
+
export interface ScoresComment {
|
|
13
|
+
_id: string;
|
|
14
|
+
read: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ScoresGrade {
|
|
17
|
+
currentScore: number | null;
|
|
18
|
+
finalScore: number | null;
|
|
19
|
+
finalGrade: string | null;
|
|
20
|
+
state: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ScoresSubmission {
|
|
23
|
+
state: string;
|
|
24
|
+
submissionStatus: string;
|
|
25
|
+
late: boolean;
|
|
26
|
+
excused: boolean;
|
|
27
|
+
missing: boolean;
|
|
28
|
+
score: number | null;
|
|
29
|
+
grade: string | null;
|
|
30
|
+
commentsConnection: {
|
|
31
|
+
nodes: ScoresComment[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface ScoresAssignment {
|
|
35
|
+
_id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
dueAt: string | null;
|
|
38
|
+
pointsPossible: number | null;
|
|
39
|
+
gradingType: string;
|
|
40
|
+
submissionsConnection: {
|
|
41
|
+
nodes: ScoresSubmission[];
|
|
42
|
+
};
|
|
43
|
+
submissionTypes: SubmissionType[];
|
|
44
|
+
}
|
|
45
|
+
export interface ScoresAssignmentGroup {
|
|
46
|
+
_id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
groupWeight: number | null;
|
|
49
|
+
gradesConnection: {
|
|
50
|
+
nodes: ScoresGrade[];
|
|
51
|
+
};
|
|
52
|
+
assignmentsConnection: {
|
|
53
|
+
nodes: ScoresAssignment[];
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface ScoresCourse {
|
|
57
|
+
applyGroupWeights: boolean;
|
|
58
|
+
assignmentGroups: ScoresAssignmentGroup[];
|
|
59
|
+
}
|
|
60
|
+
export interface ScoresEnrollment {
|
|
61
|
+
grades: {
|
|
62
|
+
finalScore: number | null;
|
|
63
|
+
finalGrade: string | null;
|
|
64
|
+
currentScore: number | null;
|
|
65
|
+
currentGrade: string | null;
|
|
66
|
+
} | null;
|
|
67
|
+
course: ScoresCourse;
|
|
68
|
+
}
|
|
69
|
+
export interface CourseSettings {
|
|
70
|
+
restrict_quantitative_data: boolean | null;
|
|
71
|
+
hide_final_grade: boolean | null;
|
|
72
|
+
}
|
|
73
|
+
export interface AssignmentGroupWeight {
|
|
74
|
+
groupId: string;
|
|
75
|
+
groupName: string;
|
|
76
|
+
groupWeight: number;
|
|
77
|
+
}
|
|
78
|
+
export interface AssignmentGroupLevelScores {
|
|
79
|
+
totalScore: string | null;
|
|
80
|
+
applyGroupWeights: boolean;
|
|
81
|
+
assignmentGroupWeights: AssignmentGroupWeight[];
|
|
82
|
+
}
|
|
83
|
+
export interface AssignmentLevelScore {
|
|
84
|
+
assignmentId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
pointsPossible: number;
|
|
87
|
+
dueAt: string;
|
|
88
|
+
score: string | null;
|
|
89
|
+
gradingType: string;
|
|
90
|
+
state: string;
|
|
91
|
+
submissionStatus: string;
|
|
92
|
+
comments: ScoresComment[];
|
|
93
|
+
late: boolean;
|
|
94
|
+
excused: boolean;
|
|
95
|
+
missing: boolean;
|
|
96
|
+
submissionTypes: SubmissionType[];
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=scores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scores.d.ts","sourceRoot":"","sources":["../../src/types/scores.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AssignmentGroupLevelScores, AssignmentLevelScore, CourseSettings, ScoresEnrollment } from '../types/scores';
|
|
2
|
+
export declare function transformAssignmentGroupScores(enrollment: ScoresEnrollment, courseSettings: CourseSettings | undefined): AssignmentGroupLevelScores;
|
|
3
|
+
export declare function transformAssignmentScores(enrollment: ScoresEnrollment, courseSettings: CourseSettings | undefined): AssignmentLevelScore[];
|
|
4
|
+
//# sourceMappingURL=dataTransformers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataTransformers.d.ts","sourceRoot":"","sources":["../../src/utils/dataTransformers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AAGxB,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,gBAAgB,EAC5B,cAAc,EAAE,cAAc,GAAG,SAAS,GACzC,0BAA0B,CAoB5B;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,gBAAgB,EAC5B,cAAc,EAAE,cAAc,GAAG,SAAS,GACzC,oBAAoB,EAAE,CAgCxB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getTotalScore: (restrictQuantitativeData: boolean | null | undefined, currentScore: number | null | undefined, currentGrade: string | null | undefined) => string;
|
|
2
|
+
export declare const isNonNumericGradingType: (gradingType: string) => boolean;
|
|
3
|
+
export declare const shouldUseFormattedGrade: (restrictQuantitativeData: boolean | null | undefined, gradingType: string) => boolean;
|
|
4
|
+
export declare const formatScore: (score: string | number | null, gradingType: string, pointsPossible: number | null) => string;
|
|
5
|
+
//# sourceMappingURL=scoresUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoresUtils.d.ts","sourceRoot":"","sources":["../../src/utils/scoresUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GACxB,0BAA0B,OAAO,GAAG,IAAI,GAAG,SAAS,EACpD,cAAc,MAAM,GAAG,IAAI,GAAG,SAAS,EACvC,cAAc,MAAM,GAAG,IAAI,GAAG,SAAS,KACtC,MAMF,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,aAAa,MAAM,KAAG,OAI7D,CAAA;AAED,eAAO,MAAM,uBAAuB,GAClC,0BAA0B,OAAO,GAAG,IAAI,GAAG,SAAS,EACpD,aAAa,MAAM,KAClB,OAEF,CAAA;AAED,eAAO,MAAM,WAAW,GACtB,OAAO,MAAM,GAAG,MAAM,GAAG,IAAI,EAC7B,aAAa,MAAM,EACnB,gBAAgB,MAAM,GAAG,IAAI,KAC5B,MAMF,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@instructure/platform-grades",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./styles": "./dist/style.css"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@instructure/ui-checkbox": "^10.0.0",
|
|
20
|
+
"@instructure/ui-flex": "^10.0.0",
|
|
21
|
+
"@instructure/ui-heading": "^10.0.0",
|
|
22
|
+
"@instructure/ui-number-input": "^10.0.0",
|
|
23
|
+
"@instructure/ui-pill": "^10.0.0",
|
|
24
|
+
"@instructure/ui-select": "^10.0.0",
|
|
25
|
+
"@instructure/ui-spinner": "^10.0.0",
|
|
26
|
+
"@instructure/ui-table": "^10.0.0",
|
|
27
|
+
"@instructure/ui-text": "^10.0.0",
|
|
28
|
+
"@instructure/ui-toggle-details": "^10.0.0",
|
|
29
|
+
"@instructure/ui-view": "^10.0.0",
|
|
30
|
+
"@tanstack/react-query": "^5.0.0",
|
|
31
|
+
"react": "^18.0.0",
|
|
32
|
+
"react-dom": "^18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"graphql-tag": "^2.12.6",
|
|
36
|
+
"zod": "^3.23.8",
|
|
37
|
+
"@instructure/platform-canvas-fetch": "0.1.3",
|
|
38
|
+
"@instructure/platform-graphql-types": "0.1.2",
|
|
39
|
+
"@instructure/platform-provider": "0.4.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@storybook/react": "^10.0.8",
|
|
43
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
44
|
+
"@testing-library/react": "^16.0.0",
|
|
45
|
+
"@testing-library/user-event": "^14.0.0",
|
|
46
|
+
"@types/react": "^18.3.0",
|
|
47
|
+
"@types/react-dom": "^18.3.0",
|
|
48
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
49
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
50
|
+
"jsdom": "^25.0.0",
|
|
51
|
+
"msw": "^2.7.0",
|
|
52
|
+
"typescript": "^5.3.0",
|
|
53
|
+
"vite": "^6.0.0",
|
|
54
|
+
"vite-plugin-dts": "^4.0.0",
|
|
55
|
+
"vitest": "^4.0.0",
|
|
56
|
+
"@instructure/platform-mock-canvas-api": "0.1.1"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "vite build",
|
|
60
|
+
"dev": "vite build --watch",
|
|
61
|
+
"test": "vitest",
|
|
62
|
+
"test:coverage": "vitest run --coverage",
|
|
63
|
+
"type-check": "tsc --noEmit"
|
|
64
|
+
}
|
|
65
|
+
}
|