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
89d00036
Commit
89d00036
authored
Jun 12, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be strict about ModelType expected types, rename Object as Dict.
parent
86d952bf
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
26 deletions
+26
-26
common/lib/xmodule/xmodule/abtest_module.py
+4
-4
common/lib/xmodule/xmodule/capa_module.py
+4
-4
common/lib/xmodule/xmodule/course_module.py
+6
-6
common/lib/xmodule/xmodule/peer_grading_module.py
+2
-2
common/lib/xmodule/xmodule/poll_module.py
+2
-2
common/lib/xmodule/xmodule/tests/test_xml_module.py
+2
-2
common/lib/xmodule/xmodule/word_cloud_module.py
+3
-3
common/lib/xmodule/xmodule/xml_module.py
+2
-2
requirements/edx/github.txt
+1
-1
No files found.
common/lib/xmodule/xmodule/abtest_module.py
View file @
89d00036
...
...
@@ -6,7 +6,7 @@ from xmodule.x_module import XModule
from
xmodule.raw_module
import
RawDescriptor
from
xmodule.xml_module
import
XmlDescriptor
from
xmodule.exceptions
import
InvalidDefinitionError
from
xblock.core
import
String
,
Scope
,
Obje
ct
from
xblock.core
import
String
,
Scope
,
Di
ct
DEFAULT
=
"_DEFAULT_GROUP"
...
...
@@ -32,9 +32,9 @@ def group_from_value(groups, v):
class
ABTestFields
(
object
):
group_portions
=
Obje
ct
(
help
=
"What proportions of students should go in each group"
,
default
=
{
DEFAULT
:
1
},
scope
=
Scope
.
content
)
group_assignments
=
Obje
ct
(
help
=
"What group this user belongs to"
,
scope
=
Scope
.
preferences
,
default
=
{})
group_content
=
Obje
ct
(
help
=
"What content to display to each group"
,
scope
=
Scope
.
content
,
default
=
{
DEFAULT
:
[]})
group_portions
=
Di
ct
(
help
=
"What proportions of students should go in each group"
,
default
=
{
DEFAULT
:
1
},
scope
=
Scope
.
content
)
group_assignments
=
Di
ct
(
help
=
"What group this user belongs to"
,
scope
=
Scope
.
preferences
,
default
=
{})
group_content
=
Di
ct
(
help
=
"What content to display to each group"
,
scope
=
Scope
.
content
,
default
=
{
DEFAULT
:
[]})
experiment
=
String
(
help
=
"Experiment that this A/B test belongs to"
,
scope
=
Scope
.
content
)
has_children
=
True
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
89d00036
...
...
@@ -18,7 +18,7 @@ from .progress import Progress
from
xmodule.x_module
import
XModule
from
xmodule.raw_module
import
RawDescriptor
from
xmodule.exceptions
import
NotFoundError
,
ProcessingError
from
xblock.core
import
Scope
,
String
,
Boolean
,
Obje
ct
,
Integer
,
Float
from
xblock.core
import
Scope
,
String
,
Boolean
,
Di
ct
,
Integer
,
Float
from
.fields
import
Timedelta
,
Date
from
xmodule.util.date_utils
import
time_to_datetime
...
...
@@ -95,9 +95,9 @@ class CapaFields(object):
{
"display_name"
:
"Per Student"
,
"value"
:
"per_student"
}]
)
data
=
String
(
help
=
"XML data for the problem"
,
scope
=
Scope
.
content
)
correct_map
=
Obje
ct
(
help
=
"Dictionary with the correctness of current student answers"
,
scope
=
Scope
.
user_state
,
default
=
{})
input_state
=
Obje
ct
(
help
=
"Dictionary for maintaining the state of inputtypes"
,
scope
=
Scope
.
user_state
)
student_answers
=
Obje
ct
(
help
=
"Dictionary with the current student responses"
,
scope
=
Scope
.
user_state
)
correct_map
=
Di
ct
(
help
=
"Dictionary with the correctness of current student answers"
,
scope
=
Scope
.
user_state
,
default
=
{})
input_state
=
Di
ct
(
help
=
"Dictionary for maintaining the state of inputtypes"
,
scope
=
Scope
.
user_state
)
student_answers
=
Di
ct
(
help
=
"Dictionary with the current student responses"
,
scope
=
Scope
.
user_state
)
done
=
Boolean
(
help
=
"Whether the student has answered the problem"
,
scope
=
Scope
.
user_state
)
seed
=
Integer
(
help
=
"Random seed for this student"
,
scope
=
Scope
.
user_state
)
weight
=
Float
(
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
89d00036
...
...
@@ -17,7 +17,7 @@ from xmodule.graders import grader_from_conf
from
xmodule.util.date_utils
import
time_to_datetime
import
json
from
xblock.core
import
Scope
,
List
,
String
,
Obje
ct
,
Boolean
from
xblock.core
import
Scope
,
List
,
String
,
Di
ct
,
Boolean
from
.fields
import
Date
...
...
@@ -154,25 +154,25 @@ class CourseFields(object):
start
=
Date
(
help
=
"Start time when this module is visible"
,
scope
=
Scope
.
settings
)
end
=
Date
(
help
=
"Date that this class ends"
,
scope
=
Scope
.
settings
)
advertised_start
=
String
(
help
=
"Date that this course is advertised to start"
,
scope
=
Scope
.
settings
)
grading_policy
=
Obje
ct
(
help
=
"Grading policy definition for this class"
,
scope
=
Scope
.
content
)
grading_policy
=
Di
ct
(
help
=
"Grading policy definition for this class"
,
scope
=
Scope
.
content
)
show_calculator
=
Boolean
(
help
=
"Whether to show the calculator in this course"
,
default
=
False
,
scope
=
Scope
.
settings
)
display_name
=
String
(
help
=
"Display name for this module"
,
scope
=
Scope
.
settings
)
tabs
=
List
(
help
=
"List of tabs to enable in this course"
,
scope
=
Scope
.
settings
)
end_of_course_survey_url
=
String
(
help
=
"Url for the end-of-course survey"
,
scope
=
Scope
.
settings
)
discussion_blackouts
=
List
(
help
=
"List of pairs of start/end dates for discussion blackouts"
,
scope
=
Scope
.
settings
)
discussion_topics
=
Obje
ct
(
discussion_topics
=
Di
ct
(
help
=
"Map of topics names to ids"
,
scope
=
Scope
.
settings
)
testcenter_info
=
Obje
ct
(
help
=
"Dictionary of Test Center info"
,
scope
=
Scope
.
settings
)
testcenter_info
=
Di
ct
(
help
=
"Dictionary of Test Center info"
,
scope
=
Scope
.
settings
)
announcement
=
Date
(
help
=
"Date this course is announced"
,
scope
=
Scope
.
settings
)
cohort_config
=
Obje
ct
(
help
=
"Dictionary defining cohort configuration"
,
scope
=
Scope
.
settings
)
cohort_config
=
Di
ct
(
help
=
"Dictionary defining cohort configuration"
,
scope
=
Scope
.
settings
)
is_new
=
Boolean
(
help
=
"Whether this course should be flagged as new"
,
scope
=
Scope
.
settings
)
no_grade
=
Boolean
(
help
=
"True if this course isn't graded"
,
default
=
False
,
scope
=
Scope
.
settings
)
disable_progress_graph
=
Boolean
(
help
=
"True if this course shouldn't display the progress graph"
,
default
=
False
,
scope
=
Scope
.
settings
)
pdf_textbooks
=
List
(
help
=
"List of dictionaries containing pdf_textbook configuration"
,
scope
=
Scope
.
settings
)
html_textbooks
=
List
(
help
=
"List of dictionaries containing html_textbook configuration"
,
scope
=
Scope
.
settings
)
remote_gradebook
=
Obje
ct
(
scope
=
Scope
.
settings
)
remote_gradebook
=
Di
ct
(
scope
=
Scope
.
settings
)
allow_anonymous
=
Boolean
(
scope
=
Scope
.
settings
,
default
=
True
)
allow_anonymous_to_peers
=
Boolean
(
scope
=
Scope
.
settings
,
default
=
False
)
advanced_modules
=
List
(
help
=
"Beta modules used in your course"
,
scope
=
Scope
.
settings
)
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
89d00036
...
...
@@ -10,7 +10,7 @@ from .x_module import XModule
from
xmodule.raw_module
import
RawDescriptor
from
xmodule.modulestore.django
import
modulestore
from
.timeinfo
import
TimeInfo
from
xblock.core
import
Obje
ct
,
String
,
Scope
,
Boolean
,
Integer
,
Float
from
xblock.core
import
Di
ct
,
String
,
Scope
,
Boolean
,
Integer
,
Float
from
xmodule.fields
import
Date
from
xmodule.open_ended_grading_classes.peer_grading_service
import
PeerGradingService
,
GradingServiceError
,
MockPeerGradingService
...
...
@@ -49,7 +49,7 @@ class PeerGradingFields(object):
help
=
"The maximum grade that a student can receive for this problem."
,
default
=
MAX_SCORE
,
scope
=
Scope
.
settings
,
values
=
{
"min"
:
0
}
)
student_data_for_location
=
Obje
ct
(
student_data_for_location
=
Di
ct
(
help
=
"Student data for a given peer grading problem."
,
scope
=
Scope
.
user_state
)
...
...
common/lib/xmodule/xmodule/poll_module.py
View file @
89d00036
...
...
@@ -19,7 +19,7 @@ from xmodule.x_module import XModule
from
xmodule.stringify
import
stringify_children
from
xmodule.mako_module
import
MakoModuleDescriptor
from
xmodule.xml_module
import
XmlDescriptor
from
xblock.core
import
Scope
,
String
,
Obje
ct
,
Boolean
,
List
from
xblock.core
import
Scope
,
String
,
Di
ct
,
Boolean
,
List
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -30,7 +30,7 @@ class PollFields(object):
voted
=
Boolean
(
help
=
"Whether this student has voted on the poll"
,
scope
=
Scope
.
user_state
,
default
=
False
)
poll_answer
=
String
(
help
=
"Student answer"
,
scope
=
Scope
.
user_state
,
default
=
''
)
poll_answers
=
Obje
ct
(
help
=
"All possible answers for the poll fro other students"
,
scope
=
Scope
.
content
)
poll_answers
=
Di
ct
(
help
=
"All possible answers for the poll fro other students"
,
scope
=
Scope
.
content
)
answers
=
List
(
help
=
"Poll answers from xml"
,
scope
=
Scope
.
content
,
default
=
[])
question
=
String
(
help
=
"Poll question"
,
scope
=
Scope
.
content
,
default
=
''
)
...
...
common/lib/xmodule/xmodule/tests/test_xml_module.py
View file @
89d00036
...
...
@@ -2,7 +2,7 @@
#pylint: disable=C0111
from
xmodule.x_module
import
XModuleFields
from
xblock.core
import
Scope
,
String
,
Obje
ct
,
Boolean
,
Integer
,
Float
,
Any
,
List
from
xblock.core
import
Scope
,
String
,
Di
ct
,
Boolean
,
Integer
,
Float
,
Any
,
List
from
xmodule.fields
import
Date
,
Timedelta
from
xmodule.xml_module
import
XmlDescriptor
,
serialize_field
,
deserialize_field
import
unittest
...
...
@@ -22,7 +22,7 @@ class TestFields(object):
# Will not be returned by editable_metadata_fields because filtered out by non_editable_metadata_fields.
due
=
Date
(
scope
=
Scope
.
settings
)
# Will not be returned by editable_metadata_fields because is not Scope.settings.
student_answers
=
Obje
ct
(
scope
=
Scope
.
user_state
)
student_answers
=
Di
ct
(
scope
=
Scope
.
user_state
)
# Will be returned, and can override the inherited value from XModule.
display_name
=
String
(
scope
=
Scope
.
settings
,
default
=
'local default'
,
display_name
=
'Local Display Name'
,
help
=
'local help'
)
...
...
common/lib/xmodule/xmodule/word_cloud_module.py
View file @
89d00036
...
...
@@ -14,7 +14,7 @@ from xmodule.raw_module import RawDescriptor
from
xmodule.editing_module
import
MetadataOnlyEditingDescriptor
from
xmodule.x_module
import
XModule
from
xblock.core
import
Scope
,
Obje
ct
,
Boolean
,
List
,
Integer
from
xblock.core
import
Scope
,
Di
ct
,
Boolean
,
List
,
Integer
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -63,11 +63,11 @@ class WordCloudFields(object):
scope
=
Scope
.
user_state
,
default
=
[]
)
all_words
=
Obje
ct
(
all_words
=
Di
ct
(
help
=
"All possible words from all students."
,
scope
=
Scope
.
content
)
top_words
=
Obje
ct
(
top_words
=
Di
ct
(
help
=
"Top num_top_words words for word cloud."
,
scope
=
Scope
.
content
)
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
89d00036
...
...
@@ -6,7 +6,7 @@ import sys
from
collections
import
namedtuple
from
lxml
import
etree
from
xblock.core
import
Obje
ct
,
Scope
from
xblock.core
import
Di
ct
,
Scope
from
xmodule.x_module
import
(
XModuleDescriptor
,
policy_key
)
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.inheritance
import
own_metadata
...
...
@@ -120,7 +120,7 @@ class XmlDescriptor(XModuleDescriptor):
Mixin class for standardized parsing of from xml
"""
xml_attributes
=
Obje
ct
(
help
=
"Map of unhandled xml attributes, used only for storage between import and export"
,
xml_attributes
=
Di
ct
(
help
=
"Map of unhandled xml attributes, used only for storage between import and export"
,
default
=
{},
scope
=
Scope
.
settings
)
# Extension to append to filename paths
...
...
requirements/edx/github.txt
View file @
89d00036
...
...
@@ -9,6 +9,6 @@
# Our libraries:
-e git+https://github.com/edx/XBlock.git@
2abd2937e134e2f78dfa118d6cfd56ec510fd3a4
#egg=XBlock
-e git+https://github.com/edx/XBlock.git@
3464c0fbfe07bb16791386b26979f66ee2708b06
#egg=XBlock
-e git+https://github.com/edx/codejail.git@5fb5fa0#egg=codejail
-e git+https://github.com/edx/diff-cover.git@v0.1.0#egg=diff_cover
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