Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
f2309b31
Commit
f2309b31
authored
12 years ago
by
Calen Pennington
Browse files
Options
Downloads
Patches
Plain Diff
Remove references to djangosettings from responsetypes.py
parent
f2423ca1
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/capa/checker.py
+1
-0
1 addition, 0 deletions
common/lib/capa/checker.py
common/lib/capa/responsetypes.py
+7
-8
7 additions, 8 deletions
common/lib/capa/responsetypes.py
with
8 additions
and
8 deletions
common/lib/capa/checker.py
+
1
−
0
View file @
f2309b31
...
...
@@ -23,6 +23,7 @@ log = logging.getLogger('capa.checker')
class
DemoSystem
(
object
):
def
__init__
(
self
):
self
.
lookup
=
TemplateLookup
(
directories
=
[
path
(
__file__
).
dirname
()
/
'
templates
'
])
self
.
DEBUG
=
True
def
render_template
(
self
,
template_filename
,
dictionary
,
context
=
None
):
if
context
is
None
:
...
...
This diff is collapsed.
Click to expand it.
common/lib/capa/responsetypes.py
+
7
−
8
View file @
f2309b31
...
...
@@ -277,14 +277,14 @@ def sympy_check2():
print
"
can
'
t find cfn in context =
"
,
context
if
not
self
.
code
:
if
not
answer
:
if
answer
is
None
:
# raise Exception,"[courseware.capa.responsetypes.customresponse] missing code checking script! id=%s" % self.myid
print
"
[courseware.capa.responsetypes.customresponse] missing code checking script! id=%s
"
%
self
.
myid
self
.
code
=
''
else
:
answer_src
=
answer
.
get
(
'
src
'
)
if
answer_src
is
not
None
:
self
.
code
=
open
(
settings
.
DATA_DIR
+
'
src/
'
+
answer_src
).
read
()
self
.
code
=
self
.
system
.
filesystem
.
open
(
'
src/
'
+
answer_src
).
read
()
else
:
self
.
code
=
answer
.
text
...
...
@@ -329,8 +329,7 @@ def sympy_check2():
})
# pass self.system.debug to cfn
# if hasattr(self.system,'debug'): self.context['debug'] = self.system.debug
self
.
context
[
'
debug
'
]
=
settings
.
DEBUG
self
.
context
[
'
debug
'
]
=
self
.
system
.
DEBUG
# exec the check function
if
type
(
self
.
code
)
==
str
:
...
...
@@ -492,7 +491,7 @@ main()
answer_src
=
answer
.
get
(
'
src
'
)
if
answer_src
is
not
None
:
self
.
code
=
open
(
settings
.
DATA_DIR
+
'
src/
'
+
answer_src
).
read
()
self
.
code
=
self
.
system
.
filesystem
.
open
(
'
src/
'
+
answer_src
).
read
()
else
:
self
.
code
=
answer
.
text
...
...
@@ -522,7 +521,7 @@ main()
log
.
error
(
msg
)
raise
Exception
,
msg
if
se
ttings
.
DEBUG
:
log
.
info
(
'
response = %s
'
%
r
.
text
)
if
se
lf
.
system
.
DEBUG
:
log
.
info
(
'
response = %s
'
%
r
.
text
)
if
(
not
r
.
text
)
or
(
not
r
.
text
.
strip
()):
raise
Exception
,
'
Error: no response from external server url=%s
'
%
self
.
url
...
...
@@ -551,7 +550,7 @@ main()
rxml
=
self
.
do_external_request
(
'
get_score
'
,
extra_payload
)
except
Exception
,
err
:
log
.
error
(
'
Error %s
'
%
err
)
if
se
ttings
.
DEBUG
:
if
se
lf
.
system
.
DEBUG
:
correct_map
=
dict
(
zip
(
sorted
(
self
.
answer_ids
),
[
'
incorrect
'
]
*
len
(
self
.
answer_ids
)
))
correct_map
[
'
msg_%s
'
%
self
.
answer_ids
[
0
]]
=
'
<font color=
"
red
"
size=
"
+2
"
>%s</font>
'
%
str
(
err
).
replace
(
'
<
'
,
'
<
'
)
return
correct_map
...
...
@@ -581,7 +580,7 @@ main()
exans
=
json
.
loads
(
rxml
.
find
(
'
expected
'
).
text
)
except
Exception
,
err
:
log
.
error
(
'
Error %s
'
%
err
)
if
se
ttings
.
DEBUG
:
if
se
lf
.
system
.
DEBUG
:
msg
=
'
<font color=red size=+2>%s</font>
'
%
str
(
err
).
replace
(
'
<
'
,
'
<
'
)
exans
=
[
''
]
*
len
(
self
.
answer_ids
)
exans
[
0
]
=
msg
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment