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
ce3b84d0
Commit
ce3b84d0
authored
Dec 12, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message passing in lms
parent
b782f712
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
common/lib/capa/capa/capa_problem.py
+8
-0
common/lib/capa/capa/responsetypes.py
+7
-1
common/lib/xmodule/xmodule/capa_module.py
+2
-2
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+1
-1
No files found.
common/lib/capa/capa/capa_problem.py
View file @
ce3b84d0
...
...
@@ -186,6 +186,14 @@ class LoncapaProblem(object):
maxscore
+=
responder
.
get_max_score
()
return
maxscore
def
message_post
(
self
,
event_info
):
"""
Handle an ajax post that contains feedback on feedback
"""
for
responder
in
self
.
responders
.
values
():
if
hasattr
(
responder
,
'message_post'
):
responder
.
message_post
(
event_info
)
def
get_score
(
self
):
"""
Compute score for this problem. The score is the number of points awarded.
...
...
common/lib/capa/capa/responsetypes.py
View file @
ce3b84d0
...
...
@@ -1854,6 +1854,10 @@ class OpenEndedResponse(LoncapaResponse):
prompt
=
self
.
xml
.
find
(
'prompt'
)
rubric
=
self
.
xml
.
find
(
'openendedrubric'
)
#This is needed to attach feedback to specific responses later
self
.
submission_id
=
None
self
.
grader_id
=
None
if
oeparam
is
None
:
raise
ValueError
(
"No oeparam found in problem xml."
)
if
prompt
is
None
:
...
...
@@ -2139,13 +2143,15 @@ class OpenEndedResponse(LoncapaResponse):
" Received score_result = {0}"
.
format
(
score_result
))
return
fail
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
]:
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
,
'grader_id'
,
'submission_id'
]:
if
tag
not
in
score_result
:
log
.
error
(
"External grader message is missing required tag: {0}"
.
format
(
tag
))
return
fail
feedback
=
self
.
_format_feedback
(
score_result
)
self
.
submission_id
=
score_result
[
'submission_id'
]
self
.
grader_id
=
score_result
[
'grader_id'
]
# HACK: for now, just assume it's correct if you got more than 2/3.
# Also assumes that score_result['score'] is an integer.
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
ce3b84d0
...
...
@@ -402,10 +402,10 @@ class CapaModule(XModule):
event_info
=
dict
()
event_info
[
'state'
]
=
self
.
lcp
.
get_state
()
event_info
[
'problem_id'
]
=
self
.
location
.
url
()
event_info
[
'student_id'
]
=
self
.
system
.
anonymous_s
ystem
_id
event_info
[
'student_id'
]
=
self
.
system
.
anonymous_s
tudent
_id
event_info
[
'survey_responses'
]
=
get
log
.
debug
(
event_info
)
success_dict
=
self
.
lcp
.
message_post
(
event_info
)
return
{
'success'
:
True
}
...
...
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
ce3b84d0
...
...
@@ -203,7 +203,7 @@ class @Problem
fd
=
new
FormData
()
feedback
=
@
$
(
'section.evaluation textarea.feedback-on-feedback'
)[
0
]
fd
.
append
(
feedback
.
class
,
feedback
.
value
)
fd
.
append
(
'feedback'
,
feedback
.
value
)
settings
=
type
:
"POST"
...
...
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