Skip to content

Commit

Permalink
fix: [AXIMST-63] Group configurations serializer and docs (#2496)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzniaievdm authored and monteri committed Jan 30, 2024
1 parent 29037fd commit d1040ef
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class GroupConfigurationUsageSerializer(serializers.Serializer):

label = serializers.CharField()
url = serializers.CharField()
validation = serializers.DictField(required=False)


class GroupConfigurationGroupSerializer(serializers.Serializer):
Expand All @@ -21,7 +22,7 @@ class GroupConfigurationGroupSerializer(serializers.Serializer):

id = serializers.IntegerField()
name = serializers.CharField()
usage = GroupConfigurationUsageSerializer(allow_null=True, many=True)
usage = GroupConfigurationUsageSerializer(required=False, allow_null=True, many=True)
version = serializers.IntegerField()


Expand All @@ -34,6 +35,7 @@ class GroupConfigurationItemSerializer(serializers.Serializer):
description = serializers.CharField()
groups = GroupConfigurationGroupSerializer(allow_null=True, many=True)
id = serializers.IntegerField()
usage = GroupConfigurationUsageSerializer(required=False, allow_null=True, many=True)
name = serializers.CharField()
parameters = serializers.DictField()
read_only = serializers.BooleanField(required=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,32 @@ def get(self, request: Request, course_id: str):
```json
{
"all_group_configurations": [
{
"active": true,
"description": "Partition for segmenting users by enrollment track",
"groups": [
{
"id": 2,
"name": "Enroll",
"usage": [
{
"label": "Subsection / Unit",
"url": "/container/block-v1:org+101+101+type@vertical+block@08772238547242848cef9"
}
],
"version": 1
}
],
"id": 50,
"usage": null,
"name": "Enrollment Track Groups",
"parameters": {
"course_id": "course-v1:org+101+101"
},
"read_only": true,
"scheme": "enrollment_track",
"version": 3
},
{
"active": true,
"description": "The groups in this configuration can be mapped to cohorts in the Instructor.",
Expand All @@ -78,10 +104,38 @@ def get(self, request: Request, course_id: str):
"version": 3
}
],
"experiment_group_configurations": null,
"experiment_group_configurations": [
{
"active": true,
"description": "desc",
"groups": [
{
"id": 276408623,
"name": "Group A",
"usage": null,
"version": 1
},
...
],
"id": 875961582,
"usage": [
{
"label": "Unit / Content Experiment",
"url": "/container/block-v1:org+101+101+type@split_test+block@90ccbbad0dac48b18c5c80",
"validation": null
},
...
],
"name": "Experiment Group Configurations 5",
"parameters": {},
"scheme": "random",
"version": 3
},
...
],
"mfe_proctored_exam_settings_url": "",
"should_show_enrollment_track": false,
"should_show_experiment_groups": false
"should_show_enrollment_track": true,
"should_show_experiment_groups": true,
}
```
"""
Expand Down

0 comments on commit d1040ef

Please sign in to comment.