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
7db93976
Commit
7db93976
authored
Jun 21, 2013
by
Peter Baratta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR fixes
parent
f623e429
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
common/lib/xmodule/xmodule/capa_module.py
+3
-6
common/lib/xmodule/xmodule/tests/test_capa_module.py
+8
-6
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
7db93976
...
...
@@ -22,7 +22,7 @@ from xblock.core import Scope, String, Boolean, Dict, Integer, Float
from
.fields
import
Timedelta
,
Date
from
django.utils.timezone
import
UTC
log
=
logging
.
getLogger
(
"mitx.courseware"
)
# pylint: disable=C0103
log
=
logging
.
getLogger
(
"mitx.courseware"
)
# Generate this many different variants of problems with rerandomize=per_student
...
...
@@ -51,9 +51,6 @@ class Randomization(String):
Define a field to store how to randomize a problem.
"""
def
from_json
(
self
,
value
):
"""
For backward compatability?
"""
if
value
in
(
""
,
"true"
):
return
"always"
elif
value
==
"false"
:
...
...
@@ -865,8 +862,8 @@ class CapaModule(CapaFields, XModule):
except
Exception
as
err
:
if
self
.
system
.
DEBUG
:
msg
=
"Error checking problem: "
+
err
.
message
msg
+=
'
\n
Traceback:
\n
'
+
traceback
.
format_exc
(
)
msg
=
u"Error checking problem: {}"
.
format
(
err
.
message
)
msg
+=
u'
\n
Traceback:
\n
{}'
.
format
(
traceback
.
format_exc
()
)
return
{
'success'
:
msg
}
raise
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
7db93976
...
...
@@ -505,9 +505,10 @@ class CapaModuleTest(unittest.TestCase):
def
test_check_problem_error
(
self
):
# Try each exception that capa_module should handle
for
exception_class
in
[
StudentInputError
,
LoncapaProblemError
,
ResponseError
]:
exception_classes
=
[
StudentInputError
,
LoncapaProblemError
,
ResponseError
]
for
exception_class
in
exception_classes
:
# Create the module
module
=
CapaFactory
.
create
(
attempts
=
1
)
...
...
@@ -532,9 +533,10 @@ class CapaModuleTest(unittest.TestCase):
def
test_check_problem_error_nonascii
(
self
):
# Try each exception that capa_module should handle
for
exception_class
in
[
StudentInputError
,
LoncapaProblemError
,
ResponseError
]:
exception_classes
=
[
StudentInputError
,
LoncapaProblemError
,
ResponseError
]
for
exception_class
in
exception_classes
:
# Create the module
module
=
CapaFactory
.
create
(
attempts
=
1
)
...
...
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