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
f0c07b28
Commit
f0c07b28
authored
May 14, 2012
by
pmitros
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #42 from MITx/ps-fix-global-context
Fix missing `global_context` problem
parents
c6a6144a
28d12628
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
djangoapps/courseware/capa/responsetypes.py
+2
-1
No files found.
djangoapps/courseware/capa/responsetypes.py
View file @
f0c07b28
...
...
@@ -32,7 +32,6 @@ from lxml.html.soupparser import fromstring as fromstring_bs # uses Beautiful So
import
calc
import
eia
def
compare_with_tolerance
(
v1
,
v2
,
tol
):
''' Compare v1 to v2 with maximum tolerance tol
tol is relative if it ends in
%
; otherwise, it is absolute
...
...
@@ -238,6 +237,7 @@ def sympy_check2():
student_answers is a dict with everything from request.POST, but with the first part
of each key removed (the string before the first "_").
'''
from
capa_problem
import
global_context
submission
=
[
student_answers
[
k
]
for
k
in
sorted
(
self
.
answer_ids
)]
self
.
context
.
update
({
'submission'
:
submission
})
exec
self
.
code
in
global_context
,
self
.
context
...
...
@@ -411,6 +411,7 @@ class SchematicResponse(GenericResponse):
self
.
code
=
answer
.
text
def
grade
(
self
,
student_answers
):
from
capa_problem
import
global_context
submission
=
[
json
.
loads
(
student_answers
[
k
])
for
k
in
sorted
(
self
.
answer_ids
)]
self
.
context
.
update
({
'submission'
:
submission
})
exec
self
.
code
in
global_context
,
self
.
context
...
...
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