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
8516d631
Commit
8516d631
authored
May 14, 2012
by
Piotr Mitros
Committed by
Matthew Mongeau
Jun 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Courseware can have same random seed in multiple problems for exam. Slight hack.
parent
6003fee9
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 @
8516d631
...
...
@@ -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 @
8516d631
...
...
@@ -34,7 +34,7 @@ class I4xSystem(object):
and user, or other environment-specific info.
'''
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.
...
...
@@ -49,6 +49,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.
'''
...
...
@@ -65,6 +66,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_x_module_wrapper
,
render_template
=
render_to_string
,
ajax_url
=
ajax_url
,
request
=
request
,
filestore
=
OSFS
(
data_root
),
)
# pass position specified in URL to module through I4xSystem
...
...
@@ -298,6 +301,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