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
24cdd7a4
Commit
24cdd7a4
authored
Aug 19, 2014
by
Don Mitchell
Committed by
Ben McMorran
Aug 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assume any non-xml modulestore is r/w
LMS-11235
parent
63603d70
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
common/djangoapps/xmodule_modifiers.py
+1
-1
lms/djangoapps/courseware/courses.py
+5
-4
lms/djangoapps/courseware/views.py
+5
-5
No files found.
common/djangoapps/xmodule_modifiers.py
View file @
24cdd7a4
...
...
@@ -185,7 +185,7 @@ def add_staff_markup(user, has_instructor_access, block, view, frag, context):
# TODO: make this more general, eg use an XModule attribute instead
if
isinstance
(
block
,
VerticalModule
)
and
(
not
context
or
not
context
.
get
(
'child_of_vertical'
,
False
)):
# check that the course is a mongo backed Studio course before doing work
is_mongo_course
=
modulestore
()
.
get_modulestore_type
(
block
.
location
.
course_key
)
==
ModuleStoreEnum
.
Type
.
mongo
is_mongo_course
=
modulestore
()
.
get_modulestore_type
(
block
.
location
.
course_key
)
!=
ModuleStoreEnum
.
Type
.
xml
is_studio_course
=
block
.
course_edit_method
==
"Studio"
if
is_studio_course
and
is_mongo_course
:
...
...
lms/djangoapps/courseware/courses.py
View file @
24cdd7a4
...
...
@@ -360,14 +360,15 @@ def get_cms_block_link(block, page):
return
u"//{}/{}/{}"
.
format
(
settings
.
CMS_BASE
,
page
,
block
.
location
)
def
get_studio_url
(
course
_key
,
page
):
def
get_studio_url
(
course
,
page
):
"""
Get the Studio URL of the page that is passed in.
Args:
course (CourseDescriptor)
"""
assert
(
isinstance
(
course_key
,
CourseKey
))
course
=
get_course_by_id
(
course_key
)
is_studio_course
=
course
.
course_edit_method
==
"Studio"
is_mongo_course
=
modulestore
()
.
get_modulestore_type
(
course
_key
)
==
ModuleStoreEnum
.
Type
.
mongo
is_mongo_course
=
modulestore
()
.
get_modulestore_type
(
course
.
id
)
!=
ModuleStoreEnum
.
Type
.
xml
studio_link
=
None
if
is_studio_course
and
is_mongo_course
:
studio_link
=
get_cms_course_link
(
course
,
page
)
...
...
lms/djangoapps/courseware/views.py
View file @
24cdd7a4
...
...
@@ -311,7 +311,7 @@ def index(request, course_id, chapter=None, section=None,
u' far, should have gotten a course module for this user'
)
return
redirect
(
reverse
(
'about_course'
,
args
=
[
course_key
.
to_deprecated_string
()]))
studio_url
=
get_studio_url
(
course
_key
,
'course'
)
studio_url
=
get_studio_url
(
course
,
'course'
)
context
=
{
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
...
...
@@ -419,7 +419,7 @@ def index(request, course_id, chapter=None, section=None,
context
[
'section_title'
]
=
section_descriptor
.
display_name_with_default
else
:
# section is none, so display a message
studio_url
=
get_studio_url
(
course
_key
,
'course'
)
studio_url
=
get_studio_url
(
course
,
'course'
)
prev_section
=
get_current_child
(
chapter_module
)
if
prev_section
is
None
:
# Something went wrong -- perhaps this chapter has no sections visible to the user
...
...
@@ -553,7 +553,7 @@ def course_info(request, course_id):
staff_access
=
has_access
(
request
.
user
,
'staff'
,
course
)
masq
=
setup_masquerade
(
request
,
staff_access
)
# allow staff to toggle masquerade on info page
reverifications
=
fetch_reverify_banner_info
(
request
,
course_key
)
studio_url
=
get_studio_url
(
course
_key
,
'course_info'
)
studio_url
=
get_studio_url
(
course
,
'course_info'
)
context
=
{
'request'
:
request
,
...
...
@@ -655,7 +655,7 @@ def course_about(request, course_id):
course
=
get_course_with_access
(
request
.
user
,
'see_exists'
,
course_key
)
registered
=
registered_for_course
(
course
,
request
.
user
)
staff_access
=
has_access
(
request
.
user
,
'staff'
,
course
)
studio_url
=
get_studio_url
(
course
_key
,
'settings/details'
)
studio_url
=
get_studio_url
(
course
,
'settings/details'
)
if
has_access
(
request
.
user
,
'load'
,
course
):
course_target
=
reverse
(
'info'
,
args
=
[
course
.
id
.
to_deprecated_string
()])
...
...
@@ -812,7 +812,7 @@ def _progress(request, course_key, student_id):
student
=
User
.
objects
.
prefetch_related
(
"groups"
)
.
get
(
id
=
student
.
id
)
courseware_summary
=
grades
.
progress_summary
(
student
,
request
,
course
)
studio_url
=
get_studio_url
(
course
_key
,
'settings/grading'
)
studio_url
=
get_studio_url
(
course
,
'settings/grading'
)
grade_summary
=
grades
.
grade
(
student
,
request
,
course
)
if
courseware_summary
is
None
:
...
...
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