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
70bab29b
Commit
70bab29b
authored
Oct 31, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1001 from MITx/feature/victor/inputtypes-refactor
Feature/victor/inputtypes refactor
parents
55f74a89
36398cc4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
22 deletions
+15
-22
common/lib/capa/capa/correctmap.py
+1
-1
common/lib/capa/capa/inputtypes.py
+1
-1
common/lib/capa/capa/responsetypes.py
+4
-6
common/lib/xmodule/xmodule/capa_module.py
+0
-6
lms/djangoapps/courseware/module_render.py
+9
-8
No files found.
common/lib/capa/capa/correctmap.py
View file @
70bab29b
...
...
@@ -68,7 +68,7 @@ class CorrectMap(object):
correct_map is saved by LMS as a plaintext JSON dump of the correctmap dict. This
means that when the definition of CorrectMap (e.g. its properties) are altered,
an existing correct_map dict not coincide with the newest CorrectMap format as
an existing correct_map dict
will
not coincide with the newest CorrectMap format as
defined by self.set.
For graceful migration, feed the contents of each correct map to self.set, rather than
...
...
common/lib/capa/capa/inputtypes.py
View file @
70bab29b
...
...
@@ -396,7 +396,7 @@ class FileSubmission(InputTypeBase):
self
.
required_files
=
saxutils
.
escape
(
self
.
required_files
,
escapedict
)
# Check if problem has been queued
queue_len
=
0
self
.
queue_len
=
0
# Flag indicating that the problem has been queued, 'msg' is length of queue
if
self
.
status
==
'incomplete'
:
self
.
status
=
'queued'
...
...
common/lib/capa/capa/responsetypes.py
View file @
70bab29b
...
...
@@ -81,7 +81,7 @@ class LoncapaResponse(object):
by __init__
- check_hint_condition : check to see if the student's answers satisfy a particular
condition for a hint to be displayed
condition for a hint to be displayed
- render_html : render this Response as HTML (must return XHTML-compliant string)
- __unicode__ : unicode representation of this Response
...
...
@@ -149,6 +149,7 @@ class LoncapaResponse(object):
# for convenience
self
.
answer_id
=
self
.
answer_ids
[
0
]
# map input_id -> maxpoints
self
.
maxpoints
=
dict
()
for
inputfield
in
self
.
inputfields
:
# By default, each answerfield is worth 1 point
...
...
@@ -280,17 +281,14 @@ class LoncapaResponse(object):
(correctness, npoints, msg) for each answer_id.
Arguments:
- student_answers : dict of (answer_id,answer) where answer = student input (string)
- old_cmap : previous CorrectMap (may be empty); useful for analyzing or
recording history of responses
- student_answers : dict of (answer_id, answer) where answer = student input (string)
'''
pass
@abc.abstractmethod
def
get_answers
(
self
):
'''
Return a dict of (answer_id,answer_text) for each answer for this question.
Return a dict of (answer_id,
answer_text) for each answer for this question.
'''
pass
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
70bab29b
...
...
@@ -538,15 +538,9 @@ class CapaModule(XModule):
lcp_id
=
self
.
lcp
.
problem_id
correct_map
=
self
.
lcp
.
grade_answers
(
answers
)
except
StudentInputError
as
inst
:
# TODO (vshnayder): why is this line here?
#self.lcp = LoncapaProblem(self.definition['data'],
# id=lcp_id, state=old_state, system=self.system)
log
.
exception
(
"StudentInputError in capa_module:problem_check"
)
return
{
'success'
:
inst
.
message
}
except
Exception
,
err
:
# TODO: why is this line here?
#self.lcp = LoncapaProblem(self.definition['data'],
# id=lcp_id, state=old_state, system=self.system)
if
self
.
system
.
DEBUG
:
msg
=
"Error checking problem: "
+
str
(
err
)
msg
+=
'
\n
Traceback:
\n
'
+
traceback
.
format_exc
()
...
...
lms/djangoapps/courseware/module_render.py
View file @
70bab29b
...
...
@@ -337,7 +337,7 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
'''
# Test xqueue package, which we expect to be:
# xpackage = {'xqueue_header': json.dumps({'lms_key':'secretkey',...}),
# 'xqueue_body' : 'Message from grader}
# 'xqueue_body' : 'Message from grader
'
}
get
=
request
.
POST
.
copy
()
for
key
in
[
'xqueue_header'
,
'xqueue_body'
]:
if
not
get
.
has_key
(
key
):
...
...
@@ -372,7 +372,8 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
# We go through the "AJAX" path
# So far, the only dispatch from xqueue will be 'score_update'
try
:
ajax_return
=
instance
.
handle_ajax
(
dispatch
,
get
)
# Can ignore the "ajax" return in 'xqueue_callback'
# Can ignore the return value--not used for xqueue_callback
instance
.
handle_ajax
(
dispatch
,
get
)
except
:
log
.
exception
(
"error processing ajax call"
)
raise
...
...
@@ -386,12 +387,12 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
#Bin score into range and increment stats
score_bucket
=
get_score_bucket
(
instance_module
.
grade
,
instance_module
.
max_grade
)
org
,
course_num
,
run
=
course_id
.
split
(
"/"
)
org
,
course_num
,
run
=
course_id
.
split
(
"/"
)
statsd
.
increment
(
"lms.courseware.question_answered"
,
tags
=
[
"org:{0}"
.
format
(
org
),
"course:{0}"
.
format
(
course_num
),
"run:{0}"
.
format
(
run
),
"score_bucket:{0}"
.
format
(
score_bucket
),
"run:{0}"
.
format
(
run
),
"score_bucket:{0}"
.
format
(
score_bucket
),
"type:xqueue"
])
return
HttpResponse
(
""
)
...
...
@@ -479,12 +480,12 @@ def modx_dispatch(request, dispatch, location, course_id):
#Bin score into range and increment stats
score_bucket
=
get_score_bucket
(
instance_module
.
grade
,
instance_module
.
max_grade
)
org
,
course_num
,
run
=
course_id
.
split
(
"/"
)
org
,
course_num
,
run
=
course_id
.
split
(
"/"
)
statsd
.
increment
(
"lms.courseware.question_answered"
,
tags
=
[
"org:{0}"
.
format
(
org
),
"course:{0}"
.
format
(
course_num
),
"run:{0}"
.
format
(
run
),
"score_bucket:{0}"
.
format
(
score_bucket
),
"run:{0}"
.
format
(
run
),
"score_bucket:{0}"
.
format
(
score_bucket
),
"type:ajax"
])
...
...
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