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
48402055
Commit
48402055
authored
Jan 30, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CSS nicer
parent
eb5d14a2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
23 deletions
+50
-23
common/lib/xmodule/xmodule/css/combinedopenended/display.scss
+8
-0
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+3
-3
common/lib/xmodule/xmodule/open_ended_module.py
+14
-6
common/lib/xmodule/xmodule/openendedchild.py
+11
-8
common/lib/xmodule/xmodule/self_assessment_module.py
+12
-6
lms/templates/open_ended.html
+1
-0
lms/templates/self_assessment_prompt.html
+1
-0
No files found.
common/lib/xmodule/xmodule/css/combinedopenended/display.scss
View file @
48402055
...
...
@@ -442,6 +442,14 @@ section.open-ended-child {
margin
:
10px
;
}
span
.short-form-response
{
padding
:
9px
;
background
:
#F6F6F6
;
border
:
1px
solid
#ddd
;
border-top
:
0
;
margin-bottom
:
20px
;
@include
clearfix
;
}
.grader-status
{
padding
:
9px
;
...
...
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
48402055
...
...
@@ -80,7 +80,7 @@ class @CombinedOpenEnded
@
submit_evaluation_button
.
click
@
message_post
Collapsible
.
setCollapsibles
(
@
results_container
)
else
@
errors_area
.
html
(
response
.
error
)
@
gentle_alert
response
.
error
message_post
:
(
event
)
=>
Logger
.
log
'message_post'
,
@
answers
...
...
@@ -208,11 +208,12 @@ class @CombinedOpenEnded
if
response
.
success
@
rubric_wrapper
.
html
(
response
.
rubric_html
)
@
rubric_wrapper
.
show
()
@
answer_area
.
html
(
response
.
student_response
)
@
child_state
=
'assessing'
@
find_assessment_elements
()
@
rebind
()
else
@
errors_area
.
html
(
response
.
error
)
@
gentle_alert
response
.
error
$
.
ajaxWithPrefix
(
"
#{
@
ajax_url
}
/save_answer"
,
settings
)
...
...
@@ -351,5 +352,4 @@ class @CombinedOpenEnded
answer_val
=
@
answer_area
.
val
()
new_text
=
''
new_text
=
"<span class='
#{
answer_class
}
' id='
#{
answer_id
}
'>
#{
answer_val
}
</span>"
@
gentle_alert
new_text
@
answer_area
.
replaceWith
(
new_text
)
common/lib/xmodule/xmodule/open_ended_module.py
View file @
48402055
...
...
@@ -553,13 +553,21 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
return
self
.
out_of_sync_error
(
get
)
# add new history element with answer and empty score and hint.
get
=
self
.
append_image_to_student_answer
(
get
)
get
[
'student_answer'
]
=
OpenEndedModule
.
sanitize_html
(
get
[
'student_answer'
])
self
.
new_history_entry
(
get
[
'student_answer'
])
self
.
send_to_grader
(
get
[
'student_answer'
],
system
)
self
.
change_state
(
self
.
ASSESSING
)
success
,
get
=
self
.
append_image_to_student_answer
(
get
)
error_message
=
""
if
success
:
get
[
'student_answer'
]
=
OpenEndedModule
.
sanitize_html
(
get
[
'student_answer'
])
self
.
new_history_entry
(
get
[
'student_answer'
])
self
.
send_to_grader
(
get
[
'student_answer'
],
system
)
self
.
change_state
(
self
.
ASSESSING
)
else
:
error_message
=
"There was a problem saving the image in your submission. Please try a different image."
return
{
'success'
:
True
,
}
return
{
'success'
:
True
,
'error'
:
error_message
,
'student_response'
:
get
[
'student_answer'
]
}
def
update_score
(
self
,
get
,
system
):
"""
...
...
common/lib/xmodule/xmodule/openendedchild.py
View file @
48402055
...
...
@@ -308,30 +308,33 @@ class OpenEndedChild(object):
return
success
,
s3_public_url
def
check_for_image_and_upload
(
self
,
get_data
):
success
=
False
error
=
False
has_file_to_upload
=
False
success
=
False
image_tag
=
""
if
'can_upload_files'
in
get_data
:
if
get_data
[
'can_upload_files'
]
==
'true'
:
has_file_to_upload
=
True
file
=
get_data
[
'student_file'
][
0
]
success
,
s3_public_url
=
self
.
upload_image_to_s3
(
file
)
if
success
:
image_tag
=
self
.
generate_image_tag_from_url
(
s3_public_url
,
file
.
name
)
error
=
not
success
return
success
,
error
,
image_tag
return
success
,
has_file_to_upload
,
image_tag
def
generate_image_tag_from_url
(
self
,
s3_public_url
,
image_name
):
image_template
=
"""
<a href="{0}">{1}</a>
<a href="{0}"
target="_blank"
>{1}</a>
"""
.
format
(
s3_public_url
,
image_name
)
return
image_template
def
append_image_to_student_answer
(
self
,
get_data
):
success
,
error
,
image_tag
=
self
.
check_for_image_and_upload
(
get_data
)
if
success
and
not
error
:
if
not
self
.
accept_file_upload
:
return
True
,
get_data
success
,
has_file_to_upload
,
image_tag
=
self
.
check_for_image_and_upload
(
get_data
)
if
success
and
has_file_to_upload
:
get_data
[
'student_answer'
]
+=
image_tag
return
get_data
return
(
success
and
has_file_to_upload
),
get_data
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
48402055
...
...
@@ -202,15 +202,21 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
if
self
.
state
!=
self
.
INITIAL
:
return
self
.
out_of_sync_error
(
get
)
error_message
=
""
# add new history element with answer and empty score and hint.
get
=
self
.
append_image_to_student_answer
(
get
)
get
[
'student_answer'
]
=
SelfAssessmentModule
.
sanitize_html
(
get
[
'student_answer'
])
self
.
new_history_entry
(
get
[
'student_answer'
])
self
.
change_state
(
self
.
ASSESSING
)
success
,
get
=
self
.
append_image_to_student_answer
(
get
)
if
success
:
get
[
'student_answer'
]
=
SelfAssessmentModule
.
sanitize_html
(
get
[
'student_answer'
])
self
.
new_history_entry
(
get
[
'student_answer'
])
self
.
change_state
(
self
.
ASSESSING
)
else
:
error_message
=
"There was a problem saving the image in your submission. Please try a different image."
return
{
'success'
:
True
,
'rubric_html'
:
self
.
get_rubric_html
(
system
)
'success'
:
success
,
'rubric_html'
:
self
.
get_rubric_html
(
system
),
'error'
:
error_message
,
'student_response'
:
get
[
'student_answer'
],
}
def
save_assessment
(
self
,
get
,
system
):
...
...
lms/templates/open_ended.html
View file @
48402055
...
...
@@ -3,6 +3,7 @@
<div
class=
"prompt"
>
${prompt|n}
</div>
<h4>
Answer
</h4>
<textarea
rows=
"${rows}"
cols=
"${cols}"
name=
"answer"
class=
"answer short-form-response"
id=
"input_${id}"
>
${previous_answer|h}
</textarea>
<div
class=
"message-wrapper"
></div>
...
...
lms/templates/self_assessment_prompt.html
View file @
48402055
...
...
@@ -5,6 +5,7 @@
${prompt}
</div>
<h4>
Answer
</h4>
<div>
<textarea
name=
"answer"
class=
"answer short-form-response"
cols=
"70"
rows=
"20"
>
${previous_answer|n}
</textarea>
</div>
...
...
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