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
427680a3
Commit
427680a3
authored
Nov 28, 2017
by
Bill Filler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reorder and cleanup
parent
2e0a6dc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
35 deletions
+34
-35
common/lib/xmodule/xmodule/seq_module.py
+34
-35
No files found.
common/lib/xmodule/xmodule/seq_module.py
View file @
427680a3
...
...
@@ -158,7 +158,6 @@ class ProctoringFields(object):
@XBlock.wants
(
'proctoring'
)
@XBlock.wants
(
'verification'
)
@XBlock.wants
(
'milestones'
)
@XBlock.wants
(
'gating'
)
@XBlock.wants
(
'credit'
)
@XBlock.needs
(
'user'
)
...
...
@@ -268,40 +267,6 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule):
return
banner_text
,
hidden_content_html
def
_get_gating_milestone
(
self
):
"""
Checks whether the content is gated for learners.
"""
gating_service
=
self
.
runtime
.
service
(
self
,
'gating'
)
if
gating_service
:
milestone
=
gating_service
.
get_gating_milestone
(
self
.
course_id
,
self
.
location
,
'requires'
)
return
milestone
return
False
def
_is_prereq_met
(
self
,
milestone
):
"""
Evaluate if the user has completed the prerequiste
"""
gating_service
=
self
.
runtime
.
service
(
self
,
'gating'
)
if
gating_service
:
# if it's complete then a user milestone record will exist
return
gating_service
.
is_prereq_met
(
self
.
runtime
.
user_id
,
milestone
)
return
False
def
_get_milestone_meta_info
(
self
,
milestone
):
"""
Return information to display about the gating milstone
"""
gating_service
=
self
.
runtime
.
service
(
self
,
'gating'
)
if
gating_service
:
return
gating_service
.
get_gating_milestone_meta_info
(
self
.
course_id
,
milestone
)
return
{}
def
_can_user_view_content
(
self
,
course
):
"""
Returns whether the runtime user can view the content
...
...
@@ -359,6 +324,40 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule):
return
fragment
def
_get_gating_milestone
(
self
):
"""
Checks whether the content is gated for learners.
"""
gating_service
=
self
.
runtime
.
service
(
self
,
'gating'
)
if
gating_service
:
milestone
=
gating_service
.
get_gating_milestone
(
self
.
course_id
,
self
.
location
,
'requires'
)
return
milestone
return
False
def
_is_prereq_met
(
self
,
milestone
):
"""
Evaluate if the user has completed the prerequiste
"""
gating_service
=
self
.
runtime
.
service
(
self
,
'gating'
)
if
gating_service
:
# if it's complete then a user milestone record will exist
return
gating_service
.
is_prereq_met
(
self
.
runtime
.
user_id
,
milestone
)
return
False
def
_get_milestone_meta_info
(
self
,
milestone
):
"""
Return information to display about the gating milstone
"""
gating_service
=
self
.
runtime
.
service
(
self
,
'gating'
)
if
gating_service
:
return
gating_service
.
get_gating_milestone_meta_info
(
self
.
course_id
,
milestone
)
return
{}
def
_update_position
(
self
,
context
,
number_of_display_items
):
"""
Update the user's sequential position given the context and the
...
...
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