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
252e54fe
Commit
252e54fe
authored
Jan 23, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in is_scored boolean, remove some noisy debug statements
parent
d07bf015
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
common/lib/xmodule/xmodule/combined_open_ended_module.py
+37
-1
common/lib/xmodule/xmodule/open_ended_module.py
+0
-2
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
252e54fe
...
...
@@ -38,6 +38,8 @@ MAX_SCORE = 1
#The highest score allowed for the overall xmodule and for each rubric point
MAX_SCORE_ALLOWED
=
3
IS_SCORED
=
False
class
CombinedOpenEndedModule
(
XModule
):
"""
This is a module that encapsulates all open ended grading (self assessment, peer assessment, etc).
...
...
@@ -138,6 +140,9 @@ class CombinedOpenEndedModule(XModule):
#Allow reset is true if student has failed the criteria to move to the next child task
self
.
allow_reset
=
instance_state
.
get
(
'ready_to_reset'
,
False
)
self
.
max_attempts
=
int
(
self
.
metadata
.
get
(
'attempts'
,
MAX_ATTEMPTS
))
self
.
is_scored
=
(
self
.
metadata
.
get
(
'is_graded'
,
IS_SCORED
)
==
"True"
)
log
.
debug
(
self
.
metadata
.
get
(
'is_graded'
,
IS_SCORED
))
# Used for progress / grading. Currently get credit just for
# completion (doesn't matter if you self-assessed correct/incorrect).
...
...
@@ -281,7 +286,6 @@ class CombinedOpenEndedModule(XModule):
self
.
current_task_parsed_xml
,
self
.
current_task_descriptor
,
self
.
static_data
,
instance_state
=
current_task_state
)
log
.
debug
(
current_task_state
)
return
True
def
check_allow_reset
(
self
):
...
...
@@ -563,6 +567,38 @@ class CombinedOpenEndedModule(XModule):
return
status_html
def
get_score
(
self
):
"""
Score the student received on the problem, or None if there is no
score.
Returns:
dictionary
{'score': integer, from 0 to get_max_score(),
'total': get_max_score()}
"""
max_score
=
None
if
(
self
.
state
==
self
.
DONE
or
self
.
allow_reset
)
and
self
.
is_scored
:
last_response
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
max_score
=
last_response
[
'max_score'
]
score
=
last_response
[
'score'
]
return
{
'score'
:
score
,
'total'
:
max_score
,
}
def
max_score
(
self
):
''' Maximum score. Two notes:
* This is generic; in abstract, a problem could be 3/5 points on one
randomization, and 5/7 on another
'''
max_score
=
None
if
(
self
.
state
==
self
.
DONE
or
self
.
allow_reset
)
and
self
.
is_scored
:
last_response
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
max_score
=
last_response
[
'max_score'
]
return
max_score
class
CombinedOpenEndedDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
...
...
common/lib/xmodule/xmodule/open_ended_module.py
View file @
252e54fe
...
...
@@ -378,7 +378,6 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
Return error message or feedback template
"""
log
.
debug
(
response_items
)
rubric_feedback
=
""
feedback
=
self
.
_convert_longform_feedback_to_html
(
response_items
)
if
response_items
[
'rubric_scores_complete'
]
==
True
:
...
...
@@ -603,7 +602,6 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
'child_type'
:
'openended'
,
'correct'
:
correct
,
}
log
.
debug
(
context
)
html
=
system
.
render_template
(
'open_ended.html'
,
context
)
return
html
...
...
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