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
a1552654
Commit
a1552654
authored
Oct 29, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor whitespace + comment fixes
parent
6cc19639
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
14 deletions
+7
-14
common/lib/capa/capa/correctmap.py
+1
-1
common/lib/capa/capa/responsetypes.py
+3
-5
common/lib/xmodule/xmodule/capa_module.py
+0
-6
lms/djangoapps/courseware/module_render.py
+3
-2
No files found.
common/lib/capa/capa/correctmap.py
View file @
a1552654
...
@@ -68,7 +68,7 @@ class CorrectMap(object):
...
@@ -68,7 +68,7 @@ class CorrectMap(object):
correct_map is saved by LMS as a plaintext JSON dump of the correctmap dict. This
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,
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.
defined by self.set.
For graceful migration, feed the contents of each correct map to self.set, rather than
For graceful migration, feed the contents of each correct map to self.set, rather than
...
...
common/lib/capa/capa/responsetypes.py
View file @
a1552654
...
@@ -149,6 +149,7 @@ class LoncapaResponse(object):
...
@@ -149,6 +149,7 @@ class LoncapaResponse(object):
# for convenience
# for convenience
self
.
answer_id
=
self
.
answer_ids
[
0
]
self
.
answer_id
=
self
.
answer_ids
[
0
]
# map input_id -> maxpoints
self
.
maxpoints
=
dict
()
self
.
maxpoints
=
dict
()
for
inputfield
in
self
.
inputfields
:
for
inputfield
in
self
.
inputfields
:
# By default, each answerfield is worth 1 point
# By default, each answerfield is worth 1 point
...
@@ -280,17 +281,14 @@ class LoncapaResponse(object):
...
@@ -280,17 +281,14 @@ class LoncapaResponse(object):
(correctness, npoints, msg) for each answer_id.
(correctness, npoints, msg) for each answer_id.
Arguments:
Arguments:
- student_answers : dict of (answer_id,answer) where answer = student input (string)
- 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
'''
'''
pass
pass
@abc.abstractmethod
@abc.abstractmethod
def
get_answers
(
self
):
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
pass
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
a1552654
...
@@ -538,15 +538,9 @@ class CapaModule(XModule):
...
@@ -538,15 +538,9 @@ class CapaModule(XModule):
lcp_id
=
self
.
lcp
.
problem_id
lcp_id
=
self
.
lcp
.
problem_id
correct_map
=
self
.
lcp
.
grade_answers
(
answers
)
correct_map
=
self
.
lcp
.
grade_answers
(
answers
)
except
StudentInputError
as
inst
:
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"
)
log
.
exception
(
"StudentInputError in capa_module:problem_check"
)
return
{
'success'
:
inst
.
message
}
return
{
'success'
:
inst
.
message
}
except
Exception
,
err
:
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
:
if
self
.
system
.
DEBUG
:
msg
=
"Error checking problem: "
+
str
(
err
)
msg
=
"Error checking problem: "
+
str
(
err
)
msg
+=
'
\n
Traceback:
\n
'
+
traceback
.
format_exc
()
msg
+=
'
\n
Traceback:
\n
'
+
traceback
.
format_exc
()
...
...
lms/djangoapps/courseware/module_render.py
View file @
a1552654
...
@@ -337,7 +337,7 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
...
@@ -337,7 +337,7 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
'''
'''
# Test xqueue package, which we expect to be:
# Test xqueue package, which we expect to be:
# xpackage = {'xqueue_header': json.dumps({'lms_key':'secretkey',...}),
# xpackage = {'xqueue_header': json.dumps({'lms_key':'secretkey',...}),
# 'xqueue_body' : 'Message from grader}
# 'xqueue_body' : 'Message from grader
'
}
get
=
request
.
POST
.
copy
()
get
=
request
.
POST
.
copy
()
for
key
in
[
'xqueue_header'
,
'xqueue_body'
]:
for
key
in
[
'xqueue_header'
,
'xqueue_body'
]:
if
not
get
.
has_key
(
key
):
if
not
get
.
has_key
(
key
):
...
@@ -372,7 +372,8 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
...
@@ -372,7 +372,8 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
# We go through the "AJAX" path
# We go through the "AJAX" path
# So far, the only dispatch from xqueue will be 'score_update'
# So far, the only dispatch from xqueue will be 'score_update'
try
:
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
:
except
:
log
.
exception
(
"error processing ajax call"
)
log
.
exception
(
"error processing ajax call"
)
raise
raise
...
...
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