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
196d379c
Commit
196d379c
authored
7 years ago
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename MilestonesTransformer.
Add comment explaining why we can't have a separate transformer.
parent
0899ac56
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
8 deletions
+10
-8
lms/djangoapps/course_api/blocks/api.py
+2
-2
lms/djangoapps/course_api/blocks/transformers/__init__.py
+2
-2
lms/djangoapps/course_api/blocks/transformers/milestones.py
+3
-1
lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py
+2
-2
setup.py
+1
-1
No files found.
lms/djangoapps/course_api/blocks/api.py
View file @
196d379c
...
...
@@ -7,7 +7,7 @@ from lms.djangoapps.course_blocks.transformers.hidden_content import HiddenConte
from
openedx.core.djangoapps.content.block_structure.transformers
import
BlockStructureTransformers
from
.transformers.blocks_api
import
BlocksAPITransformer
from
.transformers.milestones
import
MilestonesTransformer
from
.transformers.milestones
import
Milestones
AndSpecialExams
Transformer
from
.serializers
import
BlockSerializer
,
BlockDictSerializer
...
...
@@ -56,7 +56,7 @@ def get_blocks(
include_special_exams
=
True
if
user
is
not
None
:
transformers
+=
COURSE_BLOCK_ACCESS_TRANSFORMERS
transformers
+=
[
MilestonesTransformer
(
include_special_exams
),
HiddenContentTransformer
()]
transformers
+=
[
Milestones
AndSpecialExams
Transformer
(
include_special_exams
),
HiddenContentTransformer
()]
transformers
+=
[
BlocksAPITransformer
(
block_counts
,
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/course_api/blocks/transformers/__init__.py
View file @
196d379c
...
...
@@ -6,7 +6,7 @@ from lms.djangoapps.course_blocks.transformers.visibility import VisibilityTrans
from
.student_view
import
StudentViewTransformer
from
.block_counts
import
BlockCountsTransformer
from
.navigation
import
BlockNavigationTransformer
from
.milestones
import
MilestonesTransformer
from
.milestones
import
Milestones
AndSpecialExams
Transformer
class
SupportedFieldType
(
object
):
...
...
@@ -45,7 +45,7 @@ SUPPORTED_FIELDS = [
# 'student_view_multi_device'
SupportedFieldType
(
StudentViewTransformer
.
STUDENT_VIEW_MULTI_DEVICE
,
StudentViewTransformer
),
SupportedFieldType
(
'special_exam_info'
,
MilestonesTransformer
),
SupportedFieldType
(
'special_exam_info'
,
Milestones
AndSpecialExams
Transformer
),
# set the block_field_name to None so the entire data for the transformer is serialized
SupportedFieldType
(
None
,
BlockCountsTransformer
,
BlockCountsTransformer
.
BLOCK_COUNTS
),
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/course_api/blocks/transformers/milestones.py
View file @
196d379c
...
...
@@ -17,7 +17,7 @@ from util import milestones_helpers
log
=
logging
.
getLogger
(
__name__
)
class
MilestonesTransformer
(
BlockStructureTransformer
):
class
Milestones
AndSpecialExams
Transformer
(
BlockStructureTransformer
):
"""
A transformer that handles both milestones and special (timed) exams.
...
...
@@ -106,6 +106,8 @@ class MilestonesTransformer(BlockStructureTransformer):
usage_info
.
user
.
id
))
# TODO: As part of a cleanup effort, this transformer should be split into
# MilestonesTransformer and SpecialExamsTransformer, which are completely independent.
def
add_special_exam_info
(
self
,
block_key
,
block_structure
,
usage_info
):
"""
For special exams, add the special exam information to the course blocks.
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py
View file @
196d379c
...
...
@@ -12,7 +12,7 @@ from openedx.core.lib.gating import api as gating_api
from
openedx.core.djangoapps.content.block_structure.transformers
import
BlockStructureTransformers
from
student.tests.factories
import
CourseEnrollmentFactory
from
..milestones
import
MilestonesTransformer
from
..milestones
import
Milestones
AndSpecialExams
Transformer
from
...api
import
get_course_blocks
...
...
@@ -23,7 +23,7 @@ class MilestonesTransformerTestCase(CourseStructureTestCase, MilestonesTestCaseM
"""
Test behavior of ProctoredExamTransformer
"""
TRANSFORMER_CLASS_TO_TEST
=
MilestonesTransformer
TRANSFORMER_CLASS_TO_TEST
=
Milestones
AndSpecialExams
Transformer
def
setUp
(
self
):
"""
...
...
This diff is collapsed.
Click to expand it.
setup.py
View file @
196d379c
...
...
@@ -52,7 +52,7 @@ setup(
"visibility = lms.djangoapps.course_blocks.transformers.visibility:VisibilityTransformer"
,
"hidden_content = lms.djangoapps.course_blocks.transformers.hidden_content:HiddenContentTransformer"
,
"course_blocks_api = lms.djangoapps.course_api.blocks.transformers.blocks_api:BlocksAPITransformer"
,
"milestones = lms.djangoapps.course_api.blocks.transformers.milestones:MilestonesTransformer"
,
"milestones = lms.djangoapps.course_api.blocks.transformers.milestones:Milestones
AndSpecialExams
Transformer"
,
"grades = lms.djangoapps.grades.transformer:GradesTransformer"
,
],
}
...
...
This diff is collapsed.
Click to expand it.
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