platform-plugin-aspects 0.9.5__tar.gz → 0.9.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/CHANGELOG.rst +9 -0
- {platform_plugin_aspects-0.9.5/platform_plugin_aspects.egg-info → platform_plugin_aspects-0.9.6}/PKG-INFO +10 -1
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/__init__.py +1 -1
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/sinks/course_overview_sink.py +91 -34
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6/platform_plugin_aspects.egg-info}/PKG-INFO +10 -1
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/LICENSE +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/MANIFEST.in +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/README.rst +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/apps.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/extensions/__init__.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/extensions/filters.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/management/__init__.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/management/commands/__init__.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/management/commands/dump_data_to_clickhouse.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/management/commands/load_test_tracking_events.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/settings/__init__.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/settings/common.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/settings/production.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/signals.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/sinks/__init__.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/sinks/base_sink.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/sinks/external_id_sink.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/sinks/serializers.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/sinks/user_profile_sink.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/sinks/user_retire_sink.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/static/css/superset.css +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/static/html/superset.html +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/static/html/superset_student.html +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/static/js/embed_dashboard.js +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/static/js/install_required.js +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/static/js/superset.js +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/tasks.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/templates/instructor_dashboard/aspects.html +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/urls.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/utils.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/views.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/waffle.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/xblock.py +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects.egg-info/SOURCES.txt +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects.egg-info/dependency_links.txt +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects.egg-info/entry_points.txt +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects.egg-info/not-zip-safe +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects.egg-info/requires.txt +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects.egg-info/top_level.txt +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/requirements/base.in +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/requirements/constraints.txt +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/setup.cfg +0 -0
- {platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/setup.py +0 -0
|
@@ -14,6 +14,15 @@ Change Log
|
|
|
14
14
|
Unreleased
|
|
15
15
|
**********
|
|
16
16
|
|
|
17
|
+
0.9.6 - 2024-06-07
|
|
18
|
+
******************
|
|
19
|
+
|
|
20
|
+
Fixes
|
|
21
|
+
=====
|
|
22
|
+
|
|
23
|
+
* The CourseOutline sink was not always ordering blocks correctly, leading to issues with blocks appearing in the wrong sections/subsection.
|
|
24
|
+
|
|
25
|
+
|
|
17
26
|
0.9.5 - 2024-05-24
|
|
18
27
|
******************
|
|
19
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.6
|
|
4
4
|
Summary: Aspects plugins for edx-platform
|
|
5
5
|
Home-page: https://github.com/openedx/platform-plugin-aspects
|
|
6
6
|
Author: Open edX Project
|
|
@@ -276,6 +276,15 @@ Change Log
|
|
|
276
276
|
Unreleased
|
|
277
277
|
**********
|
|
278
278
|
|
|
279
|
+
0.9.6 - 2024-06-07
|
|
280
|
+
******************
|
|
281
|
+
|
|
282
|
+
Fixes
|
|
283
|
+
=====
|
|
284
|
+
|
|
285
|
+
* The CourseOutline sink was not always ordering blocks correctly, leading to issues with blocks appearing in the wrong sections/subsection.
|
|
286
|
+
|
|
287
|
+
|
|
279
288
|
0.9.5 - 2024-05-24
|
|
280
289
|
******************
|
|
281
290
|
|
|
@@ -29,6 +29,8 @@ CLICKHOUSE_BULK_INSERT_PARAMS = {
|
|
|
29
29
|
"input_format_allow_errors_ratio": 0.1,
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
MODULESTORE_PUBLISHED_ONLY_FLAG = "rev-opt-published-only"
|
|
33
|
+
|
|
32
34
|
|
|
33
35
|
class XBlockSink(ModelBaseSink):
|
|
34
36
|
"""
|
|
@@ -49,6 +51,48 @@ class XBlockSink(ModelBaseSink):
|
|
|
49
51
|
initial={"dump_id": dump_id, "time_last_dumped": time_last_dumped},
|
|
50
52
|
)
|
|
51
53
|
|
|
54
|
+
def get_xblocks_recursive(self, parent_block, detached_xblock_types, initial):
|
|
55
|
+
"""
|
|
56
|
+
Serialize the course tree recursively, return a flattened list of XBlocks.
|
|
57
|
+
|
|
58
|
+
Note that this list will not include detached blocks, those are handled
|
|
59
|
+
in get_detached_xblocks. This method preserves the course ordering for
|
|
60
|
+
non-detached blocks.
|
|
61
|
+
"""
|
|
62
|
+
items = [
|
|
63
|
+
self.serialize_xblock(
|
|
64
|
+
parent_block,
|
|
65
|
+
detached_xblock_types,
|
|
66
|
+
initial["dump_id"],
|
|
67
|
+
initial["time_last_dumped"],
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
for child in parent_block.get_children():
|
|
72
|
+
items.extend(
|
|
73
|
+
self.get_xblocks_recursive(child, detached_xblock_types, initial)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
return items
|
|
77
|
+
|
|
78
|
+
def get_detached_xblocks(self, course_blocks, detached_xblock_types, initial):
|
|
79
|
+
"""
|
|
80
|
+
Spin through the flat list of all blocks in a course and return only
|
|
81
|
+
the detached blocks. Ordering of non-detached blocks is already
|
|
82
|
+
guaranteed in get_xblocks_recursive. Order of detached blocks
|
|
83
|
+
is not guaranteed.
|
|
84
|
+
"""
|
|
85
|
+
return [
|
|
86
|
+
self.serialize_xblock(
|
|
87
|
+
block,
|
|
88
|
+
detached_xblock_types,
|
|
89
|
+
initial["dump_id"],
|
|
90
|
+
initial["time_last_dumped"],
|
|
91
|
+
)
|
|
92
|
+
for block in course_blocks
|
|
93
|
+
if block.scope_ids.block_type in detached_xblock_types
|
|
94
|
+
]
|
|
95
|
+
|
|
52
96
|
def serialize_item(self, item, many=False, initial=None):
|
|
53
97
|
"""
|
|
54
98
|
Serialize an XBlock into a dict
|
|
@@ -58,10 +102,26 @@ class XBlockSink(ModelBaseSink):
|
|
|
58
102
|
detached_xblock_types = get_detached_xblock_types()
|
|
59
103
|
|
|
60
104
|
location_to_node = {}
|
|
61
|
-
items = modulestore.get_items(course_key)
|
|
62
105
|
|
|
63
|
-
#
|
|
64
|
-
#
|
|
106
|
+
# This call gets the entire course tree in order, because the
|
|
107
|
+
# get_items call does not guarantee ordering. It does not return
|
|
108
|
+
# detached blocks, so we gather them separately below.
|
|
109
|
+
course_block = modulestore.get_course(
|
|
110
|
+
course_key, revision=MODULESTORE_PUBLISHED_ONLY_FLAG
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
items = self.get_xblocks_recursive(course_block, detached_xblock_types, initial)
|
|
114
|
+
|
|
115
|
+
# Here we fetch the detached blocks and add them to the list.
|
|
116
|
+
detached = self.get_detached_xblocks(
|
|
117
|
+
modulestore.get_items(course_key, revision=MODULESTORE_PUBLISHED_ONLY_FLAG),
|
|
118
|
+
detached_xblock_types,
|
|
119
|
+
initial,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
items.extend(detached)
|
|
123
|
+
|
|
124
|
+
# Add location and tag data to the dict mappings of the blocks
|
|
65
125
|
index = 0
|
|
66
126
|
section_idx = 0
|
|
67
127
|
subsection_idx = 0
|
|
@@ -69,41 +129,39 @@ class XBlockSink(ModelBaseSink):
|
|
|
69
129
|
|
|
70
130
|
for block in items:
|
|
71
131
|
index += 1
|
|
72
|
-
fields = self.serialize_xblock(
|
|
73
|
-
block,
|
|
74
|
-
index,
|
|
75
|
-
detached_xblock_types,
|
|
76
|
-
initial["dump_id"],
|
|
77
|
-
initial["time_last_dumped"],
|
|
78
|
-
)
|
|
79
132
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
133
|
+
block["order"] = index
|
|
134
|
+
|
|
135
|
+
# Ensure that detached types aren't part of the tree
|
|
136
|
+
if block["xblock_data_json"]["detached"]:
|
|
137
|
+
block["xblock_data_json"]["section"] = 0
|
|
138
|
+
block["xblock_data_json"]["subsection"] = 0
|
|
139
|
+
block["xblock_data_json"]["unit"] = 0
|
|
140
|
+
else:
|
|
141
|
+
if block["xblock_data_json"]["block_type"] == "chapter":
|
|
142
|
+
section_idx += 1
|
|
143
|
+
subsection_idx = 0
|
|
144
|
+
unit_idx = 0
|
|
145
|
+
elif block["xblock_data_json"]["block_type"] == "sequential":
|
|
146
|
+
subsection_idx += 1
|
|
147
|
+
unit_idx = 0
|
|
148
|
+
elif block["xblock_data_json"]["block_type"] == "vertical":
|
|
149
|
+
unit_idx += 1
|
|
150
|
+
|
|
151
|
+
block["xblock_data_json"]["section"] = section_idx
|
|
152
|
+
block["xblock_data_json"]["subsection"] = subsection_idx
|
|
153
|
+
block["xblock_data_json"]["unit"] = unit_idx
|
|
154
|
+
|
|
155
|
+
block["xblock_data_json"]["tags"] = get_tags_for_block(
|
|
156
|
+
block["location"],
|
|
95
157
|
)
|
|
96
158
|
|
|
97
|
-
|
|
98
|
-
location_to_node[
|
|
99
|
-
fields
|
|
100
|
-
)
|
|
159
|
+
block["xblock_data_json"] = json.dumps(block["xblock_data_json"])
|
|
160
|
+
location_to_node[block["location"]] = block
|
|
101
161
|
|
|
102
162
|
return list(location_to_node.values())
|
|
103
163
|
|
|
104
|
-
def serialize_xblock(
|
|
105
|
-
self, item, index, detached_xblock_types, dump_id, time_last_dumped
|
|
106
|
-
):
|
|
164
|
+
def serialize_xblock(self, item, detached_xblock_types, dump_id, time_last_dumped):
|
|
107
165
|
"""Serialize an XBlock instance into a dict"""
|
|
108
166
|
course_key = item.scope_ids.usage_id.course_key
|
|
109
167
|
block_type = item.scope_ids.block_type
|
|
@@ -123,10 +181,9 @@ class XBlockSink(ModelBaseSink):
|
|
|
123
181
|
serialized_block = {
|
|
124
182
|
"org": course_key.org,
|
|
125
183
|
"course_key": str(course_key),
|
|
126
|
-
"location": str(item.location),
|
|
184
|
+
"location": str(XBlockSink.strip_branch_and_version(item.location)),
|
|
127
185
|
"display_name": item.display_name_with_default.replace("'", "'"),
|
|
128
186
|
"xblock_data_json": json_data,
|
|
129
|
-
"order": index,
|
|
130
187
|
"edited_on": str(getattr(item, "edited_on", "")),
|
|
131
188
|
"dump_id": dump_id,
|
|
132
189
|
"time_last_dumped": time_last_dumped,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.6
|
|
4
4
|
Summary: Aspects plugins for edx-platform
|
|
5
5
|
Home-page: https://github.com/openedx/platform-plugin-aspects
|
|
6
6
|
Author: Open edX Project
|
|
@@ -276,6 +276,15 @@ Change Log
|
|
|
276
276
|
Unreleased
|
|
277
277
|
**********
|
|
278
278
|
|
|
279
|
+
0.9.6 - 2024-06-07
|
|
280
|
+
******************
|
|
281
|
+
|
|
282
|
+
Fixes
|
|
283
|
+
=====
|
|
284
|
+
|
|
285
|
+
* The CourseOutline sink was not always ordering blocks correctly, leading to issues with blocks appearing in the wrong sections/subsection.
|
|
286
|
+
|
|
287
|
+
|
|
279
288
|
0.9.5 - 2024-05-24
|
|
280
289
|
******************
|
|
281
290
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/apps.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/signals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/tasks.py
RENAMED
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/urls.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/utils.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/views.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/waffle.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/platform_plugin_aspects/xblock.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.5 → platform_plugin_aspects-0.9.6}/requirements/constraints.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|