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
a49f740e
Commit
a49f740e
authored
Feb 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubric and make images display with tooltips
parent
14372a40
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
5 deletions
+46
-5
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
+18
-1
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
+8
-0
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+9
-1
lms/templates/combined_open_ended_status.html
+4
-1
lms/templates/open_ended_rubric.html
+7
-2
No files found.
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
View file @
a49f740e
...
...
@@ -22,7 +22,7 @@ from .xml_module import XmlDescriptor
from
xmodule.modulestore
import
Location
import
self_assessment_module
import
open_ended_module
from
combined_open_ended_rubric
import
CombinedOpenEndedRubric
,
RubricParsingError
,
GRADER_TYPE_IMAGE_DICT
from
combined_open_ended_rubric
import
CombinedOpenEndedRubric
,
RubricParsingError
,
GRADER_TYPE_IMAGE_DICT
,
HUMAN_GRADER_TYPE
from
.stringify
import
stringify_children
import
dateutil
import
dateutil.parser
...
...
@@ -467,6 +467,12 @@ class CombinedOpenEndedV1Module():
grader_type
=
grader_types
[
0
]
else
:
grader_type
=
"IN"
if
grader_type
in
HUMAN_GRADER_TYPE
:
human_grader_name
=
HUMAN_GRADER_TYPE
[
grader_type
]
else
:
human_grader_name
=
grader_type
last_response_dict
=
{
'response'
:
last_response
,
'score'
:
last_score
,
...
...
@@ -483,6 +489,7 @@ class CombinedOpenEndedV1Module():
'grader_types'
:
grader_types
,
'feedback_items'
:
feedback_items
,
'grader_type'
:
grader_type
,
'human_grader_type'
:
human_grader_name
,
}
return
last_response_dict
...
...
@@ -563,6 +570,15 @@ class CombinedOpenEndedV1Module():
html
=
self
.
system
.
render_template
(
'combined_open_ended_results.html'
,
context
)
return
{
'html'
:
html
,
'success'
:
True
}
def
get_status_ajax
(
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.
"""
html
=
self
.
get_status
()
return
{
'html'
:
html
,
'success'
:
True
}
def
handle_ajax
(
self
,
dispatch
,
get
):
"""
This is called by courseware.module_render, to handle an AJAX call.
...
...
@@ -579,6 +595,7 @@ class CombinedOpenEndedV1Module():
'reset'
:
self
.
reset
,
'get_results'
:
self
.
get_results
,
'get_combined_rubric'
:
self
.
get_rubric
,
'get_status'
:
self
.
get_status_ajax
,
}
if
dispatch
not
in
handlers
:
...
...
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
View file @
a49f740e
...
...
@@ -10,6 +10,13 @@ GRADER_TYPE_IMAGE_DICT = {
'IN'
:
'/static/images/peer_grading_icon.png'
,
}
HUMAN_GRADER_TYPE
=
{
'SA'
:
'Self-Assessment'
,
'PE'
:
'Peer-Assessment'
,
'IN'
:
'Instructor-Assessment'
,
'ML'
:
'AI-Assessment'
,
}
class
RubricParsingError
(
Exception
):
def
__init__
(
self
,
msg
):
self
.
msg
=
msg
...
...
@@ -184,6 +191,7 @@ class CombinedOpenEndedRubric(object):
'max_score'
:
max_score
,
'combined_rubric'
:
True
,
'grader_type_image_dict'
:
GRADER_TYPE_IMAGE_DICT
,
'human_grader_types'
:
HUMAN_GRADER_TYPE
,
})
return
html
...
...
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
a49f740e
...
...
@@ -51,6 +51,7 @@ class @CombinedOpenEnded
@
reset_button
.
click
@
reset
@
next_problem_button
=
@
$
(
'.next-step-button'
)
@
next_problem_button
.
click
@
next_problem
@
status_container
=
@
$
(
'.status-elements'
)
@
show_results_button
=
@
$
(
'.show-results-button'
)
@
show_results_button
.
click
@
show_results
...
...
@@ -130,6 +131,13 @@ class @CombinedOpenEnded
@
combined_rubric_container
.
after
(
response
.
html
).
remove
()
@
combined_rubric_container
=
$
(
'div.combined_rubric_container'
)
show_status_current
:
()
=>
data
=
{}
$
.
postWithPrefix
"
#{
@
ajax_url
}
/get_status"
,
data
,
(
response
)
=>
if
response
.
success
@
status_container
.
after
(
response
.
html
).
remove
()
@
status_container
=
$
(
'.status-elements'
)
message_post
:
(
event
)
=>
Logger
.
log
'message_post'
,
@
answers
external_grader_message
=
$
(
event
.
target
).
parent
().
parent
().
parent
()
...
...
@@ -171,7 +179,7 @@ class @CombinedOpenEnded
@
next_problem_button
.
hide
()
@
hide_file_upload
()
@
hint_area
.
attr
(
'disabled'
,
false
)
@
show_status_current
()
if
@
task_number
>
1
@
show_combined_rubric_current
()
if
@
task_number
==
1
and
@
child_state
==
'assessing'
...
...
lms/templates/combined_open_ended_status.html
View file @
a49f740e
...
...
@@ -9,8 +9,11 @@
%endif
%if status['grader_type'] in grader_type_image_dict:
<
%
grader_image =
grader_type_image_dict[status['grader_type']]%
>
<img
src=
"${grader_image}"
title=
${status['human_grader_type']}
>
%else:
${status['human_task']}
%endif
${status['human_task']}
(${status['human_state']}) ${status['score']} / ${status['max_score']}
(${status['human_state']}) ${status['score']} / ${status['max_score']}
</div>
%endfor
</section>
...
...
lms/templates/open_ended_rubric.html
View file @
a49f740e
...
...
@@ -29,8 +29,13 @@
<div
class=
"rubric-label"
>
%for grader_type in category['options'][j]['grader_types']:
% if grader_type in grader_type_image_dict:
<
%
grader_image =
grader_type_image_dict[grader_type]%
>
<img
src=
"${grader_image}"
/>
<
%
grader_image =
grader_type_image_dict[grader_type]
%
>
% if grader_type in human_grader_types:
<
%
human_title =
human_grader_types[grader_type]
%
>
% else:
<
%
human_title =
grader_type
%
>
% endif
<img
src=
"${grader_image}"
title=
"${human_title}"
/>
% endif
%endfor
${option['points']} points : ${option['text']}
...
...
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