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
4c3fb2d0
Commit
4c3fb2d0
authored
Apr 24, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce user-state only for StudentModule backend Client
parent
c9dbd2c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
lms/djangoapps/courseware/user_state_client.py
+10
-0
No files found.
lms/djangoapps/courseware/user_state_client.py
View file @
4c3fb2d0
...
@@ -37,13 +37,19 @@ class DjangoXBlockUserStateClient(DjangoXBlockUserStateClient):
...
@@ -37,13 +37,19 @@ class DjangoXBlockUserStateClient(DjangoXBlockUserStateClient):
def
get_many
(
username
,
block_keys
,
scope
=
Scope
.
user_state
):
def
get_many
(
username
,
block_keys
,
scope
=
Scope
.
user_state
):
"""Returns dict of block_id -> state."""
"""Returns dict of block_id -> state."""
if
scope
!=
Scope
.
user_state
:
raise
ValueError
(
"Only Scope.user_state is supported"
)
raise
NotImplementedError
()
raise
NotImplementedError
()
def
set_many
(
username
,
block_keys_to_state
,
scope
=
Scope
.
user_state
):
def
set_many
(
username
,
block_keys_to_state
,
scope
=
Scope
.
user_state
):
if
scope
!=
Scope
.
user_state
:
raise
ValueError
(
"Only Scope.user_state is supported"
)
raise
NotImplementedError
()
raise
NotImplementedError
()
def
get_history
(
username
,
block_key
,
scope
=
Scope
.
user_state
):
def
get_history
(
username
,
block_key
,
scope
=
Scope
.
user_state
):
"""We don't guarantee that history for many blocks will be fast."""
"""We don't guarantee that history for many blocks will be fast."""
if
scope
!=
Scope
.
user_state
:
raise
ValueError
(
"Only Scope.user_state is supported"
)
raise
NotImplementedError
()
raise
NotImplementedError
()
def
iter_all_for_block
(
block_key
,
scope
=
Scope
.
user_state
,
batch_size
=
None
):
def
iter_all_for_block
(
block_key
,
scope
=
Scope
.
user_state
,
batch_size
=
None
):
...
@@ -52,6 +58,8 @@ class DjangoXBlockUserStateClient(DjangoXBlockUserStateClient):
...
@@ -52,6 +58,8 @@ class DjangoXBlockUserStateClient(DjangoXBlockUserStateClient):
increments. If you're using this method, you should be running in an
increments. If you're using this method, you should be running in an
async task.
async task.
"""
"""
if
scope
!=
Scope
.
user_state
:
raise
ValueError
(
"Only Scope.user_state is supported"
)
raise
NotImplementedError
()
raise
NotImplementedError
()
def
iter_all_for_course
(
course_key
,
block_type
=
None
,
scope
=
Scope
.
user_state
,
batch_size
=
None
):
def
iter_all_for_course
(
course_key
,
block_type
=
None
,
scope
=
Scope
.
user_state
,
batch_size
=
None
):
...
@@ -60,4 +68,6 @@ class DjangoXBlockUserStateClient(DjangoXBlockUserStateClient):
...
@@ -60,4 +68,6 @@ class DjangoXBlockUserStateClient(DjangoXBlockUserStateClient):
increments. If you're using this method, you should be running in an
increments. If you're using this method, you should be running in an
async task.
async task.
"""
"""
if
scope
!=
Scope
.
user_state
:
raise
ValueError
(
"Only Scope.user_state is supported"
)
raise
NotImplementedError
()
raise
NotImplementedError
()
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