Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
c5135269
Commit
c5135269
authored
Aug 27, 2014
by
Justin Riley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use full traceback when returning errors from handle_ajax
parent
1e9beac7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
common/lib/xmodule/xmodule/proctor_module.py
+9
-8
No files found.
common/lib/xmodule/xmodule/proctor_module.py
View file @
c5135269
...
@@ -3,6 +3,7 @@ import json
...
@@ -3,6 +3,7 @@ import json
import
logging
import
logging
import
urlparse
import
urlparse
import
requests
import
requests
import
traceback
from
lxml
import
etree
from
lxml
import
etree
from
pkg_resources
import
resource_string
from
pkg_resources
import
resource_string
...
@@ -225,8 +226,8 @@ class ProctorModule(ProctorFields, XModule):
...
@@ -225,8 +226,8 @@ class ProctorModule(ProctorFields, XModule):
username
=
data
.
get
(
"username"
)
username
=
data
.
get
(
"username"
)
return
self
.
submission_history
(
username
)
return
self
.
submission_history
(
username
)
#if dispatch == 'status':
#
if dispatch == 'status':
#
return self.status()
#
return self.status()
# if dispatch == 'grades':
# if dispatch == 'grades':
# return self.grades()
# return self.grades()
...
@@ -249,18 +250,18 @@ class ProctorModule(ProctorFields, XModule):
...
@@ -249,18 +250,18 @@ class ProctorModule(ProctorFields, XModule):
pminfo
.
get_assignments_attempted_and_failed
(
pminfo
.
get_assignments_attempted_and_failed
(
username
,
reset
=
True
,
wipe_randomize_history
=
wipe_history
)
username
,
reset
=
True
,
wipe_randomize_history
=
wipe_history
)
return
self
.
status
(
username
)
return
self
.
status
(
username
)
except
Exception
as
exc
:
except
Exception
:
return
json
.
dumps
({
"error"
:
str
(
exc
)})
return
json
.
dumps
({
"error"
:
traceback
.
format_exc
(
)})
def
status
(
self
,
username
):
def
status
(
self
,
username
):
try
:
try
:
student
=
self
.
pp
.
user
student
=
self
.
pp
.
user
pminfo
=
module_tree_reset
.
ProctorModuleInfo
(
self
.
runtime
.
course_id
)
pminfo
=
module_tree_reset
.
ProctorModuleInfo
(
self
.
runtime
.
course_id
)
status
=
pminfo
.
get_student_status
(
username
)
status
=
pminfo
.
get_student_status
(
username
)
except
Exception
as
err
:
except
Exception
:
log
.
exception
(
"Failed to get status for
%
s"
%
student
)
log
.
exception
(
"Failed to get status for
%
s"
%
student
)
status
=
{
'msg'
:
'Error getting grades for
%
s'
%
student
,
status
=
{
'msg'
:
'Error getting grades for
%
s'
%
student
,
'error'
:
True
,
'errstr'
:
str
(
err
)}
'error'
:
True
,
'errstr'
:
traceback
.
format_exc
(
)}
return
json
.
dumps
(
status
)
return
json
.
dumps
(
status
)
def
submission_history
(
self
,
username
):
def
submission_history
(
self
,
username
):
...
@@ -280,10 +281,10 @@ class ProctorModule(ProctorFields, XModule):
...
@@ -280,10 +281,10 @@ class ProctorModule(ProctorFields, XModule):
grade
=
e
.
grade
,
grade
=
e
.
grade
,
max_grade
=
e
.
max_grade
,
max_grade
=
e
.
max_grade
,
answers
=
state
[
'student_answers'
]))
answers
=
state
[
'student_answers'
]))
except
Exception
as
err
:
except
Exception
:
log
.
exception
(
"Failed to get status for
%
s"
%
username
)
log
.
exception
(
"Failed to get status for
%
s"
%
username
)
status
=
{
'msg'
:
'Error getting grades for
%
s'
%
username
,
status
=
{
'msg'
:
'Error getting grades for
%
s'
%
username
,
'error'
:
True
,
'errstr'
:
str
(
err
)}
'error'
:
True
,
'errstr'
:
traceback
.
format_exc
(
)}
return
json
.
dumps
(
status
)
return
json
.
dumps
(
status
)
# TODO: investigate whether this is needed or not
# TODO: investigate whether this is needed or not
...
...
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