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
b85b50d1
Commit
b85b50d1
authored
Jul 31, 2015
by
utkjad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing @contract
parent
b06e46c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
40 deletions
+0
-40
lms/djangoapps/courseware/user_state_client.py
+0
-40
No files found.
lms/djangoapps/courseware/user_state_client.py
View file @
b85b50d1
...
@@ -53,12 +53,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -53,12 +53,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
"""
"""
self
.
user
=
user
self
.
user
=
user
@contract
(
username
=
"basestring"
,
block_key
=
UsageKey
,
scope
=
ScopeBase
,
fields
=
"seq(basestring)|set(basestring)|None"
)
def
get
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
,
fields
=
None
):
def
get
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
,
fields
=
None
):
"""
"""
Retrieve the stored XBlock state for a single xblock usage.
Retrieve the stored XBlock state for a single xblock usage.
...
@@ -82,7 +76,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -82,7 +76,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
return
state
return
state
@contract
(
username
=
"basestring"
,
block_key
=
UsageKey
,
state
=
"dict(basestring: *)"
,
scope
=
ScopeBase
)
def
set
(
self
,
username
,
block_key
,
state
,
scope
=
Scope
.
user_state
):
def
set
(
self
,
username
,
block_key
,
state
,
scope
=
Scope
.
user_state
):
"""
"""
Set fields for a particular XBlock.
Set fields for a particular XBlock.
...
@@ -95,12 +88,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -95,12 +88,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
"""
"""
self
.
set_many
(
username
,
{
block_key
:
state
},
scope
)
self
.
set_many
(
username
,
{
block_key
:
state
},
scope
)
@contract
(
username
=
"basestring"
,
block_key
=
UsageKey
,
scope
=
ScopeBase
,
fields
=
"seq(basestring)|set(basestring)|None"
)
def
delete
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
,
fields
=
None
):
def
delete
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
,
fields
=
None
):
"""
"""
Delete the stored XBlock state for a single xblock usage.
Delete the stored XBlock state for a single xblock usage.
...
@@ -113,12 +100,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -113,12 +100,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
"""
"""
return
self
.
delete_many
(
username
,
[
block_key
],
scope
,
fields
=
fields
)
return
self
.
delete_many
(
username
,
[
block_key
],
scope
,
fields
=
fields
)
@contract
(
username
=
"basestring"
,
block_key
=
UsageKey
,
scope
=
ScopeBase
,
fields
=
"seq(basestring)|set(basestring)|None"
)
def
get_mod_date
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
,
fields
=
None
):
def
get_mod_date
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
,
fields
=
None
):
"""
"""
Get the last modification date for fields from the specified blocks.
Get the last modification date for fields from the specified blocks.
...
@@ -139,7 +120,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -139,7 +120,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
field
:
date
for
(
_
,
field
,
date
)
in
results
field
:
date
for
(
_
,
field
,
date
)
in
results
}
}
@contract
(
username
=
"basestring"
,
block_keys
=
"seq(UsageKey)|set(UsageKey)"
)
def
_get_student_modules
(
self
,
username
,
block_keys
):
def
_get_student_modules
(
self
,
username
,
block_keys
):
"""
"""
Retrieve the :class:`~StudentModule`s for the supplied ``username`` and ``block_keys``.
Retrieve the :class:`~StudentModule`s for the supplied ``username`` and ``block_keys``.
...
@@ -166,12 +146,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -166,12 +146,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
usage_key
=
student_module
.
module_state_key
.
map_into_course
(
student_module
.
course_id
)
usage_key
=
student_module
.
module_state_key
.
map_into_course
(
student_module
.
course_id
)
yield
(
student_module
,
usage_key
)
yield
(
student_module
,
usage_key
)
@contract
(
username
=
"basestring"
,
block_keys
=
"seq(UsageKey)|set(UsageKey)"
,
scope
=
ScopeBase
,
fields
=
"seq(basestring)|set(basestring)|None"
)
def
get_many
(
self
,
username
,
block_keys
,
scope
=
Scope
.
user_state
,
fields
=
None
):
def
get_many
(
self
,
username
,
block_keys
,
scope
=
Scope
.
user_state
,
fields
=
None
):
"""
"""
Retrieve the stored XBlock state for a single xblock usage.
Retrieve the stored XBlock state for a single xblock usage.
...
@@ -197,7 +171,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -197,7 +171,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
state
=
json
.
loads
(
module
.
state
)
state
=
json
.
loads
(
module
.
state
)
yield
(
usage_key
,
state
)
yield
(
usage_key
,
state
)
@contract
(
username
=
"basestring"
,
block_keys_to_state
=
"dict(UsageKey: dict(basestring: *))"
,
scope
=
ScopeBase
)
def
set_many
(
self
,
username
,
block_keys_to_state
,
scope
=
Scope
.
user_state
):
def
set_many
(
self
,
username
,
block_keys_to_state
,
scope
=
Scope
.
user_state
):
"""
"""
Set fields for a particular XBlock.
Set fields for a particular XBlock.
...
@@ -243,12 +216,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -243,12 +216,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
# We just read this object, so we know that we can do an update
# We just read this object, so we know that we can do an update
student_module
.
save
(
force_update
=
True
)
student_module
.
save
(
force_update
=
True
)
@contract
(
username
=
"basestring"
,
block_keys
=
"seq(UsageKey)|set(UsageKey)"
,
scope
=
ScopeBase
,
fields
=
"seq(basestring)|set(basestring)|None"
)
def
delete_many
(
self
,
username
,
block_keys
,
scope
=
Scope
.
user_state
,
fields
=
None
):
def
delete_many
(
self
,
username
,
block_keys
,
scope
=
Scope
.
user_state
,
fields
=
None
):
"""
"""
Delete the stored XBlock state for a many xblock usages.
Delete the stored XBlock state for a many xblock usages.
...
@@ -276,12 +243,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -276,12 +243,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
# We just read this object, so we know that we can do an update
# We just read this object, so we know that we can do an update
student_module
.
save
(
force_update
=
True
)
student_module
.
save
(
force_update
=
True
)
@contract
(
username
=
"basestring"
,
block_keys
=
"seq(UsageKey)|set(UsageKey)"
,
scope
=
ScopeBase
,
fields
=
"seq(basestring)|set(basestring)|None"
)
def
get_mod_date_many
(
self
,
username
,
block_keys
,
scope
=
Scope
.
user_state
,
fields
=
None
):
def
get_mod_date_many
(
self
,
username
,
block_keys
,
scope
=
Scope
.
user_state
,
fields
=
None
):
"""
"""
Get the last modification date for fields from the specified blocks.
Get the last modification date for fields from the specified blocks.
...
@@ -308,7 +269,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
...
@@ -308,7 +269,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
for
field
in
json
.
loads
(
student_module
.
state
):
for
field
in
json
.
loads
(
student_module
.
state
):
yield
(
usage_key
,
field
,
student_module
.
modified
)
yield
(
usage_key
,
field
,
student_module
.
modified
)
@contract
(
username
=
"basestring"
,
block_key
=
UsageKey
,
scope
=
ScopeBase
)
def
get_history
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
):
def
get_history
(
self
,
username
,
block_key
,
scope
=
Scope
.
user_state
):
"""
"""
Retrieve history of state changes for a given block for a given
Retrieve history of state changes for a given block for a given
...
...
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