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
a7a55e46
Commit
a7a55e46
authored
Feb 09, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a combined results view
parent
4421e09d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
10 deletions
+43
-10
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
+15
-3
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
+12
-6
lms/templates/open_ended_result_table.html
+15
-0
lms/templates/open_ended_view_only_rubric.html
+1
-1
No files found.
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
View file @
a7a55e46
...
@@ -586,10 +586,22 @@ class CombinedOpenEndedV1Module():
...
@@ -586,10 +586,22 @@ class CombinedOpenEndedV1Module():
loop_up_to_task
=
self
.
current_task_number
+
1
loop_up_to_task
=
self
.
current_task_number
+
1
for
i
in
xrange
(
0
,
loop_up_to_task
):
for
i
in
xrange
(
0
,
loop_up_to_task
):
all_responses
.
append
(
self
.
get_last_response
(
i
))
all_responses
.
append
(
self
.
get_last_response
(
i
))
context_list
=
[]
for
ri
in
all_responses
:
for
i
in
xrange
(
0
,
len
(
ri
[
'rubric_scores'
])):
feedback
=
ri
[
'feedback_dicts'
][
i
]
.
get
(
'feedback'
,
''
)
context
=
{
context
=
{
'results'
:
response_dict
[
'post_assessment'
],
'rubric_html'
:
self
.
rubric_renderer
.
render_rubric
(
stringify_children
(
self
.
static_data
[
'rubric'
]),
ri
[
'rubric_scores'
][
i
]),
'task_number'
:
task_number
+
1
,
'grader_type'
:
ri
[
'grader_type'
],
'task_name'
:
response_dict
[
'human_task'
],
'grader_type_image_dict'
:
GRADER_TYPE_IMAGE_DICT
,
'human_grader_types'
:
HUMAN_GRADER_TYPE
,
'feedback'
:
feedback
,
}
context_list
.
append
(
context
)
feedback_table
=
self
.
system
.
render_template
(
'open_ended_result_table.html'
,
context_list
)
context
=
{
'results'
:
feedback_table
,
'task_name'
:
"Combined Results"
,
'class_name'
:
"result-container"
,
'class_name'
:
"result-container"
,
}
}
html
=
self
.
system
.
render_template
(
'combined_open_ended_results.html'
,
context
)
html
=
self
.
system
.
render_template
(
'combined_open_ended_results.html'
,
context
)
...
...
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
View file @
a7a55e46
...
@@ -37,7 +37,7 @@ class CombinedOpenEndedRubric(object):
...
@@ -37,7 +37,7 @@ class CombinedOpenEndedRubric(object):
self
.
view_only
=
view_only
self
.
view_only
=
view_only
self
.
system
=
system
self
.
system
=
system
def
render_rubric
(
self
,
rubric_xml
):
def
render_rubric
(
self
,
rubric_xml
,
score_list
=
None
):
'''
'''
render_rubric: takes in an xml string and outputs the corresponding
render_rubric: takes in an xml string and outputs the corresponding
html for that xml, given the type of rubric we're generating
html for that xml, given the type of rubric we're generating
...
@@ -48,8 +48,14 @@ class CombinedOpenEndedRubric(object):
...
@@ -48,8 +48,14 @@ class CombinedOpenEndedRubric(object):
html: the html that corresponds to the xml given
html: the html that corresponds to the xml given
'''
'''
success
=
False
success
=
False
#
try:
try
:
rubric_categories
=
self
.
extract_categories
(
rubric_xml
)
rubric_categories
=
self
.
extract_categories
(
rubric_xml
)
if
score_list
:
for
i
in
xrange
(
0
,
len
(
rubric_categories
)):
category
=
rubric_categories
[
i
]
for
j
in
xrange
(
0
,
len
(
category
[
'options'
])):
if
score_list
[
i
]
==
j
:
rubric_categories
[
i
][
'options'
][
j
][
'selected'
]
=
True
rubric_scores
=
[
cat
[
'score'
]
for
cat
in
rubric_categories
]
rubric_scores
=
[
cat
[
'score'
]
for
cat
in
rubric_categories
]
max_scores
=
map
((
lambda
cat
:
cat
[
'options'
][
-
1
][
'points'
]),
rubric_categories
)
max_scores
=
map
((
lambda
cat
:
cat
[
'options'
][
-
1
][
'points'
]),
rubric_categories
)
max_score
=
max
(
max_scores
)
max_score
=
max
(
max_scores
)
...
@@ -64,10 +70,10 @@ class CombinedOpenEndedRubric(object):
...
@@ -64,10 +70,10 @@ class CombinedOpenEndedRubric(object):
'combined_rubric'
:
False
'combined_rubric'
:
False
})
})
success
=
True
success
=
True
#
except:
except
:
#
error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml)
error_message
=
"[render_rubric] Could not parse the rubric with xml: {0}"
.
format
(
rubric_xml
)
#
log.error(error_message)
log
.
error
(
error_message
)
#
raise RubricParsingError(error_message)
raise
RubricParsingError
(
error_message
)
return
{
'success'
:
success
,
'html'
:
html
,
'rubric_scores'
:
rubric_scores
}
return
{
'success'
:
success
,
'html'
:
html
,
'rubric_scores'
:
rubric_scores
}
def
check_if_rubric_is_parseable
(
self
,
rubric_string
,
location
,
max_score_allowed
,
max_score
):
def
check_if_rubric_is_parseable
(
self
,
rubric_string
,
location
,
max_score_allowed
,
max_score
):
...
...
lms/templates/open_ended_result_table.html
0 → 100644
View file @
a7a55e46
% for context in context_list:
% if context['grader_type'] in grader_type_image_dict:
<
%
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
${rubric_html}
${feedback}
%endif
%endfor
\ No newline at end of file
lms/templates/open_ended_view_only_rubric.html
View file @
a7a55e46
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
% for j in range(len(category['options'])):
% for j in range(len(category['options'])):
<
%
option =
category['options'][j]
%
>
<
%
option =
category['options'][j]
%
>
% if option['selected']:
% if option['selected']:
${category['description']} : ${option['points']} points
${category['description']} : ${option['points']} points
,
% endif
% endif
% endfor
% endfor
% endfor
% endfor
...
...
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