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
c34a0aac
Commit
c34a0aac
authored
Dec 20, 2017
by
Bessie Steinberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve readability
parent
5c4bc98b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
19 deletions
+23
-19
common/djangoapps/util/milestones_helpers.py
+4
-1
common/test/acceptance/pages/lms/course_home.py
+10
-1
openedx/features/course_experience/templates/course_experience/course-outline-fragment.html
+8
-10
openedx/features/course_experience/views/course_outline.py
+1
-7
No files found.
common/djangoapps/util/milestones_helpers.py
View file @
c34a0aac
...
...
@@ -344,11 +344,14 @@ def add_course_content_milestone(course_id, content_id, relationship, milestone)
return
milestones_api
.
add_course_content_milestone
(
course_id
,
content_id
,
relationship
,
milestone
)
def
get_course_content_milestones
(
course_id
,
content_id
,
relationship
,
user_id
=
None
):
def
get_course_content_milestones
(
course_id
,
content_id
=
None
,
relationship
=
'requires'
,
user_id
=
None
):
"""
Client API operation adapter/wrapper
Uses the request cache to store all of a user's
milestones
Returns all content blocks in a course if content_id is None, otherwise it just returns that
specific content block.
"""
if
not
settings
.
FEATURES
.
get
(
'MILESTONES_APP'
):
return
[]
...
...
common/test/acceptance/pages/lms/course_home.py
View file @
c34a0aac
...
...
@@ -173,7 +173,10 @@ class CourseOutlinePage(PageObject):
raise
ValueError
(
"Could not find section '{0}'"
.
format
(
section_title
))
try
:
log
.
info
(
">>> self._subsection_titles(section_index + 1): '{0}'"
.
format
(
self
.
_subsection_titles
(
section_index
+
1
)))
log
.
info
(
">>> subsection_title: '{0}'"
.
format
(
subsection_title
))
subsection_index
=
self
.
_subsection_titles
(
section_index
+
1
)
.
index
(
subsection_title
)
log
.
info
(
">>> subsection_index: '{0}'"
.
format
(
subsection_index
))
except
ValueError
:
raise
ValueError
(
"Could not find subsection '{0}' in section '{1}'"
.
format
(
subsection_title
,
section_title
...
...
@@ -241,10 +244,16 @@ class CourseOutlinePage(PageObject):
Return a list of all subsection titles on the page
for the section at index `section_index` (starts at 1).
"""
log
.
info
(
">>> calling _subsection_titles..."
)
log
.
info
(
">>> section_index: '{0}'"
.
format
(
section_index
))
subsection_css
=
self
.
SUBSECTION_TITLES_SELECTOR
.
format
(
section_index
)
return
self
.
q
(
css
=
subsection_css
)
.
map
(
log
.
info
(
">>> subsection_css: '{0}'"
.
format
(
subsection_css
))
return_val
=
self
.
q
(
css
=
subsection_css
)
.
map
(
lambda
el
:
el
.
get_attribute
(
'innerHTML'
)
.
strip
()
)
.
results
log
.
info
(
">>> return_val: '{0}'"
.
format
(
return_val
))
return
return_val
def
_wait_for_course_section
(
self
,
section_title
,
subsection_title
):
"""
...
...
openedx/features/course_experience/templates/course_experience/course-outline-fragment.html
View file @
c34a0aac
...
...
@@ -41,23 +41,21 @@ from openedx.core.djangolib.markup import HTML, Text
<span
class=
"menu-icon icon fa fa-unlock"
aria-hidden=
"true"
>
</span>
<span
class=
"subsection-title-name"
>
${ subsection['display_name'] }
</span>
<span
class=
"sr"
>
${_("Unlocked")}
</span>
% else:
<span
class=
"menu-icon icon fa fa-lock"
aria-hidden=
"true"
>
</span>
% endif
% endif
<span
class=
"subsection-title-name"
>
${ subsection['display_name'] }
</span>
% if subsection['id'] in milestones:
% if milestones[subsection['id']]['completed_prereqs']:
<span
class=
"sr"
>
${_("Unlocked")}
</span>
% else:
<span
class=
"subsection-title-name"
>
${ subsection['display_name'] }
</span>
<span
class=
"details"
>
${ _("(Prerequisite required)") }
</span>
% endif
% endif
% endif
<div
class=
"details"
>
...
...
openedx/features/course_experience/views/course_outline.py
View file @
c34a0aac
...
...
@@ -48,19 +48,13 @@ class CourseOutlineFragmentView(EdxFragmentView):
"""
course_content_milestones
=
{}
all_course_prereqs
=
get_course_content_milestones
(
course_id
=
course_key
,
content_id
=
None
,
relationship
=
'requires'
,
user_id
=
None
)
all_course_prereqs
=
get_course_content_milestones
(
course_id
=
course_key
)
for
milestone
in
all_course_prereqs
:
course_content_milestones
[
milestone
[
'content_id'
]]
=
{
'completed_prereqs'
:
True
}
unfulfilled_prereqs
=
get_course_content_milestones
(
course_id
=
course_key
,
content_id
=
None
,
relationship
=
'requires'
,
user_id
=
request
.
user
.
id
)
for
milestone
in
unfulfilled_prereqs
:
...
...
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