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
932d13ed
Commit
932d13ed
authored
Dec 03, 2013
by
Александр
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make has_score to be XField insted of decriptor property.
parent
2088a215
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
common/lib/xmodule/xmodule/lti_module.py
+2
-2
common/lib/xmodule/xmodule/tests/test_lti_unit.py
+5
-2
No files found.
common/lib/xmodule/xmodule/lti_module.py
View file @
932d13ed
...
...
@@ -94,6 +94,7 @@ class LTIFields(object):
scope
=
Scope
.
settings
,
values
=
{
"min"
:
0
},
)
has_score
=
Boolean
(
help
=
"Does this LTI module have score?"
,
default
=
False
,
scope
=
Scope
.
settings
)
class
LTIModule
(
LTIFields
,
XModule
):
...
...
@@ -380,7 +381,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
return
params
def
max_score
(
self
):
return
self
.
weight
if
self
.
graded
else
0
return
self
.
weight
if
self
.
has_score
else
None
@XBlock.handler
...
...
@@ -586,6 +587,5 @@ class LTIDescriptor(LTIFields, MetadataOnlyEditingDescriptor, EmptyDataRawDescri
"""
Descriptor for LTI Xmodule.
"""
has_score
=
True
module_class
=
LTIModule
grade_handler
=
module_attr
(
'grade_handler'
)
common/lib/xmodule/xmodule/tests/test_lti_unit.py
View file @
932d13ed
...
...
@@ -253,9 +253,12 @@ class LTIModuleTest(LogicTest):
self
.
xmodule
.
weight
=
100.0
self
.
xmodule
.
graded
=
True
self
.
assertEqual
(
self
.
xmodule
.
max_score
(),
100
)
self
.
assertEqual
(
self
.
xmodule
.
max_score
(),
None
)
self
.
xmodule
.
has_score
=
True
self
.
assertEqual
(
self
.
xmodule
.
max_score
(),
100.0
)
self
.
xmodule
.
graded
=
False
self
.
assertEqual
(
self
.
xmodule
.
max_score
(),
0
)
self
.
assertEqual
(
self
.
xmodule
.
max_score
(),
100.
0
)
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