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
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
19 deletions
+36
-19
edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js
+1
-1
edx_proctoring/static/proctoring/templates/student-proctored-exam-attempts.underscore
+30
-13
edx_proctoring/tests/test_views.py
+1
-1
edx_proctoring/urls.py
+1
-1
edx_proctoring/views.py
+3
-3
No files found.
edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js
View file @
494806f0
...
@@ -71,7 +71,7 @@ var edx = edx || {};
...
@@ -71,7 +71,7 @@ var edx = edx || {};
},
},
render
:
function
()
{
render
:
function
()
{
if
(
this
.
template
!==
null
)
{
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
.
html
(
html
);
this
.
$el
.
show
();
this
.
$el
.
show
();
}
}
...
...
edx_proctoring/static/proctoring/templates/student-proctored-exam-attempts.underscore
View file @
494806f0
...
@@ -3,33 +3,50 @@
...
@@ -3,33 +3,50 @@
<table class="allowance-table">
<table class="allowance-table">
<thead>
<thead>
<tr class="allowance-headings">
<tr class="exam-attempt-headings">
<th class="exam-name"><%- gettext("Exam Name") %></th>
<th class="username"><%- gettext("Username") %></th>
<th class="username"><%- gettext("Username") %></th>
<th class="email"><%- gettext("Email") %></th>
<th class="attempt-exam-name"><%- gettext("Exam Name") %></th>
<th class="allowance-name"><%- gettext("Is Exam Completed") %> </th>
<th class="attempt-allowed-time"><%- gettext("Allowed Time for Student") %> </th>
<th class="allowance-value"><%- gettext("Is Exam Completed in Time") %></th>
<th class="attempt-started-at"><%- gettext("started At") %></th>
<th class="c_action"><%- gettext("Verification Status") %> </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>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<% _.each(proctored_exam_attempts, function(proctored_exam_attempt){ %>
<% _.each(proctored_exam_attempts, function(proctored_exam_attempt){ %>
<tr class="allowance-items">
<tr class="allowance-items">
<td>
<td>
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_attempt.proctored_exam.exam_name }, true) %>
</td>
<td>
<%- interpolate(gettext(' %(username)s '), { username: proctored_exam_attempt.user.username }, true) %>
<%- interpolate(gettext(' %(username)s '), { username: proctored_exam_attempt.user.username }, true) %>
</td>
</td>
<td>
<td>
<%- interpolate(gettext(' %(email)s '), { email: proctored_exam_attempt.user.email
}, true) %>
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_attempt.proctored_exam.exam_name
}, true) %>
</td>
</td>
<td> <%= proctored_exam_attempt.allowed_time_limit_mins %></td>
<td>
<td>
True
<% if (proctored_exam_attempt.started_at){ %>
<%= proctored_exam_attempt.started_at %>
<% } else { %>
N/A
<% } %>
</td>
</td>
<td>False</td>
<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>
</tr>
</tr>
<% }); %>
<% }); %>
...
...
edx_proctoring/tests/test_views.py
View file @
494806f0
...
@@ -429,7 +429,7 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
...
@@ -429,7 +429,7 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
response_data
=
json
.
loads
(
response
.
content
)
response_data
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
response_data
[
'id'
],
attempt_id
)
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
.
assertIsNotNone
(
response_data
[
'started_at'
])
self
.
assertIsNone
(
response_data
[
'completed_at'
])
self
.
assertIsNone
(
response_data
[
'completed_at'
])
...
...
edx_proctoring/urls.py
View file @
494806f0
...
@@ -37,7 +37,7 @@ urlpatterns = patterns( # pylint: disable=invalid-name
...
@@ -37,7 +37,7 @@ urlpatterns = patterns( # pylint: disable=invalid-name
),
),
url
(
url
(
r'edx_proctoring/v1/proctored_exam/attempt/course_id/{}$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
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'
name
=
'edx_proctoring.proctored_exam.attempt'
),
),
url
(
url
(
...
...
edx_proctoring/views.py
View file @
494806f0
...
@@ -253,7 +253,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
...
@@ -253,7 +253,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
# make sure the the attempt belongs to the calling user_id
# 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
=
(
err_msg
=
(
'Attempted to access attempt_id {attempt_id} but '
'Attempted to access attempt_id {attempt_id} but '
'does not have access to it.'
.
format
(
'does not have access to it.'
.
format
(
...
@@ -290,7 +290,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
...
@@ -290,7 +290,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
# make sure the the attempt belongs to the calling user_id
# 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
=
(
err_msg
=
(
'Attempted to access attempt_id {attempt_id} but '
'Attempted to access attempt_id {attempt_id} but '
'does not have access to it.'
.
format
(
'does not have access to it.'
.
format
(
...
@@ -300,7 +300,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
...
@@ -300,7 +300,7 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
raise
ProctoredExamPermissionDenied
(
err_msg
)
raise
ProctoredExamPermissionDenied
(
err_msg
)
exam_attempt_id
=
stop_exam_attempt
(
exam_attempt_id
=
stop_exam_attempt
(
exam_id
=
attempt
[
'proctored_exam
_
id'
],
exam_id
=
attempt
[
'proctored_exam
'
][
'
id'
],
user_id
=
request
.
user
.
id
user_id
=
request
.
user
.
id
)
)
return
Response
({
"exam_attempt_id"
:
exam_attempt_id
})
return
Response
({
"exam_attempt_id"
:
exam_attempt_id
})
...
...
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