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
b5843654
Commit
b5843654
authored
Aug 31, 2012
by
Arjun Singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add note about positional modules; check for videosequence.
parent
32cb0897
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
common/lib/xmodule/xmodule/modulestore/search.py
+9
-1
No files found.
common/lib/xmodule/xmodule/modulestore/search.py
View file @
b5843654
...
@@ -92,10 +92,18 @@ def path_to_location(modulestore, course_id, location):
...
@@ -92,10 +92,18 @@ def path_to_location(modulestore, course_id, location):
section
=
path
[
2
]
.
name
if
n
>
2
else
None
section
=
path
[
2
]
.
name
if
n
>
2
else
None
# Figure out the position
# Figure out the position
position
=
None
position
=
None
# This block of code will find the position of a module within a nested tree
# of modules. If a problem is on tab 2 of a sequence that's on tab 3 of a
# sequence, the resulting position is 3_2. However, no positional modules
# (e.g. sequential and videosequence) currently deal with this form of
# representing nested positions. This needs to happen before jumping to a
# module nested in more than one positional module will work.
if
n
>
3
:
if
n
>
3
:
position_list
=
[]
position_list
=
[]
for
path_index
in
range
(
2
,
n
-
1
):
for
path_index
in
range
(
2
,
n
-
1
):
if
path
[
path_index
]
.
category
==
'sequential'
:
category
=
path
[
path_index
]
.
category
if
category
==
'sequential'
or
category
==
'videosequence'
:
section_desc
=
modulestore
.
get_instance
(
course_id
,
path
[
path_index
])
section_desc
=
modulestore
.
get_instance
(
course_id
,
path
[
path_index
])
child_locs
=
[
c
.
location
for
c
in
section_desc
.
get_children
()]
child_locs
=
[
c
.
location
for
c
in
section_desc
.
get_children
()]
# positions are 1-indexed, and should be strings to be consistent with
# positions are 1-indexed, and should be strings to be consistent with
...
...
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