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
8ef45915
Commit
8ef45915
authored
Feb 08, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move legend and status around to find optimal placements
parent
dbfc77e4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
14 deletions
+44
-14
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
+14
-0
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+10
-0
lms/templates/combined_open_ended.html
+5
-4
lms/templates/combined_open_ended_legend.html
+12
-0
lms/templates/combined_open_ended_status.html
+3
-10
No files found.
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
View file @
8ef45915
...
...
@@ -358,6 +358,7 @@ class CombinedOpenEndedV1Module():
'status'
:
self
.
get_status
(),
'display_name'
:
self
.
display_name
,
'accept_file_upload'
:
self
.
accept_file_upload
,
'legend_list'
:
LEGEND_LIST
,
}
return
context
...
...
@@ -554,6 +555,18 @@ class CombinedOpenEndedV1Module():
html
=
self
.
system
.
render_template
(
'combined_open_ended_results.html'
,
context
)
return
{
'html'
:
html
,
'success'
:
True
}
def
get_legend
(
self
,
get
):
"""
Gets the results of a given grader via ajax.
Input: AJAX get dictionary
Output: Dictionary to be rendered via ajax that contains the result html.
"""
context
=
{
'legend_list'
:
LEGEND_LIST
,
}
html
=
self
.
system
.
render_template
(
'combined_open_ended_legend.html'
,
context
)
return
{
'html'
:
html
,
'success'
:
True
}
def
get_results
(
self
,
get
):
"""
Gets the results of a given grader via ajax.
...
...
@@ -598,6 +611,7 @@ class CombinedOpenEndedV1Module():
'get_results'
:
self
.
get_results
,
'get_combined_rubric'
:
self
.
get_rubric
,
'get_status'
:
self
.
get_status_ajax
,
'get_legend'
:
self
.
get_legend
,
}
if
dispatch
not
in
handlers
:
...
...
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
8ef45915
...
...
@@ -67,6 +67,9 @@ class @CombinedOpenEnded
@
results_container
=
$
(
'.result-container'
)
@
combined_rubric_container
=
$
(
'.combined-rubric-container'
)
@
legend_container
=
$
(
'.legend-container'
)
@
show_legend_current
()
# Where to put the rubric once we load it
@
el
=
$
(
element
).
find
(
'section.open-ended-child'
)
@
errors_area
=
@
$
(
'.error'
)
...
...
@@ -141,6 +144,13 @@ class @CombinedOpenEnded
@
status_container
.
after
(
response
.
html
).
remove
()
@
status_container
=
$
(
'.status-elements'
)
show_legend_current
:
()
=>
data
=
{}
$
.
postWithPrefix
"
#{
@
ajax_url
}
/get_legend"
,
data
,
(
response
)
=>
if
response
.
success
@
legend_container
.
after
(
response
.
html
).
remove
()
@
legend_container
=
$
(
'.legend-container'
)
message_post
:
(
event
)
=>
Logger
.
log
'message_post'
,
@
answers
external_grader_message
=
$
(
event
.
target
).
parent
().
parent
().
parent
()
...
...
lms/templates/combined_open_ended.html
View file @
8ef45915
<section
id=
"combined-open-ended"
class=
"combined-open-ended"
data-ajax-url=
"${ajax_url}"
data-allow_reset=
"${allow_reset}"
data-state=
"${state}"
data-task-count=
"${task_count}"
data-task-number=
"${task_number}"
data-accept-file-upload =
"${accept_file_upload}"
>
<div
class=
"status-container"
>
${status|n}
</div>
<h2>
${display_name}
</h2>
<div
class=
"item-container"
>
...
...
@@ -13,10 +15,9 @@
<input
type=
"button"
value=
"Reset"
class=
"reset-button"
name=
"reset"
/>
<input
type=
"button"
value=
"Next Step"
class=
"next-step-button"
name=
"reset"
/>
</div>
<div
class=
"status-container"
>
${status | n}
</div>
<section
class=
"legend-container"
>
</section>
<div
class=
"combined-rubric-container"
>
</div>
...
...
lms/templates/combined_open_ended_legend.html
0 → 100644
View file @
8ef45915
<section
class=
"legend-container"
>
<div
class=
"legenditem"
>
</div>
% for i in xrange(0,len(legend_list)):
<
%
legend_title=
legend_list[i]['name']
%
>
<
%
legend_image=
legend_list[i]['image']
%
>
<div
class=
"legenditem"
>
${legend_title}=
<img
src=
"${legend_image}"
title=
${legend_title}
>
</div>
% endfor
</section>
lms/templates/combined_open_ended_status.html
View file @
8ef45915
<div
class=
"status-elements"
>
<section
class=
"legend-container"
>
% for i in xrange(0,len(legend_list)):
<
%
legend_title=
legend_list[i]['name']
%
>
<
%
legend_image=
legend_list[i]['image']
%
>
<div
class=
"legenditem"
>
${legend_title}=
<img
src=
"${legend_image}"
title=
${legend_title}
>
</div>
% endfor
</section>
<section
id=
"combined-open-ended-status"
class=
"combined-open-ended-status"
>
<div
class=
"statusitem"
>
Status
</div>
%for i in xrange(0,len(status_list)):
<
%
status=
status_list[i]%
>
%if i==len(status_list)-1:
...
...
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