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
494806f0
Commit
494806f0
authored
Jul 14, 2015
by
Muhammad Shoaib
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIp
parent
3f2712e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
22 deletions
+39
-22
edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js
+1
-1
edx_proctoring/static/proctoring/templates/student-proctored-exam-attempts.underscore
+32
-15
edx_proctoring/tests/test_views.py
+1
-1
edx_proctoring/urls.py
+1
-1
edx_proctoring/views.py
+4
-4
No files found.
edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js
View file @
494806f0
...
...
@@ -71,7 +71,7 @@ var edx = edx || {};
},
render
:
function
()
{
if
(
this
.
template
!==
null
)
{
var
html
=
this
.
template
(
this
.
collection
.
toJSON
()
);
var
html
=
this
.
template
(
{
proctored_exam_attempts
:
this
.
collection
.
toJSON
()[
0
].
proctored_exam_attempts
}
);
this
.
$el
.
html
(
html
);
this
.
$el
.
show
();
}
...
...
edx_proctoring/static/proctoring/templates/student-proctored-exam-attempts.underscore
View file @
494806f0
...
...
@@ -3,34 +3,51 @@
<table class="allowance-table">
<thead>
<tr class="allowance-headings">
<th class="exam-name"><%- gettext("Exam Name") %></th>
<tr class="exam-attempt-headings">
<th class="username"><%- gettext("Username") %></th>
<th class="email"><%- gettext("Email") %></th>
<th class="allowance-name"><%- gettext("Is Exam Completed") %> </th>
<th class="allowance-value"><%- gettext("Is Exam Completed in Time") %></th>
<th class="c_action"><%- gettext("Verification Status") %> </th>
<th class="attempt-exam-name"><%- gettext("Exam Name") %></th>
<th class="attempt-allowed-time"><%- gettext("Allowed Time for Student") %> </th>
<th class="attempt-started-at"><%- gettext("started At") %></th>
<th class="attempt-completed-at"><%- gettext("Completed At") %> </th>
<th class="attempt-status"><%- gettext("Status") %> </th>
<th class="attempt-action"><%- gettext("Action") %> </th>
</tr>
</thead>
<tbody>
<% _.each(proctored_exam_attempts, function(proctored_exam_attempt){ %>
<tr class="allowance-items">
<td>
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_attempt.proctored_exam.exam_
name }, true) %>
<%- interpolate(gettext(' %(username)s '), { username: proctored_exam_attempt.user.user
name }, true) %>
</td>
<td>
<%- interpolate(gettext(' %(username)s '), { username: proctored_exam_attempt.user.username }, true) %>
</td>
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_attempt.proctored_exam.exam_name }, true) %>
</td>
<td> <%= proctored_exam_attempt.allowed_time_limit_mins %></td>
<td>
<%- interpolate(gettext(' %(email)s '), { email: proctored_exam_attempt.user.email }, true) %>
<% if (proctored_exam_attempt.started_at){ %>
<%= proctored_exam_attempt.started_at %>
<% } else { %>
N/A
<% } %>
</td>
<td>
True
<% if (proctored_exam_attempt.completed_at){ %>
<%= proctored_exam_attempt.completed_at %> </td>
<% } else { %>
N/A
<% } %>
<td>
<% if (proctored_exam_attempt.status){ %>
<%= proctored_exam_attempt.status %> </td>
<% } else { %>
N/A
<% } %>
<td>
<% if (proctored_exam_attempt.status){ %>
<% } else { %>
N/A
<% } %>
</td>
<td>False</td>
<td>
True
</td>
</tr>
<% }); %>
</tbody>
...
...
edx_proctoring/tests/test_views.py
View file @
494806f0
...
...
@@ -429,7 +429,7 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
response_data
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
response_data
[
'id'
],
attempt_id
)
self
.
assertEqual
(
response_data
[
'proctored_exam
_
id'
],
proctored_exam
.
id
)
self
.
assertEqual
(
response_data
[
'proctored_exam
'
][
'
id'
],
proctored_exam
.
id
)
self
.
assertIsNotNone
(
response_data
[
'started_at'
])
self
.
assertIsNone
(
response_data
[
'completed_at'
])
...
...
edx_proctoring/urls.py
View file @
494806f0
...
...
@@ -37,7 +37,7 @@ urlpatterns = patterns( # pylint: disable=invalid-name
),
url
(
r'edx_proctoring/v1/proctored_exam/attempt/course_id/{}$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
views
.
StudentProctoredExamAttempt
.
as_view
(),
views
.
StudentProctoredExamAttempt
Collection
.
as_view
(),
name
=
'edx_proctoring.proctored_exam.attempt'
),
url
(
...
...
edx_proctoring/views.py
View file @
494806f0
...
...
@@ -253,7 +253,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
# make sure the the attempt belongs to the calling user_id
if
attempt
[
'user
_
id'
]
!=
request
.
user
.
id
:
if
attempt
[
'user
'
][
'
id'
]
!=
request
.
user
.
id
:
err_msg
=
(
'Attempted to access attempt_id {attempt_id} but '
'does not have access to it.'
.
format
(
...
...
@@ -290,7 +290,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
# make sure the the attempt belongs to the calling user_id
if
attempt
[
'user
_
id'
]
!=
request
.
user
.
id
:
if
attempt
[
'user
'
][
'
id'
]
!=
request
.
user
.
id
:
err_msg
=
(
'Attempted to access attempt_id {attempt_id} but '
'does not have access to it.'
.
format
(
...
...
@@ -300,7 +300,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
raise
ProctoredExamPermissionDenied
(
err_msg
)
exam_attempt_id
=
stop_exam_attempt
(
exam_id
=
attempt
[
'proctored_exam
_
id'
],
exam_id
=
attempt
[
'proctored_exam
'
][
'
id'
],
user_id
=
request
.
user
.
id
)
return
Response
({
"exam_attempt_id"
:
exam_attempt_id
})
...
...
@@ -366,7 +366,7 @@ class StudentProctoredExamAttemptCollection(AuthenticatedAPIView):
"""
if
course_id
is
not
None
:
exam_attempts
=
get_all_exam_attempts
(
course_id
)
paginator
=
Paginator
(
exam_attempts
,
1
)
# Show 1 attempts per page
paginator
=
Paginator
(
exam_attempts
,
1
)
# Show 1 attempts per page
page
=
request
.
GET
.
get
(
'page'
)
try
:
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