Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-proctoring
Commits
e26509ae
Commit
e26509ae
authored
Jul 15, 2015
by
Afzal Wali
Committed by
Muhammad Shoaib
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quality improvements
parent
c76d282c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
edx_proctoring/api.py
+2
-0
edx_proctoring/urls.py
+2
-1
edx_proctoring/views.py
+3
-2
No files found.
edx_proctoring/api.py
View file @
e26509ae
...
@@ -361,6 +361,7 @@ def get_all_exam_attempts(course_id):
...
@@ -361,6 +361,7 @@ def get_all_exam_attempts(course_id):
exam_attempts
=
ProctoredExamStudentAttempt
.
get_all_exam_attempts
(
course_id
)
exam_attempts
=
ProctoredExamStudentAttempt
.
get_all_exam_attempts
(
course_id
)
return
[
ProctoredExamStudentAttemptSerializer
(
active_exam
)
.
data
for
active_exam
in
exam_attempts
]
return
[
ProctoredExamStudentAttemptSerializer
(
active_exam
)
.
data
for
active_exam
in
exam_attempts
]
def
get_filtered_exam_attempts
(
course_id
,
search_by
):
def
get_filtered_exam_attempts
(
course_id
,
search_by
):
"""
"""
returns all exam attempts for a course id filtered by the search_by string in user names and emails.
returns all exam attempts for a course id filtered by the search_by string in user names and emails.
...
@@ -368,6 +369,7 @@ def get_filtered_exam_attempts(course_id, search_by):
...
@@ -368,6 +369,7 @@ def get_filtered_exam_attempts(course_id, search_by):
exam_attempts
=
ProctoredExamStudentAttempt
.
get_all_exam_attempts
(
course_id
)
exam_attempts
=
ProctoredExamStudentAttempt
.
get_all_exam_attempts
(
course_id
)
return
[
ProctoredExamStudentAttemptSerializer
(
active_exam
)
.
data
for
active_exam
in
exam_attempts
]
return
[
ProctoredExamStudentAttemptSerializer
(
active_exam
)
.
data
for
active_exam
in
exam_attempts
]
def
get_active_exams_for_user
(
user_id
,
course_id
=
None
):
def
get_active_exams_for_user
(
user_id
,
course_id
=
None
):
"""
"""
This method will return a list of active exams for the user,
This method will return a list of active exams for the user,
...
...
edx_proctoring/urls.py
View file @
e26509ae
...
@@ -41,7 +41,8 @@ urlpatterns = patterns( # pylint: disable=invalid-name
...
@@ -41,7 +41,8 @@ urlpatterns = patterns( # pylint: disable=invalid-name
name
=
'edx_proctoring.proctored_exam.attempt'
name
=
'edx_proctoring.proctored_exam.attempt'
),
),
url
(
url
(
r'edx_proctoring/v1/proctored_exam/attempt/course_id/{}/search/(?P<search_by>.+)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
r'edx_proctoring/v1/proctored_exam/attempt/course_id/{}/search/(?P<search_by>.+)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
views
.
StudentProctoredExamAttemptCollection
.
as_view
(),
views
.
StudentProctoredExamAttemptCollection
.
as_view
(),
name
=
'edx_proctoring.proctored_exam.attempt.search'
name
=
'edx_proctoring.proctored_exam.attempt.search'
),
),
...
...
edx_proctoring/views.py
View file @
e26509ae
...
@@ -42,6 +42,8 @@ from edx_proctoring.serializers import ProctoredExamSerializer
...
@@ -42,6 +42,8 @@ from edx_proctoring.serializers import ProctoredExamSerializer
from
.utils
import
AuthenticatedAPIView
from
.utils
import
AuthenticatedAPIView
ATTEMPTS_PER_PAGE
=
1
LOG
=
logging
.
getLogger
(
"edx_proctoring_views"
)
LOG
=
logging
.
getLogger
(
"edx_proctoring_views"
)
...
@@ -400,8 +402,7 @@ class StudentProctoredExamAttemptCollection(AuthenticatedAPIView):
...
@@ -400,8 +402,7 @@ class StudentProctoredExamAttemptCollection(AuthenticatedAPIView):
exam_attempts
=
get_all_exam_attempts
(
course_id
)
exam_attempts
=
get_all_exam_attempts
(
course_id
)
attempt_url
=
reverse
(
'edx_proctoring.proctored_exam.attempt'
,
args
=
[
course_id
])
attempt_url
=
reverse
(
'edx_proctoring.proctored_exam.attempt'
,
args
=
[
course_id
])
# TODO have to change the default attempts per page
paginator
=
Paginator
(
exam_attempts
,
ATTEMPTS_PER_PAGE
)
paginator
=
Paginator
(
exam_attempts
,
1
)
# Show 1 attempts per page
page
=
request
.
GET
.
get
(
'page'
)
page
=
request
.
GET
.
get
(
'page'
)
try
:
try
:
exam_attempts_page
=
paginator
.
page
(
page
)
exam_attempts_page
=
paginator
.
page
(
page
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment