Skip to content

Commit

Permalink
Add grader CLI v2 for assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ledoyen committed Dec 9, 2024
1 parent 622a29f commit 1553598
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/lib/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const assignment_not_found: AssignmentBacked = {
factor_percentage: 0,
grader_run_url: 'not found',
hidden_by_teacher: false,
grader_cli_v2: false,
linked: false,
locked: true,
locked_reason: 'not found'
Expand Down Expand Up @@ -93,6 +94,7 @@ export let modules: ModuleBacked[] = [
factor_percentage: 10,
grader_run_url: 'toto',
hidden_by_teacher: false,
grader_cli_v2: false,
linked: true,
locked: false,
latest_run: {
Expand Down Expand Up @@ -140,6 +142,7 @@ export let modules: ModuleBacked[] = [
factor_percentage: 15,
grader_run_url: 'toto',
hidden_by_teacher: false,
grader_cli_v2: false,
linked: false,
locked: true
},
Expand All @@ -156,6 +159,7 @@ export let modules: ModuleBacked[] = [
factor_percentage: 75,
grader_run_url: 'toto',
hidden_by_teacher: false,
grader_cli_v2: false,
linked: true,
locked: false,
latest_run: {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export type TeacherAssignment = {
factor_percentage?: number;
grader_run_url?: string;
hidden_by_teacher: boolean;
grader_cli_v2: boolean;
};

export type TeacherAssignmentForm = {
Expand All @@ -102,6 +103,7 @@ export type TeacherAssignmentForm = {
factor_percentage?: number;
grader_run_url?: string;
hidden_by_teacher: boolean;
grader_cli_v2: boolean;
};

export type ModuleRedeemResponse = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
repository_name: yup.string().required(),
factor_percentage: yup.number().required(),
grader_run_url: yup.string().required(),
hidden_by_teacher: yup.boolean().required()
hidden_by_teacher: yup.boolean().required(),
grader_cli_v2: yup.boolean().required()
});
let errors: YupErrors = {};
Expand Down Expand Up @@ -84,6 +85,15 @@
<input class="col-auto" type="text" id="grader_url" bind:value={form.values.grader_url} />
{#if errors.grader_url}<div class="error">Required</div>{/if}
</div>
<div class="row">
<label class="col-input" for="grader_cli_v2">Grader CLI v2</label>
<input
class="col-auto"
type="checkbox"
id="grader_cli_v2"
bind:checked={form.values.grader_cli_v2}
/>
</div>
<div class="row">
<label class="col-input" for="repository_name">Repository name</label>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
export let data;
let assignment: TeacherAssignment = {
hidden_by_teacher: false
hidden_by_teacher: false,
grader_cli_v2: false
};
const onSave = async (a: TeacherAssignmentForm) => {
Expand Down

0 comments on commit 1553598

Please sign in to comment.