Skip to content

Commit

Permalink
Fix spelling: handgradeable -> handgradable
Browse files Browse the repository at this point in the history
  • Loading branch information
James Perretta committed Aug 5, 2024
1 parent 472a927 commit 4152413
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'graded': status === HandgradingStatus.graded,
'ungraded': status === HandgradingStatus.ungraded,
'in-progress': status === HandgradingStatus.in_progress,
'no-handgradeable-submission': status === HandgradingStatus.no_submission,
'no-handgradable-submission': status === HandgradingStatus.no_submission,
}"
v-on="$listeners">
<div class="member-names">
Expand Down Expand Up @@ -78,7 +78,7 @@ export default class GroupSummaryPanel extends Vue {
color: $ocean-blue;
}
.no-handgradeable-submission {
.no-handgradable-submission {
color: $stormy-gray-dark;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
</div>
<div class="radio-container">
<input type="radio" name="status"
id="no-handgradeable-submission"
id="no-handgradable-submission"
class="radio"
v-model="d_status_filter"
:value="HandgradingStatus.no_handgradeable_submission">
:value="HandgradingStatus.no_handgradable_submission">
<label
class="label"
for="no-handgradeable-submission"
>{{HandgradingStatus.no_handgradeable_submission}}</label>
for="no-handgradable-submission"
>{{HandgradingStatus.no_handgradable_submission}}</label>
</div>
</div>
</div>
Expand All @@ -92,7 +92,7 @@
:class="{
'active': d_currently_grading !== null
&& d_currently_grading.group === group_summary.pk,
'disabled': !group_summary.has_handgradeable_submission
'disabled': !group_summary.has_handgradable_submission
}">
</group-summary-panel>
</template>
Expand Down Expand Up @@ -236,13 +236,13 @@ export default class HandgradingContainer extends Vue implements ag_cli.Handgrad
get total_num_to_grade() {
return this.staff_filtered_groups.filter(
group => get_handgrading_status(group) !== HandgradingStatus.no_handgradeable_submission
group => get_handgrading_status(group) !== HandgradingStatus.no_handgradable_submission
).length;
}
@handle_global_errors_async
async select_for_grading(group: ag_cli.GroupWithHandgradingResultSummary) {
if (group.has_handgradeable_submission) {
if (group.has_handgradable_submission) {
await toggle(this, 'd_loading_result', async () => {
this.d_currently_grading = await ag_cli.HandgradingResult.get_or_create(group.pk);
});
Expand All @@ -252,7 +252,7 @@ export default class HandgradingContainer extends Vue implements ag_cli.Handgrad
get previous() {
let index = this.index_of_currently_grading - 1;
while (index >= 0) {
if (this.staff_filtered_groups[index].has_handgradeable_submission) {
if (this.staff_filtered_groups[index].has_handgradable_submission) {
return this.staff_filtered_groups[index];
}
index -= 1;
Expand All @@ -263,7 +263,7 @@ export default class HandgradingContainer extends Vue implements ag_cli.Handgrad
get next() {
let index = this.index_of_currently_grading + 1;
while (index < this.staff_filtered_groups.length) {
if (this.staff_filtered_groups[index].has_handgradeable_submission) {
if (this.staff_filtered_groups[index].has_handgradable_submission) {
return this.staff_filtered_groups[index];
}
index += 1;
Expand Down
6 changes: 3 additions & 3 deletions src/components/project_view/handgrading/handgrading_status.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { GroupWithHandgradingResultSummary } from 'ag-client-typescript';

export enum HandgradingStatus {
no_handgradeable_submission = "No Submission",
no_handgradable_submission = "No Submission",
ungraded = "Ungraded",
in_progress = "In Progress",
graded = "Graded",
}

export function get_handgrading_status(group_summary: GroupWithHandgradingResultSummary) {
if (!group_summary.has_handgradeable_submission) {
return HandgradingStatus.no_handgradeable_submission;
if (!group_summary.has_handgradable_submission) {
return HandgradingStatus.no_handgradable_submission;
}

let result = group_summary.handgrading_result;
Expand Down
4 changes: 2 additions & 2 deletions tests/data_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ export function make_group_summary(
project_pk: number,
num_members: number = 1,
group_args: Partial<Group> = {},
has_handgradeable_submission: boolean = false,
has_handgradable_submission: boolean = false,
handgrading_result: {
finished_grading: boolean;
total_points: number;
Expand All @@ -707,7 +707,7 @@ export function make_group_summary(
let group = make_group(project_pk, num_members, group_args);
return {
handgrading_result: handgrading_result,
has_handgradeable_submission: has_handgradeable_submission,
has_handgradable_submission: has_handgradable_submission,
...group
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let project: ag_cli.Project;
let rubric: ag_cli.HandgradingRubric;

let no_submissions_group: ag_cli.GroupWithHandgradingResultSummary;
let no_handgradeable_submissions_group: ag_cli.GroupWithHandgradingResultSummary;
let no_handgradable_submissions_group: ag_cli.GroupWithHandgradingResultSummary;
let ungraded_group: ag_cli.GroupWithHandgradingResultSummary;
let in_progress_group: ag_cli.GroupWithHandgradingResultSummary;
let graded_group: ag_cli.GroupWithHandgradingResultSummary;
Expand Down Expand Up @@ -45,7 +45,7 @@ beforeEach(() => {

no_submissions_group = data_ut.make_group_summary(
project.pk, 1, {member_names: ['[email protected]'], num_submissions: 0}, false);
no_handgradeable_submissions_group = data_ut.make_group_summary(
no_handgradable_submissions_group = data_ut.make_group_summary(
project.pk, 1, {member_names: ['[email protected]'], num_submissions: 1}, false);
ungraded_group = data_ut.make_group_summary(
project.pk, 1, {member_names: ['[email protected]'], num_submissions: 1}, true);
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('Filter group summaries tests', () => {
beforeEach(async () => {
set_summaries([
no_submissions_group,
no_handgradeable_submissions_group,
no_handgradable_submissions_group,
ungraded_group,
in_progress_group,
graded_group,
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('Filter group summaries tests', () => {
expect(wrapper.findAllComponents({name: 'GroupSummaryPanel'}).length).toBe(5);
expect(summary_pks(wrapper)).toEqual([
no_submissions_group.pk,
no_handgradeable_submissions_group.pk,
no_handgradable_submissions_group.pk,
ungraded_group.pk,
in_progress_group.pk,
graded_group.pk,
Expand All @@ -156,12 +156,12 @@ describe('Filter group summaries tests', () => {
expect(wrapper.findAllComponents({name: 'GroupSummaryPanel'}).length).toBe(1);
expect(summary_pks(wrapper)).toEqual([ungraded_group.pk]);

wrapper.find('#no-handgradeable-submission').setChecked();
wrapper.find('#no-handgradable-submission').setChecked();
await wrapper.vm.$nextTick();
expect(wrapper.findAllComponents({name: 'GroupSummaryPanel'}).length).toBe(2);
expect(
summary_pks(wrapper)
).toEqual([no_submissions_group.pk, no_handgradeable_submissions_group.pk]);
).toEqual([no_submissions_group.pk, no_handgradable_submissions_group.pk]);
});

test('Filter by username', async () => {
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('Select group tests', () => {
beforeEach(async () => {
set_summaries([
no_submissions_group,
no_handgradeable_submissions_group,
no_handgradable_submissions_group,
ungraded_group,
graded_group
]);
Expand Down Expand Up @@ -319,10 +319,10 @@ describe('Select group tests', () => {
expect_not_has_class(to_click, 'active');
});

test('Group selected for grading has no handgradeable submissions', async () => {
test('Group selected for grading has no handgradable submissions', async () => {
let result = data_ut.make_handgrading_result(
rubric, no_handgradeable_submissions_group.pk, 42);
get_or_create_stub.withArgs(no_handgradeable_submissions_group.pk).resolves(result);
rubric, no_handgradable_submissions_group.pk, 42);
get_or_create_stub.withArgs(no_handgradable_submissions_group.pk).resolves(result);

expect(wrapper.findComponent({name: 'Handgrading'}).exists()).toBe(false);
let to_click = wrapper.findAllComponents({name: 'GroupSummaryPanel'}).at(1);
Expand Down Expand Up @@ -369,7 +369,7 @@ describe('Select next/prev for grading', () => {
set_summaries([
ungraded_group,
no_submissions_group,
no_handgradeable_submissions_group,
no_handgradable_submissions_group,
graded_group
]);
let wrapper = await make_wrapper();
Expand Down Expand Up @@ -413,8 +413,8 @@ describe('Select next/prev for grading', () => {
expect(find_by_name<Handgrading>(wrapper, 'Handgrading').vm.is_last).toBe(false);
});

test('Current group is first with handgradeable submission', async () => {
set_summaries([no_handgradeable_submissions_group, ungraded_group, graded_group]);
test('Current group is first with handgradable submission', async () => {
set_summaries([no_handgradable_submissions_group, ungraded_group, graded_group]);

let wrapper = await make_wrapper();
await wrapper.findAllComponents({name: 'GroupSummaryPanel'}).at(1).trigger('click');
Expand All @@ -435,8 +435,8 @@ describe('Select next/prev for grading', () => {
expect(find_by_name<Handgrading>(wrapper, 'Handgrading').vm.is_last).toBe(true);
});

test('Current group is last with handgradeable submission', async () => {
set_summaries([ungraded_group, graded_group, no_handgradeable_submissions_group]);
test('Current group is last with handgradable submission', async () => {
set_summaries([ungraded_group, graded_group, no_handgradable_submissions_group]);

let wrapper = await make_wrapper();
await wrapper.findAllComponents({name: 'GroupSummaryPanel'}).at(1).trigger('click');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ test('get_handgrading_status', () => {
);
expect(get_handgrading_status(ungraded)).toEqual(HandgradingStatus.ungraded);

let no_handgradeable_submission = data_ut.make_group_summary(
let no_handgradable_submission = data_ut.make_group_summary(
project.pk, 1, {num_submissions: 1}, false
);
expect(get_handgrading_status(no_handgradeable_submission))
.toEqual(HandgradingStatus.no_handgradeable_submission);
expect(get_handgrading_status(no_handgradable_submission))
.toEqual(HandgradingStatus.no_handgradable_submission);
});

0 comments on commit 4152413

Please sign in to comment.