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
4b59e7d5
Commit
4b59e7d5
authored
Feb 04, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix max score check for the updated rubric UI stuff.
parent
f49b5ec7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
common/lib/xmodule/xmodule/combined_open_ended_module.py
+2
-8
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
+9
-1
common/lib/xmodule/xmodule/css/combinedopenended/display.scss
+1
-6
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
4b59e7d5
...
...
@@ -165,15 +165,10 @@ class CombinedOpenEndedModule(XModule):
# completion (doesn't matter if you self-assessed correct/incorrect).
self
.
_max_score
=
int
(
self
.
metadata
.
get
(
'max_score'
,
MAX_SCORE
))
if
self
.
_max_score
>
MAX_SCORE_ALLOWED
:
error_message
=
"Max score {0} is higher than max score allowed {1} for location {2}"
.
format
(
self
.
_max_score
,
MAX_SCORE_ALLOWED
,
location
)
log
.
error
(
error_message
)
raise
IncorrectMaxScoreError
(
error_message
)
rubric_renderer
=
CombinedOpenEndedRubric
(
system
,
True
)
rubric_string
=
stringify_children
(
definition
[
'rubric'
])
rubric_renderer
.
check_if_rubric_is_parseable
(
rubric_string
,
location
,
MAX_SCORE_ALLOWED
)
rubric_renderer
.
check_if_rubric_is_parseable
(
rubric_string
,
location
,
MAX_SCORE_ALLOWED
,
self
.
_max_score
)
#Static data is passed to the child modules to render
self
.
static_data
=
{
...
...
@@ -700,4 +695,4 @@ class CombinedOpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
for
child
in
[
'task'
]:
add_child
(
child
)
return
elt
\ No newline at end of file
return
elt
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
View file @
4b59e7d5
...
...
@@ -39,7 +39,7 @@ class CombinedOpenEndedRubric(object):
raise
RubricParsingError
(
"[render_rubric] Could not parse the rubric with xml: {0}"
.
format
(
rubric_xml
))
return
success
,
html
def
check_if_rubric_is_parseable
(
self
,
rubric_string
,
location
,
max_score_allowed
):
def
check_if_rubric_is_parseable
(
self
,
rubric_string
,
location
,
max_score_allowed
,
max_score
):
success
,
rubric_feedback
=
self
.
render_rubric
(
rubric_string
)
if
not
success
:
error_message
=
"Could not parse rubric : {0} for location {1}"
.
format
(
rubric_string
,
location
.
url
())
...
...
@@ -47,13 +47,21 @@ class CombinedOpenEndedRubric(object):
raise
RubricParsingError
(
error_message
)
rubric_categories
=
self
.
extract_categories
(
rubric_string
)
total
=
0
for
category
in
rubric_categories
:
total
=
total
+
len
(
category
[
'options'
])
-
1
if
len
(
category
[
'options'
])
>
(
max_score_allowed
+
1
):
error_message
=
"Number of score points in rubric {0} higher than the max allowed, which is {1}"
.
format
(
len
(
category
[
'options'
]),
max_score_allowed
)
log
.
error
(
error_message
)
raise
RubricParsingError
(
error_message
)
if
total
!=
max_score
:
error_msg
=
"The max score {0} for problem {1} does not match the total number of points in the rubric {2}"
.
format
(
max_score
,
location
,
total
)
log
.
error
(
error_msg
)
raise
RubricParsingError
(
error_msg
)
def
extract_categories
(
self
,
element
):
'''
Contstruct a list of categories such that the structure looks like:
...
...
common/lib/xmodule/xmodule/css/combinedopenended/display.scss
View file @
4b59e7d5
...
...
@@ -405,8 +405,8 @@ section.open-ended-child {
padding
:
9px
;
background
:
#F6F6F6
;
border
:
1px
solid
#ddd
;
border-top
:
0
;
margin-bottom
:
20px
;
min-height
:
5em
;
@include
clearfix
;
}
...
...
@@ -544,11 +544,6 @@ section.open-ended-child {
}
.submission_feedback
{
// background: #F3F3F3;
// border: 1px solid #ddd;
// @include border-radius(3px);
// padding: 8px 12px;
// margin-top: 10px;
@include
inline-block
;
font-style
:
italic
;
margin
:
8px
0
0
10px
;
...
...
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