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
OpenEdx
edx-platform
Commits
6b5d7c43
Commit
6b5d7c43
authored
Oct 17, 2017
by
Sanford Student
Committed by
Dillon Dumesnil
Oct 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add logging for EDUCATOR-1511
parent
dc96c1d6
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 @
6b5d7c43
"""
"""
UserPartitionScheme for enrollment tracks.
UserPartitionScheme for enrollment tracks.
"""
"""
import
logging
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
from
courseware.masquerade
import
(
from
courseware.masquerade
import
(
get_course_masquerade
,
get_course_masquerade
,
...
@@ -13,6 +15,9 @@ from openedx.core.djangoapps.verified_track_content.models import VerifiedTrackC
...
@@ -13,6 +15,9 @@ from openedx.core.djangoapps.verified_track_content.models import VerifiedTrackC
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
xmodule.partitions.partitions
import
Group
,
UserPartition
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
# These IDs must be less than 100 so that they do not overlap with Groups in
# CohortUserPartition or RandomUserPartitionScheme
# CohortUserPartition or RandomUserPartitionScheme
# (CMS' course_group_config uses a minimum value of 100 for all generated IDs).
# (CMS' course_group_config uses a minimum value of 100 for all generated IDs).
...
@@ -70,7 +75,15 @@ class EnrollmentTrackPartitionScheme(object):
...
@@ -70,7 +75,15 @@ class EnrollmentTrackPartitionScheme(object):
If a course is using the Verified Track Cohorting pilot feature, this method
If a course is using the Verified Track Cohorting pilot feature, this method
returns None regardless of the user's enrollment mode.
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
):
if
is_course_using_cohort_instead
(
course_key
):
_log_for_educator_1511
(
'Course is using cohort instead.'
)
return
None
return
None
# First, check if we have to deal with masquerading.
# First, check if we have to deal with masquerading.
...
@@ -88,9 +101,12 @@ class EnrollmentTrackPartitionScheme(object):
...
@@ -88,9 +101,12 @@ class EnrollmentTrackPartitionScheme(object):
mode_slug
,
mode_slug
,
modes
=
CourseMode
.
modes_for_course
(
course_key
,
include_expired
=
True
,
only_selectable
=
False
),
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
):
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
)
course_mode
=
CourseMode
.
verified_mode_for_course
(
course_key
)
if
not
course_mode
:
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
course_mode
=
CourseMode
.
DEFAULT_MODE
return
Group
(
ENROLLMENT_GROUP_IDS
[
course_mode
.
slug
],
unicode
(
course_mode
.
name
))
return
Group
(
ENROLLMENT_GROUP_IDS
[
course_mode
.
slug
],
unicode
(
course_mode
.
name
))
else
:
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