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
01e8fe8d
Commit
01e8fe8d
authored
Feb 11, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass S3 interface in module_render
parent
120c0e13
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
common/lib/xmodule/xmodule/x_module.py
+2
-4
lms/djangoapps/courseware/module_render.py
+22
-0
No files found.
common/lib/xmodule/xmodule/x_module.py
View file @
01e8fe8d
...
...
@@ -870,8 +870,7 @@ class ModuleSystem(object):
node_path
=
""
,
anonymous_student_id
=
''
,
course_id
=
None
,
peer_grading_interface
=
None
,
staff_grading_interface
=
None
,
open_ended_grading_interface
=
None
,
s3_interface
=
None
):
'''
Create a closure around the system environment.
...
...
@@ -923,8 +922,7 @@ class ModuleSystem(object):
self
.
anonymous_student_id
=
anonymous_student_id
self
.
course_id
=
course_id
self
.
user_is_staff
=
user
is
not
None
and
user
.
is_staff
self
.
peer_grading_interface
=
peer_grading_interface
self
.
staff_grading_interface
=
staff_grading_interface
self
.
open_ended_grading_interface
=
open_ended_grading_interface
self
.
s3_interface
=
s3_interface
def
get
(
self
,
attr
):
...
...
lms/djangoapps/courseware/module_render.py
View file @
01e8fe8d
...
...
@@ -226,6 +226,26 @@ def _get_module(user, request, descriptor, student_module_cache, course_id,
'waittime'
:
settings
.
XQUEUE_WAITTIME_BETWEEN_REQUESTS
}
def
get_or_default
(
key
,
default
):
getattr
(
settings
,
key
,
default
)
#This is a hacky way to pass settings to the combined open ended xmodule
#It needs an S3 interface to upload images to S3
#It needs the open ended grading interface in order to get peer grading to be done
#TODO: refactor these settings into module-specific settings when possible.
#this first checks to see if the descriptor is the correct one, and only sends settings if it is
is_descriptor_combined_open_ended
=
descriptor
.
__class__
.
__name__
==
'CombinedOpenEndedDescriptor'
open_ended_grading_interface
=
None
s3_interface
=
None
if
is_descriptor_combined_open_ended
:
open_ended_grading_interface
=
settings
.
OPEN_ENDED_GRADING_INTERFACE
s3_interface
=
{
'access_key'
:
get_or_default
(
'AWS_ACCESS_KEY_ID'
,
''
),
'secret_access_key'
:
get_or_default
(
'AWS_SECRET_ACCESS_KEY'
,
''
),
'storage_bucket_name'
:
get_or_default
(
'AWS_STORAGE_BUCKET_NAME'
,
''
)
}
def
inner_get_module
(
descriptor
):
"""
Delegate to get_module. It does an access check, so may return None
...
...
@@ -255,6 +275,8 @@ def _get_module(user, request, descriptor, student_module_cache, course_id,
node_path
=
settings
.
NODE_PATH
,
anonymous_student_id
=
unique_id_for_user
(
user
),
course_id
=
course_id
,
open_ended_grading_interface
=
open_ended_grading_interface
,
s3_interface
=
s3_interface
,
)
# pass position specified in URL to module through ModuleSystem
system
.
set
(
'position'
,
position
)
...
...
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