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
e7ea2664
Commit
e7ea2664
authored
Jun 18, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #43 from MITx/pmitros/same-values
Courseware can have same random seed in multiple problems for exam.
parents
5bce758b
6c681429
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
common/lib/xmodule/capa_module.py
+2
-0
lms/djangoapps/courseware/module_render.py
+5
-1
No files found.
common/lib/xmodule/capa_module.py
View file @
e7ea2664
...
...
@@ -222,6 +222,8 @@ class Module(XModule):
self
.
weight
=
only_one
(
dom2
.
xpath
(
'/problem/@weight'
))
if
self
.
rerandomize
==
'never'
:
seed
=
1
elif
self
.
rerandomize
==
"per_student"
and
hasattr
(
system
,
'id'
):
seed
=
system
.
id
else
:
seed
=
None
try
:
...
...
lms/djangoapps/courseware/module_render.py
View file @
e7ea2664
...
...
@@ -31,7 +31,7 @@ class I4xSystem(object):
functionality.
'''
def
__init__
(
self
,
ajax_url
,
track_function
,
render_function
,
render_template
,
filestore
=
None
):
render_template
,
request
=
None
,
filestore
=
None
):
'''
Create a closure around the system environment.
...
...
@@ -46,6 +46,7 @@ class I4xSystem(object):
and 'type'.
render_template - a function that takes (template_file, context), and returns
rendered html.
request - the request in progress
filestore - A filestore ojbect. Defaults to an instance of OSFS based at
settings.DATA_DIR.
'''
...
...
@@ -62,6 +63,7 @@ class I4xSystem(object):
self
.
render_template
=
render_template
self
.
exception404
=
Http404
self
.
DEBUG
=
settings
.
DEBUG
self
.
id
=
request
.
user
.
id
if
request
is
not
None
else
0
def
get
(
self
,
attr
):
''' provide uniform access to attributes (like etree).'''
...
...
@@ -169,6 +171,7 @@ def get_module(user, request, module_xml, student_module_cache, position=None):
render_function
=
render_function
,
render_template
=
render_to_string
,
ajax_url
=
ajax_url
,
request
=
request
,
filestore
=
OSFS
(
data_root
),
)
# pass position specified in URL to module through I4xSystem
...
...
@@ -300,6 +303,7 @@ def modx_dispatch(request, module=None, dispatch=None, id=None):
render_function
=
None
,
render_template
=
render_to_string
,
ajax_url
=
ajax_url
,
request
=
request
,
filestore
=
OSFS
(
data_root
),
)
...
...
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