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
14372a40
Commit
14372a40
authored
Feb 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address some issues with robustness, make images work properly throughout flow
parent
68eb8025
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
+7
-1
common/lib/xmodule/xmodule/open_ended_module.py
+1
-1
lms/templates/combined_open_ended_status.html
+3
-2
lms/templates/open_ended_rubric.html
+4
-2
No files found.
common/lib/xmodule/xmodule/combined_open_ended_modulev1.py
View file @
14372a40
...
@@ -8,6 +8,7 @@ from lxml.html import rewrite_links
...
@@ -8,6 +8,7 @@ from lxml.html import rewrite_links
from
path
import
path
from
path
import
path
import
os
import
os
import
sys
import
sys
import
re
from
pkg_resources
import
resource_string
from
pkg_resources
import
resource_string
...
@@ -462,6 +463,10 @@ class CombinedOpenEndedV1Module():
...
@@ -462,6 +463,10 @@ class CombinedOpenEndedV1Module():
human_state
=
task
.
HUMAN_NAMES
[
state
]
human_state
=
task
.
HUMAN_NAMES
[
state
]
else
:
else
:
human_state
=
state
human_state
=
state
if
len
(
grader_types
)
>
0
:
grader_type
=
grader_types
[
0
]
else
:
grader_type
=
"IN"
last_response_dict
=
{
last_response_dict
=
{
'response'
:
last_response
,
'response'
:
last_response
,
'score'
:
last_score
,
'score'
:
last_score
,
...
@@ -477,7 +482,7 @@ class CombinedOpenEndedV1Module():
...
@@ -477,7 +482,7 @@ class CombinedOpenEndedV1Module():
'rubric_scores'
:
rubric_scores
,
'rubric_scores'
:
rubric_scores
,
'grader_types'
:
grader_types
,
'grader_types'
:
grader_types
,
'feedback_items'
:
feedback_items
,
'feedback_items'
:
feedback_items
,
'grader_type'
:
grader_type
s
[
0
]
,
'grader_type'
:
grader_type
,
}
}
return
last_response_dict
return
last_response_dict
...
@@ -648,6 +653,7 @@ class CombinedOpenEndedV1Module():
...
@@ -648,6 +653,7 @@ class CombinedOpenEndedV1Module():
task_data
=
self
.
get_last_response
(
i
)
task_data
=
self
.
get_last_response
(
i
)
task_data
.
update
({
'task_number'
:
i
+
1
})
task_data
.
update
({
'task_number'
:
i
+
1
})
status
.
append
(
task_data
)
status
.
append
(
task_data
)
context
=
{
'status_list'
:
status
,
'grader_type_image_dict'
:
GRADER_TYPE_IMAGE_DICT
}
context
=
{
'status_list'
:
status
,
'grader_type_image_dict'
:
GRADER_TYPE_IMAGE_DICT
}
status_html
=
self
.
system
.
render_template
(
"combined_open_ended_status.html"
,
context
)
status_html
=
self
.
system
.
render_template
(
"combined_open_ended_status.html"
,
context
)
...
...
common/lib/xmodule/xmodule/open_ended_module.py
View file @
14372a40
...
@@ -429,7 +429,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
...
@@ -429,7 +429,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
correct: Correctness of submission (Boolean)
correct: Correctness of submission (Boolean)
score: Points to be assigned (numeric, can be float)
score: Points to be assigned (numeric, can be float)
"""
"""
fail
=
{
'valid'
:
False
,
'score'
:
0
,
'feedback'
:
''
,
'rubric_scores'
:
[
],
'grader_types'
:
[],
'feedback_items'
:
[
]}
fail
=
{
'valid'
:
False
,
'score'
:
0
,
'feedback'
:
''
,
'rubric_scores'
:
[
[
0
,
0
]],
'grader_types'
:
[
''
],
'feedback_items'
:
[
''
]}
try
:
try
:
score_result
=
json
.
loads
(
score_msg
)
score_result
=
json
.
loads
(
score_msg
)
except
(
TypeError
,
ValueError
):
except
(
TypeError
,
ValueError
):
...
...
lms/templates/combined_open_ended_status.html
View file @
14372a40
...
@@ -7,8 +7,9 @@
...
@@ -7,8 +7,9 @@
%else:
%else:
<div
class=
"statusitem"
data-status-number=
"${i}"
>
<div
class=
"statusitem"
data-status-number=
"${i}"
>
%endif
%endif
%if status['grader_type'] in grader_type_image_dict:
<
%
grader_image =
grader_type_image_dict[status['grader_type']]%
>
<
%
grader_image =
grader_type_image_dict[status['grader_type']]%
>
%endif
${status['human_task']}(${status['human_state']}) ${status['score']} / ${status['max_score']}
${status['human_task']}(${status['human_state']}) ${status['score']} / ${status['max_score']}
</div>
</div>
%endfor
%endfor
...
...
lms/templates/open_ended_rubric.html
View file @
14372a40
...
@@ -28,8 +28,10 @@
...
@@ -28,8 +28,10 @@
% elif combined_rubric == True:
% elif combined_rubric == True:
<div
class=
"rubric-label"
>
<div
class=
"rubric-label"
>
%for grader_type in category['options'][j]['grader_types']:
%for grader_type in category['options'][j]['grader_types']:
<
%
grader_image =
grader_type_image_dict[grader_type]%
>
% if grader_type in grader_type_image_dict:
<img
src=
"${grader_image}"
/>
<
%
grader_image =
grader_type_image_dict[grader_type]%
>
<img
src=
"${grader_image}"
/>
% endif
%endfor
%endfor
${option['points']} points : ${option['text']}
${option['points']} points : ${option['text']}
</div>
</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