mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
moving v2 to top level
This commit is contained in:
22
src/services/canvas/canvasRubricUtils.ts
Normal file
22
src/services/canvas/canvasRubricUtils.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { RubricItem } from "@/models/local/assignment/rubricItem";
|
||||
|
||||
export const getRubricCriterion = (rubric: RubricItem[]) => {
|
||||
const criterion = rubric
|
||||
.map((rubricItem) => ({
|
||||
description: rubricItem.label,
|
||||
points: rubricItem.points,
|
||||
ratings: {
|
||||
0: { description: "Full Marks", points: rubricItem.points },
|
||||
1: { description: "No Marks", points: 0 },
|
||||
},
|
||||
}))
|
||||
.reduce((acc, item, index) => {
|
||||
return {
|
||||
...acc,
|
||||
[index]: item,
|
||||
};
|
||||
}, {} as { [key: number]: { description: string; points: number; ratings: { [key: number]: { description: string; points: number } } } });
|
||||
|
||||
return criterion
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user