Welcome to the workshop. Here we'll get a hands-on approach on creating periodic reports on a sandbox provided by OpenCraft.
- Register an account on the provided sandbox
| from openedx.core.djangoapps.course_groups.models import CohortMembership | |
| from common.djangoapps.course_modes.models import CourseMode | |
| from opaque_keys.edx.keys import CourseKey | |
| from common.djangoapps.student.models import CourseEnrollment | |
| from django.contrib.auth import get_user_model | |
| def enroll(username='edx', course_key='course-v1:edX+DemoX+Demo_Course'): | |
| user = get_user_model().objects.get(username=username) |
Welcome to the workshop. Here we'll get a hands-on approach on creating periodic reports on a sandbox provided by OpenCraft.
| ALTER TABLE social_auth_usersocialauth MODIFY uid VARCHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL | |
| """ | |
| # Confirming issue | |
| from social_django.models import UserSocialAuth | |
| >>> UserSocialAuth.objects.select_related("user").get(provider="edx-oauth2", uid="test1") | |
| <UserSocialAuth: test1> | |
| >>> UserSocialAuth.objects.select_related("user").get(provider="edx-oauth2", uid="TEST1") | |
| <UserSocialAuth: test1> |
| from xmodule.modulestore.django import modulestore | |
| def get_course_ids(): | |
| return {summary.id for summary in modulestore().get_course_summaries()} | |
| def check_capa(course_id): | |
| course = modulestore().get_course(course_id, depth=None, lazy=True) | |
| for section in course.get_children(): | |
| for subsec in section.get_children(): | |
| for unit in subsec.get_children(): |