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
29f738f7
Commit
29f738f7
authored
Jan 22, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor count fix
parent
52912715
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
common/lib/xmodule/xmodule/combined_open_ended_module.py
+16
-0
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
29f738f7
...
...
@@ -35,6 +35,9 @@ MAX_ATTEMPTS = 10000
# Overriden by max_score specified in xml.
MAX_SCORE
=
1
#The highest score allowed for the overall xmodule and for each rubric point
MAX_SCORE_ALLOWED
=
3
class
CombinedOpenEndedModule
(
XModule
):
"""
This is a module that encapsulates all open ended grading (self assessment, peer assessment, etc).
...
...
@@ -140,12 +143,25 @@ 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}"
.
format
(
self
.
_max_score
,
MAX_SCORE_ALLOWED
)
log
.
exception
(
error_message
)
raise
Exception
rubric_renderer
=
CombinedOpenEndedRubric
(
system
,
True
)
success
,
rubric_feedback
=
rubric_renderer
.
render_rubric
(
stringify_children
(
definition
[
'rubric'
]))
if
not
success
:
error_message
=
"Could not parse rubric : {0}"
.
format
(
definition
[
'rubric'
])
log
.
exception
(
error_message
)
raise
Exception
rubric_categories
=
rubric_renderer
.
extract_categories
(
stringify_children
(
definition
[
'rubric'
]))
for
category
in
rubric_categories
:
if
len
(
category
[
'options'
])
>
MAX_SCORE_ALLOWED
:
error_message
=
"Number of score points in rubric higher than the max allowed, which is {0} : {1}"
.
format
(
MAX_SCORE_ALLOWED
,
definition
[
'rubric'
])
log
.
exception
(
error_message
)
raise
Exception
#Static data is passed to the child modules to render
self
.
static_data
=
{
'max_score'
:
self
.
_max_score
,
...
...
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