Skip to content

Commit

Permalink
Merge pull request #201 from SELab-2/best_working_version
Browse files Browse the repository at this point in the history
Fix group_ids in listview to groupnumbers
  • Loading branch information
PJDeSmijter authored May 24, 2024
2 parents 0685765 + 7780070 commit 2f14893
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/pigeonhole/apps/submissions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

SUBMISSIONS_DIR = f"{str(settings.STATIC_ROOT)}/submissions"


def submission_folder_path(group_id, submission_id):
return f"{SUBMISSIONS_DIR}/group_{group_id}/{submission_id}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_update_self(self):
'course': [self.course.course_id]
}
response = self.client.put(f'{API_ENDPOINT}{self.teacher.id}/', updated_data, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

def test_delete_self(self):
response = self.client.delete(f'{API_ENDPOINT}{self.teacher.id}/')
Expand Down
31 changes: 28 additions & 3 deletions frontend/app/[locale]/components/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import {
getUsers,
postData,
getOpenCourses,
fetchUserData
fetchUserData, getLatestSubmissions, getGroup
} from '@lib/api';
import baseTheme from "../../../styles/theme";
import {useTranslation} from "react-i18next";
Expand Down Expand Up @@ -189,8 +189,33 @@ const ListView: NextPage<ListViewProps> = ({
setGroupSize((await getProject(data.project_id)).group_size);
return [data.group_id, data.user, data.group_nr, l.join(', ')];
},
'submissions': (data) => [data.submission_id, data.group_id, convertDate(t, data.timestamp), data?.output_simple_test && data?.eval_result],
'submissions_group': (data) => [data.submission_id, data.group_id, convertDate(t, data.timestamp), data?.output_simple_test && data?.eval_result],
'submissions': async (data) => {
let group = data.group_id;
let group_nr;
await getGroup(group).then((group) => {
group_nr = group.group_nr;
}
);
return [data.submission_id, group_nr, convertDate(t, data.timestamp), data?.output_simple_test && data?.eval_result]
} ,
'submissions_group': async (data) => {
let group = data.group_id;
let group_nr;
await getGroup(group).then((group) => {
group_nr = group.group_nr;
}
);
return [data.submission_id, group_nr, convertDate(t, data.timestamp), data?.output_simple_test && data?.eval_result]
},
'submissions_latest': async (data) => {
let group = data.group_id;
let group_nr;
await getGroup(group).then((group) => {
group_nr = group.group_nr;
}
);
return [data.submission_id, group_nr, convertDate(t, data.timestamp), data?.output_simple_test && data?.eval_result]
},
'archived_courses': (data) => [data.course_id, data.name, data.description, data.open_course],
};

Expand Down

0 comments on commit 2f14893

Please sign in to comment.