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
26541bb7
Commit
26541bb7
authored
May 01, 2012
by
Lyla Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed naming convention on response types
parent
05d96b79
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
djangoapps/courseware/capa/capa_problem.py
+6
-6
djangoapps/courseware/capa/responsetypes.py
+5
-5
No files found.
djangoapps/courseware/capa/capa_problem.py
View file @
26541bb7
...
@@ -15,18 +15,18 @@ from mako.template import Template
...
@@ -15,18 +15,18 @@ from mako.template import Template
from
util
import
contextualize_text
from
util
import
contextualize_text
import
inputtypes
import
inputtypes
from
responsetypes
import
numericalresponse
,
formularesponse
,
customresponse
,
schematicresponse
,
multiplechoicer
esponse
,
StudentInputError
from
responsetypes
import
NumericalResponse
,
FormulaResponse
,
CustomResponse
,
SchematicResponse
,
MultipleChoiceR
esponse
,
StudentInputError
import
calc
import
calc
import
eia
import
eia
log
=
logging
.
getLogger
(
"mitx.courseware"
)
log
=
logging
.
getLogger
(
"mitx.courseware"
)
response_types
=
{
'numericalresponse'
:
numericalr
esponse
,
response_types
=
{
'numericalresponse'
:
NumericalR
esponse
,
'formularesponse'
:
formular
esponse
,
'formularesponse'
:
FormulaR
esponse
,
'customresponse'
:
customr
esponse
,
'customresponse'
:
CustomR
esponse
,
'schematicresponse'
:
schematicr
esponse
,
'schematicresponse'
:
SchematicR
esponse
,
'multiplechoiceresponse'
:
multiplechoicer
esponse
}
'multiplechoiceresponse'
:
MultipleChoiceR
esponse
}
entry_types
=
[
'textline'
,
'schematic'
,
'choicegroup'
]
entry_types
=
[
'textline'
,
'schematic'
,
'choicegroup'
]
response_properties
=
[
"responseparam"
,
"answer"
]
response_properties
=
[
"responseparam"
,
"answer"
]
# How to convert from original XML to HTML
# How to convert from original XML to HTML
...
...
djangoapps/courseware/capa/responsetypes.py
View file @
26541bb7
...
@@ -38,7 +38,7 @@ def compare_with_tolerance(v1, v2, tol):
...
@@ -38,7 +38,7 @@ def compare_with_tolerance(v1, v2, tol):
#Every response type needs methods "grade" and "get_answers"
#Every response type needs methods "grade" and "get_answers"
class
multiplechoicer
esponse
(
object
):
class
MultipleChoiceR
esponse
(
object
):
def
__init__
(
self
,
xml
,
context
):
def
__init__
(
self
,
xml
,
context
):
self
.
xml
=
xml
self
.
xml
=
xml
self
.
correct_choices
=
xml
.
xpath
(
'//*[@id=$id]//choice[@correct="true"]'
,
self
.
correct_choices
=
xml
.
xpath
(
'//*[@id=$id]//choice[@correct="true"]'
,
...
@@ -62,7 +62,7 @@ class multiplechoiceresponse(object):
...
@@ -62,7 +62,7 @@ class multiplechoiceresponse(object):
def
get_answers
(
self
):
def
get_answers
(
self
):
return
{
self
.
answer_id
:
self
.
correct_choices
}
return
{
self
.
answer_id
:
self
.
correct_choices
}
class
numericalr
esponse
(
object
):
class
NumericalR
esponse
(
object
):
def
__init__
(
self
,
xml
,
context
):
def
__init__
(
self
,
xml
,
context
):
self
.
xml
=
xml
self
.
xml
=
xml
self
.
correct_answer
=
contextualize_text
(
xml
.
get
(
'answer'
),
context
)
self
.
correct_answer
=
contextualize_text
(
xml
.
get
(
'answer'
),
context
)
...
@@ -91,7 +91,7 @@ class numericalresponse(object):
...
@@ -91,7 +91,7 @@ class numericalresponse(object):
def
get_answers
(
self
):
def
get_answers
(
self
):
return
{
self
.
answer_id
:
self
.
correct_answer
}
return
{
self
.
answer_id
:
self
.
correct_answer
}
class
customr
esponse
(
object
):
class
CustomR
esponse
(
object
):
def
__init__
(
self
,
xml
,
context
):
def
__init__
(
self
,
xml
,
context
):
self
.
xml
=
xml
self
.
xml
=
xml
## CRITICAL TODO: Should cover all entrytypes
## CRITICAL TODO: Should cover all entrytypes
...
@@ -122,7 +122,7 @@ class customresponse(object):
...
@@ -122,7 +122,7 @@ class customresponse(object):
class
StudentInputError
(
Exception
):
class
StudentInputError
(
Exception
):
pass
pass
class
formular
esponse
(
object
):
class
FormulaR
esponse
(
object
):
def
__init__
(
self
,
xml
,
context
):
def
__init__
(
self
,
xml
,
context
):
self
.
xml
=
xml
self
.
xml
=
xml
self
.
correct_answer
=
contextualize_text
(
xml
.
get
(
'answer'
),
context
)
self
.
correct_answer
=
contextualize_text
(
xml
.
get
(
'answer'
),
context
)
...
@@ -192,7 +192,7 @@ class formularesponse(object):
...
@@ -192,7 +192,7 @@ class formularesponse(object):
def
get_answers
(
self
):
def
get_answers
(
self
):
return
{
self
.
answer_id
:
self
.
correct_answer
}
return
{
self
.
answer_id
:
self
.
correct_answer
}
class
schematicr
esponse
(
object
):
class
SchematicR
esponse
(
object
):
def
__init__
(
self
,
xml
,
context
):
def
__init__
(
self
,
xml
,
context
):
self
.
xml
=
xml
self
.
xml
=
xml
self
.
answer_ids
=
xml
.
xpath
(
'//*[@id=$id]//schematic/@id'
,
self
.
answer_ids
=
xml
.
xpath
(
'//*[@id=$id]//schematic/@id'
,
...
...
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