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
254eae03
Commit
254eae03
authored
Jan 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in support for passing problem type to javascript
parent
3a6c660b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
14 deletions
+44
-14
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+36
-5
common/lib/xmodule/xmodule/open_ended_module.py
+2
-1
common/lib/xmodule/xmodule/self_assessment_module.py
+2
-1
lms/templates/open_ended.html
+2
-5
lms/templates/self_assessment_hint.html
+1
-1
lms/templates/self_assessment_prompt.html
+1
-1
No files found.
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
254eae03
...
...
@@ -25,6 +25,7 @@ class @CombinedOpenEnded
@
message_wrapper
=
@
$
(
'.message-wrapper'
)
@
submit_button
=
@
$
(
'.submit-button'
)
@
child_state
=
@
el
.
data
(
'state'
)
@
child_type
=
@
el
.
data
(
'child-type'
)
@
open_ended_child
=
@
$
(
'.open-ended-child'
)
...
...
@@ -54,7 +55,7 @@ class @CombinedOpenEnded
@
submit_button
.
click
@
save_assessment
else
if
@
child_state
==
'post_assessment'
@
answer_area
.
attr
(
"disabled"
,
true
)
@
submit_button
.
prop
(
'value'
,
'Submit
hi
nt'
)
@
submit_button
.
prop
(
'value'
,
'Submit
post-assessme
nt'
)
@
submit_button
.
click
@
save_hint
else
if
@
child_state
==
'done'
@
answer_area
.
attr
(
"disabled"
,
true
)
...
...
@@ -74,7 +75,8 @@ class @CombinedOpenEnded
@
assessment
=
@
$
(
'select.assessment'
)
find_hint_elements
:
->
@
hint_area
=
@
$
(
'textarea.hint'
)
@
hint_area
=
@
$
(
'textarea.post_assessment'
)
@
hint_box
=
@
$
(
''
)
save_answer
:
(
event
)
=>
event
.
preventDefault
()
...
...
@@ -118,7 +120,7 @@ class @CombinedOpenEnded
if
@
child_state
==
'post_assessment'
data
=
{
'hint'
:
@
hint_area
.
val
()}
$
.
postWithPrefix
"
#{
@
ajax_url
}
/save_
hi
nt"
,
data
,
(
response
)
=>
$
.
postWithPrefix
"
#{
@
ajax_url
}
/save_
post_assessme
nt"
,
data
,
(
response
)
=>
if
response
.
success
@
message_wrapper
.
html
(
response
.
message_html
)
@
child_state
=
'done'
...
...
@@ -164,4 +166,33 @@ class @CombinedOpenEnded
else
@
errors_area
.
html
(
response
.
error
)
else
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
\ No newline at end of file
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
message_post
:
=>
Logger
.
log
'message_post'
,
@
answers
fd
=
new
FormData
()
feedback
=
@
$
(
'section.evaluation textarea.feedback-on-feedback'
)[
0
].
value
submission_id
=
$
(
'div.external-grader-message div.submission_id'
)[
0
].
innerHTML
grader_id
=
$
(
'div.external-grader-message div.grader_id'
)[
0
].
innerHTML
score
=
$
(
".evaluation-scoring input:radio[name='evaluation-score']:checked"
).
val
()
fd
.
append
(
'feedback'
,
feedback
)
fd
.
append
(
'submission_id'
,
submission_id
)
fd
.
append
(
'grader_id'
,
grader_id
)
if
(
!
score
)
@
gentle_alert
"You need to pick a rating before you can submit."
return
else
fd
.
append
(
'score'
,
score
)
settings
=
type
:
"POST"
data
:
fd
processData
:
false
contentType
:
false
success
:
(
response
)
=>
@
gentle_alert
response
.
message
@
$
(
'section.evaluation'
).
slideToggle
()
$
.
ajaxWithPrefix
(
"
#{
@
url
}
/message_post"
,
settings
)
\ No newline at end of file
common/lib/xmodule/xmodule/open_ended_module.py
View file @
254eae03
...
...
@@ -485,7 +485,7 @@ class OpenEndedModule():
'problem_reset'
:
self
.
reset_problem
,
'save_answer'
:
self
.
save_answer
,
'score_update'
:
self
.
update_score
,
'
message_pos
t'
:
self
.
message_post
,
'
save_post_assessmen
t'
:
self
.
message_post
,
}
if
dispatch
not
in
handlers
:
...
...
@@ -624,6 +624,7 @@ class OpenEndedModule():
'hidden'
:
''
,
'id'
:
'open_ended'
,
'msg'
:
self
.
latest_feedback
(),
'child_type'
:
'openended'
,
}
html
=
system
.
render_template
(
'open_ended.html'
,
context
)
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
254eae03
...
...
@@ -235,6 +235,7 @@ class SelfAssessmentModule():
'initial_message'
:
self
.
get_message_html
(),
'state'
:
self
.
state
,
'allow_reset'
:
self
.
_allow_reset
(),
'child_type'
:
'selfassessment'
,
}
html
=
system
.
render_template
(
'self_assessment_prompt.html'
,
context
)
...
...
@@ -281,7 +282,7 @@ class SelfAssessmentModule():
handlers
=
{
'save_answer'
:
self
.
save_answer
,
'save_assessment'
:
self
.
save_assessment
,
'save_
hi
nt'
:
self
.
save_hint
,
'save_
post_assessme
nt'
:
self
.
save_hint
,
'reset'
:
self
.
reset
,
}
...
...
lms/templates/open_ended.html
View file @
254eae03
<section
id=
"openended_${id}"
class=
"open-ended-child"
data-state=
"${state}"
>
<section
id=
"openended_${id}"
class=
"open-ended-child"
data-state=
"${state}"
data-child-type=
"${child_type}"
>
<div
class=
"error"
></div>
<div
class=
"prompt"
>
...
...
@@ -35,7 +35,7 @@
% endif
<div
class=
"external-grader-message"
>
${msg|n}
% if state == '
done
':
% if state == '
post_assessment
':
<div
class=
"collapsible evaluation-response"
>
<header>
<a
href=
"#"
>
Respond to Feedback
</a>
...
...
@@ -53,9 +53,6 @@
</div>
<p>
Additional comments:
</p>
<textarea
rows=
"${rows}"
cols=
"${cols}"
name=
"feedback_${id}"
class=
"feedback-on-feedback"
id=
"feedback_${id}"
></textarea>
<div
class=
"submit-message-container"
>
<input
name=
"submit-message"
class=
"submit-message"
type=
"button"
value=
"Submit your message"
/>
</div>
</section>
</div>
% endif
...
...
lms/templates/self_assessment_hint.html
View file @
254eae03
...
...
@@ -2,6 +2,6 @@
<div
class=
"hint-prompt"
>
${hint_prompt}
</div>
<textarea
name=
"
hint"
class=
"hi
nt"
cols=
"70"
rows=
"5"
<textarea
name=
"
post_assessment"
class=
"post_assessme
nt"
cols=
"70"
rows=
"5"
${'
readonly=
"true"
'
if
read_only
else
''}
>
${hint}
</textarea>
</div>
lms/templates/self_assessment_prompt.html
View file @
254eae03
<section
id=
"self_assessment_${id}"
class=
"open-ended-child"
data-ajax-url=
"${ajax_url}"
data-id=
"${id}"
data-state=
"${state}"
data-allow_reset=
"${allow_reset}"
>
data-id=
"${id}"
data-state=
"${state}"
data-allow_reset=
"${allow_reset}"
data-child-type=
"${child_type}"
>
<div
class=
"error"
></div>
<div
class=
"prompt"
>
${prompt}
...
...
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