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
d9b685d5
Commit
d9b685d5
authored
Mar 19, 2015
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed beta tester functionality for ora problems.
TNL-1736
parent
badbc3e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
lms/djangoapps/courseware/module_render.py
+3
-0
lms/djangoapps/courseware/tests/test_module_render.py
+20
-0
No files found.
lms/djangoapps/courseware/module_render.py
View file @
d9b685d5
...
...
@@ -41,6 +41,7 @@ from edxmako.shortcuts import render_to_string
from
eventtracking
import
tracker
from
psychometrics.psychoanalyze
import
make_psychometrics_data_update_handler
from
student.models
import
anonymous_id_for_user
,
user_by_anonymous_id
from
student.roles
import
CourseBetaTesterRole
from
xblock.core
import
XBlock
from
xblock.fields
import
Scope
from
xblock.runtime
import
KvsFieldData
,
KeyValueStore
...
...
@@ -642,6 +643,8 @@ def get_module_system_for_user(user, field_data_cache,
system
.
set
(
u'user_is_staff'
,
user_is_staff
)
system
.
set
(
u'user_is_admin'
,
has_access
(
user
,
u'staff'
,
'global'
))
system
.
set
(
u'user_is_beta_tester'
,
CourseBetaTesterRole
(
course_id
)
.
has_user
(
user
))
system
.
set
(
u'days_early_for_beta'
,
getattr
(
descriptor
,
'days_early_for_beta'
))
# make an ErrorDescriptor -- assuming that the descriptor's system is ok
if
has_access
(
user
,
u'staff'
,
descriptor
.
location
,
course_id
):
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
d9b685d5
...
...
@@ -997,6 +997,7 @@ class TestAnonymousStudentId(ModuleStoreTestCase, LoginEnrollmentTestCase):
_field_data_cache
=
{},
_dirty_fields
=
{},
fields
=
{},
days_early_for_beta
=
None
,
)
descriptor
.
runtime
=
CombinedSystem
(
descriptor
.
_runtime
,
None
)
# pylint: disable=protected-access
# Use the xblock_class's bind_for_student method
...
...
@@ -1308,6 +1309,25 @@ class LMSXBlockServiceBindingTest(ModuleStoreTestCase):
service
=
runtime
.
service
(
descriptor
,
expected_service
)
self
.
assertIsNotNone
(
service
)
def
test_beta_tester_fields_added
(
self
):
"""
Tests that the beta tester fields are set on LMS runtime.
"""
descriptor
=
ItemFactory
(
category
=
"pure"
,
parent
=
self
.
course
)
descriptor
.
days_early_for_beta
=
5
runtime
,
_
=
render
.
get_module_system_for_user
(
self
.
user
,
self
.
field_data_cache
,
descriptor
,
self
.
course
.
id
,
self
.
track_function
,
self
.
xqueue_callback_url_prefix
,
self
.
request_token
)
self
.
assertFalse
(
getattr
(
runtime
,
u'user_is_beta_tester'
))
self
.
assertEqual
(
getattr
(
runtime
,
u'days_early_for_beta'
),
5
)
class
PureXBlockWithChildren
(
PureXBlock
):
"""
...
...
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