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
ab5834fb
Commit
ab5834fb
authored
May 31, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pylint cleanup.
parent
e6dfa8e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
17 deletions
+16
-17
common/lib/xmodule/xmodule/capa_module.py
+2
-2
common/lib/xmodule/xmodule/word_cloud_module.py
+2
-2
common/lib/xmodule/xmodule/x_module.py
+12
-13
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
ab5834fb
...
...
@@ -69,7 +69,7 @@ class CapaFields(object):
max_attempts
=
StringyInteger
(
display_name
=
"Maximum Attempts"
,
help
=
"Defines the number of times a student can try to answer this problem. If the value is not set, infinite attempts are allowed."
,
values
=
{
"min"
:
1
},
scope
=
Scope
.
settings
values
=
{
"min"
:
1
},
scope
=
Scope
.
settings
)
due
=
Date
(
help
=
"Date that this problem is due by"
,
scope
=
Scope
.
settings
)
graceperiod
=
Timedelta
(
help
=
"Amount of time after the due date that submissions will be accepted"
,
scope
=
Scope
.
settings
)
...
...
@@ -103,7 +103,7 @@ class CapaFields(object):
weight
=
StringyFloat
(
display_name
=
"Problem Weight"
,
help
=
"Defines the number of points each problem is worth. If the value is not set, each response field in the problem is worth one point."
,
values
=
{
"min"
:
0
,
"step"
:
.
1
},
values
=
{
"min"
:
0
,
"step"
:
.
1
},
scope
=
Scope
.
settings
)
markdown
=
String
(
help
=
"Markdown source of this module"
,
scope
=
Scope
.
settings
)
...
...
common/lib/xmodule/xmodule/word_cloud_module.py
View file @
ab5834fb
...
...
@@ -37,14 +37,14 @@ class WordCloudFields(object):
help
=
"Number of text boxes available for students to input words/sentences."
,
scope
=
Scope
.
settings
,
default
=
5
,
values
=
{
"min"
:
1
}
values
=
{
"min"
:
1
}
)
num_top_words
=
StringyInteger
(
display_name
=
"Maximum Words"
,
help
=
"Maximum number of words to be displayed in generated word cloud."
,
scope
=
Scope
.
settings
,
default
=
250
,
values
=
{
"min"
:
1
}
values
=
{
"min"
:
1
}
)
display_student_percents
=
StringyBoolean
(
display_name
=
"Show Percents"
,
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
ab5834fb
...
...
@@ -76,7 +76,7 @@ class HTMLSnippet(object):
"""
raise
NotImplementedError
(
"get_html() must be provided by specific modules - not present in {0}"
.
format
(
self
.
__class__
))
.
format
(
self
.
__class__
))
class
XModuleFields
(
object
):
...
...
@@ -358,7 +358,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
metadata_translations
=
{
'slug'
:
'url_name'
,
'name'
:
'display_name'
,
}
}
# ============================= STRUCTURAL MANIPULATION ===================
def
__init__
(
self
,
...
...
@@ -460,7 +460,6 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
"""
return
False
# ================================= JSON PARSING ===========================
@staticmethod
def
load_from_json
(
json_data
,
system
,
default_class
=
None
):
...
...
@@ -525,10 +524,10 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
# ================================= XML PARSING ============================
@staticmethod
def
load_from_xml
(
xml_data
,
system
,
org
=
None
,
course
=
None
,
default_class
=
None
):
system
,
org
=
None
,
course
=
None
,
default_class
=
None
):
"""
This method instantiates the correct subclass of XModuleDescriptor based
on the contents of xml_data.
...
...
@@ -543,7 +542,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
class_
=
XModuleDescriptor
.
load_class
(
etree
.
fromstring
(
xml_data
)
.
tag
,
default_class
)
)
# leave next line, commented out - useful for low-level debugging
# log.debug('[XModuleDescriptor.load_from_xml] tag=%s, class_=%s' % (
# etree.fromstring(xml_data).tag,class_))
...
...
@@ -665,11 +664,11 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
type
=
"Integer"
elif
isinstance
(
field
,
Float
):
type
=
"Float"
metadata_fields
[
field
.
name
]
=
{
'field_name'
:
field
.
name
,
'type'
:
type
,
'display_name'
:
field
.
display_name
,
metadata_fields
[
field
.
name
]
=
{
'field_name'
:
field
.
name
,
'type'
:
type
,
'display_name'
:
field
.
display_name
,
'value'
:
field
.
to_json
(
value
),
'options'
:
values
,
'options'
:
values
,
'default_value'
:
field
.
to_json
(
default_value
),
'inheritable'
:
inheritable
,
'explicitly_set'
:
explicitly_set
,
...
...
@@ -768,7 +767,7 @@ class ModuleSystem(object):
s3_interface
=
None
,
cache
=
None
,
can_execute_unsafe_code
=
None
,
):
):
'''
Create a closure around the system environment.
...
...
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