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
069e29a2
Commit
069e29a2
authored
Aug 01, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4295 from mitocw/cg/psycho_require_auth
Check if user is anonymous before calling PSYCHOMETRICS
parents
d6c188f9
87fa6cc7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
lms/djangoapps/courseware/module_render.py
+1
-2
lms/djangoapps/courseware/tests/test_module_render.py
+11
-0
No files found.
lms/djangoapps/courseware/module_render.py
View file @
069e29a2
...
@@ -512,8 +512,7 @@ def get_module_system_for_user(user, field_data_cache,
...
@@ -512,8 +512,7 @@ def get_module_system_for_user(user, field_data_cache,
position
=
None
position
=
None
system
.
set
(
'position'
,
position
)
system
.
set
(
'position'
,
position
)
if
settings
.
FEATURES
.
get
(
'ENABLE_PSYCHOMETRICS'
)
and
user
.
is_authenticated
():
if
settings
.
FEATURES
.
get
(
'ENABLE_PSYCHOMETRICS'
):
system
.
set
(
system
.
set
(
'psychometrics_handler'
,
# set callback for updating PsychometricsData
'psychometrics_handler'
,
# set callback for updating PsychometricsData
make_psychometrics_data_update_handler
(
course_id
,
user
,
descriptor
.
location
)
make_psychometrics_data_update_handler
(
course_id
,
user
,
descriptor
.
location
)
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
069e29a2
...
@@ -998,3 +998,14 @@ class TestRebindModule(TestSubmittingProblems):
...
@@ -998,3 +998,14 @@ class TestRebindModule(TestSubmittingProblems):
self
.
assertEqual
(
module
.
system
.
anonymous_student_id
,
anonymous_id_for_user
(
user2
,
self
.
course
.
id
))
self
.
assertEqual
(
module
.
system
.
anonymous_student_id
,
anonymous_id_for_user
(
user2
,
self
.
course
.
id
))
self
.
assertEqual
(
module
.
scope_ids
.
user_id
,
user2
.
id
)
self
.
assertEqual
(
module
.
scope_ids
.
user_id
,
user2
.
id
)
self
.
assertEqual
(
module
.
descriptor
.
scope_ids
.
user_id
,
user2
.
id
)
self
.
assertEqual
(
module
.
descriptor
.
scope_ids
.
user_id
,
user2
.
id
)
@patch
(
'courseware.module_render.make_psychometrics_data_update_handler'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_PSYCHOMETRICS'
:
True
})
def
test_psychometrics_anonymous
(
self
,
psycho_handler
):
"""
Make sure that noauth modules with anonymous users don't have
the psychometrics callback bound.
"""
module
=
self
.
get_module_for_user
(
self
.
anon_user
)
module
.
system
.
rebind_noauth_module_to_user
(
module
,
self
.
anon_user
)
self
.
assertFalse
(
psycho_handler
.
called
)
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