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
d4ff8c15
Commit
d4ff8c15
authored
Oct 18, 2017
by
sanfordstudent
Committed by
GitHub
Oct 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16254 from edx/sstudent/EDUCATOR-1511
add logging for EDUCATOR-1511
parents
ba4c6ca2
5c90b786
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
openedx/core/djangoapps/verified_track_content/partition_scheme.py
+16
-0
No files found.
openedx/core/djangoapps/verified_track_content/partition_scheme.py
View file @
d4ff8c15
"""
UserPartitionScheme for enrollment tracks.
"""
import
logging
from
course_modes.models
import
CourseMode
from
courseware.masquerade
import
(
get_course_masquerade
,
...
...
@@ -13,6 +15,9 @@ from openedx.core.djangoapps.verified_track_content.models import VerifiedTrackC
from
student.models
import
CourseEnrollment
from
xmodule.partitions.partitions
import
Group
,
UserPartition
LOGGER
=
logging
.
getLogger
(
__name__
)
# These IDs must be less than 100 so that they do not overlap with Groups in
# CohortUserPartition or RandomUserPartitionScheme
# (CMS' course_group_config uses a minimum value of 100 for all generated IDs).
...
...
@@ -70,7 +75,15 @@ class EnrollmentTrackPartitionScheme(object):
If a course is using the Verified Track Cohorting pilot feature, this method
returns None regardless of the user's enrollment mode.
"""
def
_log_for_educator_1511
(
log_statement
):
# temporary logging for EDUCATOR-1511. Will be rolled back as soon as we have some logs
if
course_key
==
CourseKey
.
from_string
(
'course-v1:ASUx+ENG101x+2177A'
):
LOGGER
.
warning
(
'EDUCATOR-1511: get_group_for_user | {0}'
.
format
(
log_statement
))
_log_for_educator_1511
(
'Getting group for user id {0}'
.
format
(
user
.
id
))
if
is_course_using_cohort_instead
(
course_key
):
_log_for_educator_1511
(
'Course is using cohort instead.'
)
return
None
# First, check if we have to deal with masquerading.
...
...
@@ -88,9 +101,12 @@ class EnrollmentTrackPartitionScheme(object):
mode_slug
,
modes
=
CourseMode
.
modes_for_course
(
course_key
,
include_expired
=
True
,
only_selectable
=
False
),
)
_log_for_educator_1511
(
'Got enrollment for user {0}: mode slug is {1}'
.
format
(
user
.
id
,
mode_slug
))
if
course_mode
and
CourseMode
.
is_credit_mode
(
course_mode
):
_log_for_educator_1511
(
'user {0} is in credit mode, returning verified partition'
.
format
(
user
.
id
))
course_mode
=
CourseMode
.
verified_mode_for_course
(
course_key
)
if
not
course_mode
:
_log_for_educator_1511
(
'user {0} in track {1} added to default partition'
.
format
(
user
.
id
,
mode_slug
))
course_mode
=
CourseMode
.
DEFAULT_MODE
return
Group
(
ENROLLMENT_GROUP_IDS
[
course_mode
.
slug
],
unicode
(
course_mode
.
name
))
else
:
...
...
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