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
e32fa060
Commit
e32fa060
authored
May 13, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing FS references; code may be unstable
parent
22189661
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
djangoapps/courseware/capa/capa_problem.py
+3
-3
djangoapps/courseware/capa/responsetypes.py
+5
-5
No files found.
djangoapps/courseware/capa/capa_problem.py
View file @
e32fa060
...
...
@@ -117,7 +117,7 @@ class LoncapaProblem(object):
self
.
preprocess_problem
(
self
.
tree
,
correct_map
=
self
.
correct_map
,
answer_map
=
self
.
student_answers
)
self
.
context
=
self
.
extract_context
(
self
.
tree
,
seed
=
self
.
seed
)
for
response
in
self
.
tree
.
xpath
(
'//'
+
"|//"
.
join
(
response_types
)):
responder
=
response_types
[
response
.
tag
](
response
,
self
.
context
)
responder
=
response_types
[
response
.
tag
](
response
,
self
.
context
,
self
.
system
)
responder
.
preprocess_response
()
def
get_state
(
self
):
...
...
@@ -163,7 +163,7 @@ class LoncapaProblem(object):
self
.
correct_map
=
dict
()
problems_simple
=
self
.
extract_problems
(
self
.
tree
)
for
response
in
problems_simple
:
grader
=
response_types
[
response
.
tag
](
response
,
self
.
context
)
grader
=
response_types
[
response
.
tag
](
response
,
self
.
context
,
self
.
system
)
results
=
grader
.
grade
(
answers
)
# call the responsetype instance to do the actual grading
self
.
correct_map
.
update
(
results
)
return
self
.
correct_map
...
...
@@ -177,7 +177,7 @@ class LoncapaProblem(object):
answer_map
=
dict
()
problems_simple
=
self
.
extract_problems
(
self
.
tree
)
# purified (flat) XML tree of just response queries
for
response
in
problems_simple
:
responder
=
response_types
[
response
.
tag
](
response
,
self
.
context
)
# instance of numericalresponse, customresponse,...
responder
=
response_types
[
response
.
tag
](
response
,
self
.
context
,
self
.
system
)
# instance of numericalresponse, customresponse,...
results
=
responder
.
get_answers
()
answer_map
.
update
(
results
)
# dict of (id,correct_answer)
...
...
djangoapps/courseware/capa/responsetypes.py
View file @
e32fa060
...
...
@@ -68,10 +68,10 @@ class MultipleChoiceResponse(GenericResponse):
<multiplechoiceresponse direction="vertical" randomize="yes">
<choicegroup type="MultipleChoice">
<choice location="random"
name="1"
correct="false"><span>`a+b`<br/></span></choice>
<choice location="random"
name="2"
correct="true"><span><math>a+b^2</math><br/></span></choice>
<choice location="random"
name="3"
correct="false"><math>a+b+c</math></choice>
<choice location="bottom"
name="4"
correct="false"><math>a+b+d</math></choice>
<choice location="random" correct="false"><span>`a+b`<br/></span></choice>
<choice location="random" correct="true"><span><math>a+b^2</math><br/></span></choice>
<choice location="random" correct="false"><math>a+b+c</math></choice>
<choice location="bottom" correct="false"><math>a+b+d</math></choice>
</choicegroup>
</multiplechoiceresponse>
...
...
@@ -406,7 +406,7 @@ class SchematicResponse(GenericResponse):
id
=
xml
.
get
(
'id'
))[
0
]
answer_src
=
answer
.
get
(
'src'
)
if
answer_src
!=
None
:
self
.
code
=
open
(
settings
.
DATA_DIR
+
'src/'
+
answer_src
)
.
read
()
self
.
code
=
self
.
system
.
filestore
.
open
(
'src/'
+
answer_src
)
.
read
()
# Untested; never used
else
:
self
.
code
=
answer
.
text
...
...
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