Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add list attempt api #129

Merged
merged 2 commits into from
May 12, 2023
Merged

feat: add list attempt api #129

merged 2 commits into from
May 12, 2023

Conversation

zacharis278
Copy link
Contributor

@zacharis278 zacharis278 commented May 10, 2023

JIRA: MST-1891

Description: Adds a new endpoint to list attempts filtered by an exam id. This will drive the new 'instructor dashboard' component for exam. I expect this endpoint will include additional filter params beyond just exam_id once we add the search feature.

Using limit offset pagination allows the UI to decide it's own page size by setting the limit parameter.

Example /instructor_view/attempts?exam_id=28&limit=20

re_path(fr'exam/provider_settings/course_id/{COURSE_ID_PATTERN}/exam_id/{EXAM_ID_PATTERN}',
CourseProviderSettingsView.as_view(),
name='exam-provider-settings'),
re_path(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored this so the indentation would be consistent

@@ -15,16 +20,74 @@ class UserFactory(DjangoModelFactory):
class Meta:
model = get_user_model()
django_get_or_create = (
"email",
"username",
'email',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pylint started yelling at me about inconsistent quotes so I made everything single quote

is_superuser = False
is_staff = False


class ProctoringProviderFactory(DjangoModelFactory):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't take on any refactoring with this PR but there's an opportunity to clean up a bunch of repetitive test setup using these factory classes.

Endpoint for listing exam attempts. Used to provide data for the instructor
facing exam dashboard.

/instructor_view/attempts?exam_id=<exam_id>
Copy link
Contributor Author

@zacharis278 zacharis278 May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used a unique path for this compared to exam/attempts because the data returned is different from the other attempt endpoints.

@zacharis278 zacharis278 marked this pull request as ready for review May 11, 2023 16:53
Copy link
Member

@alangsto alangsto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@zacharis278 zacharis278 merged commit ba2df8d into main May 12, 2023
@zacharis278 zacharis278 deleted the zhancock/list-attempt-api branch May 12, 2023 16:27
@zacharis278 zacharis278 mentioned this pull request May 16, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants