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
281b1b0e
Commit
281b1b0e
authored
Jul 30, 2015
by
Muhammad Shoaib
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test cases tweaks
parent
be001340
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
edx_proctoring/api.py
+1
-1
edx_proctoring/models.py
+1
-1
edx_proctoring/serializers.py
+2
-1
edx_proctoring/tests/test_api.py
+4
-4
No files found.
edx_proctoring/api.py
View file @
281b1b0e
...
@@ -87,7 +87,7 @@ def update_exam(exam_id, exam_name=None, time_limit_mins=None,
...
@@ -87,7 +87,7 @@ def update_exam(exam_id, exam_name=None, time_limit_mins=None,
if
is_proctored
is
not
None
:
if
is_proctored
is
not
None
:
proctored_exam
.
is_proctored
=
is_proctored
proctored_exam
.
is_proctored
=
is_proctored
if
is_practice_exam
is
not
None
:
if
is_practice_exam
is
not
None
:
proctored_exam
.
is_practice_exam
=
is_practice_exam
,
proctored_exam
.
is_practice_exam
=
is_practice_exam
if
external_id
is
not
None
:
if
external_id
is
not
None
:
proctored_exam
.
external_id
=
external_id
proctored_exam
.
external_id
=
external_id
if
is_active
is
not
None
:
if
is_active
is
not
None
:
...
...
edx_proctoring/models.py
View file @
281b1b0e
...
@@ -121,7 +121,7 @@ class ProctoredExamStudentAttemptManager(models.Manager):
...
@@ -121,7 +121,7 @@ class ProctoredExamStudentAttemptManager(models.Manager):
Returns the Student Exam Attempts for the given course_id.
Returns the Student Exam Attempts for the given course_id.
"""
"""
return
self
.
filter
(
proctored_exam__course_id
=
course_id
)
return
self
.
filter
(
proctored_exam__course_id
=
course_id
)
.
order_by
(
'-created'
)
def
get_filtered_exam_attempts
(
self
,
course_id
,
search_by
):
def
get_filtered_exam_attempts
(
self
,
course_id
,
search_by
):
"""
"""
...
...
edx_proctoring/serializers.py
View file @
281b1b0e
...
@@ -29,6 +29,7 @@ class ProctoredExamSerializer(serializers.ModelSerializer):
...
@@ -29,6 +29,7 @@ class ProctoredExamSerializer(serializers.ModelSerializer):
time_limit_mins
=
serializers
.
IntegerField
(
required
=
True
)
time_limit_mins
=
serializers
.
IntegerField
(
required
=
True
)
is_active
=
StrictBooleanField
(
required
=
True
)
is_active
=
StrictBooleanField
(
required
=
True
)
is_practice_exam
=
StrictBooleanField
(
required
=
False
)
is_proctored
=
StrictBooleanField
(
required
=
True
)
is_proctored
=
StrictBooleanField
(
required
=
True
)
class
Meta
:
class
Meta
:
...
@@ -39,7 +40,7 @@ class ProctoredExamSerializer(serializers.ModelSerializer):
...
@@ -39,7 +40,7 @@ class ProctoredExamSerializer(serializers.ModelSerializer):
fields
=
(
fields
=
(
"id"
,
"course_id"
,
"content_id"
,
"external_id"
,
"exam_name"
,
"id"
,
"course_id"
,
"content_id"
,
"external_id"
,
"exam_name"
,
"time_limit_mins"
,
"is_proctored"
,
"is_active"
"time_limit_mins"
,
"is_proctored"
,
"is_
practice_exam"
,
"is_
active"
)
)
...
...
edx_proctoring/tests/test_api.py
View file @
281b1b0e
...
@@ -473,8 +473,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
...
@@ -473,8 +473,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
)
)
filtered_attempts
=
get_filtered_exam_attempts
(
self
.
course_id
,
self
.
user
.
username
)
filtered_attempts
=
get_filtered_exam_attempts
(
self
.
course_id
,
self
.
user
.
username
)
self
.
assertEqual
(
len
(
filtered_attempts
),
2
)
self
.
assertEqual
(
len
(
filtered_attempts
),
2
)
self
.
assertEqual
(
filtered_attempts
[
0
][
'id'
],
exam_attempt
.
id
)
self
.
assertEqual
(
filtered_attempts
[
0
][
'id'
],
new_exam_attempt
)
self
.
assertEqual
(
filtered_attempts
[
1
][
'id'
],
new_exam_attempt
)
self
.
assertEqual
(
filtered_attempts
[
1
][
'id'
],
exam_attempt
.
id
)
def
test_get_all_exam_attempts
(
self
):
def
test_get_all_exam_attempts
(
self
):
"""
"""
...
@@ -493,8 +493,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
...
@@ -493,8 +493,8 @@ class ProctoredExamApiTests(LoggedInTestCase):
)
)
all_exams
=
get_all_exam_attempts
(
self
.
course_id
)
all_exams
=
get_all_exam_attempts
(
self
.
course_id
)
self
.
assertEqual
(
len
(
all_exams
),
2
)
self
.
assertEqual
(
len
(
all_exams
),
2
)
self
.
assertEqual
(
all_exams
[
0
][
'id'
],
exam_attempt
.
id
)
self
.
assertEqual
(
all_exams
[
0
][
'id'
],
updated_exam_attempt_
id
)
self
.
assertEqual
(
all_exams
[
1
][
'id'
],
updated_exam_attempt_
id
)
self
.
assertEqual
(
all_exams
[
1
][
'id'
],
exam_attempt
.
id
)
def
test_get_student_view
(
self
):
def
test_get_student_view
(
self
):
"""
"""
...
...
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