Skip to content

Instantly share code, notes, and snippets.

View xitij2000's full-sized avatar
🍮
Alive

Kshitij Sobti xitij2000

🍮
Alive
View GitHub Profile
@xitij2000
xitij2000 / asset-picker-proposal.md
Last active July 24, 2026 13:15
Asset Picker product proposal

TL;DR

Create an Asset Picker that any XBlock can integrate so course authors can browse and pick existing course assets (videos, images, documents, audio, code, other) instead of pasting URLs.

Overview

We can turn the existing Files & Videos page into a reusable picker that XBlocks can open from their edit screens. Authors can then select one or more files, and the picker returns the selection to the XBlock so it can use them.

@xitij2000
xitij2000 / env.config.jsx
Created July 17, 2026 14:36
env.config.jsx for PSU
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
import { Button, Col, Container, Row } from '@openedx/paragon';
import DetailedGrades from '@src/course-home/progress-tab/grades/detailed-grades/DetailedGrades';
import GradeSummary from '@src/course-home/progress-tab/grades/grade-summary/GradeSummary';
import React from 'react';
const progressWrapper = {
op: PLUGIN_OPERATIONS.Wrap,
widgetId: 'default_contents',
wrapper: ({ component }) => (
@xitij2000
xitij2000 / env.confg.jsx
Created March 20, 2025 14:53
Authoring MFE plugin for aspects
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
import {
Button,
Card,
Dropdown,
DropdownButton,
Icon,
IconButton,
IconButtonWithTooltip
} from '@openedx/paragon';
@xitij2000
xitij2000 / migrate-github-teams.py
Created January 16, 2025 05:25
Migrate GitHub team from the current per-CC mechanism to per-repo
# SPDX-FileCopyrightText: 2025-present Kshitij Sobti <kshitij@sobti.in>
#
# SPDX-License-Identifier: MIT
from collections import defaultdict
from github import Github
from github import Auth
auth = Auth.Token("TOKEN")
g = Github(auth=auth)
@xitij2000
xitij2000 / env.config.jsx
Last active November 15, 2024 16:22
env.config.jsx file for learning MFE to test progress page plugins
import {getConfig} from '@edx/frontend-platform';
import {getAuthenticatedHttpClient, getAuthenticatedUser} from '@edx/frontend-platform/auth';
import {PLUGIN_OPERATIONS} from '@openedx/frontend-plugin-framework';
import {useEffect, useState} from 'react';
import {useSelector} from 'react-redux';
import {useModel} from "./src/generic/model-store";
import GradeSummary from "./src/course-home/progress-tab/grades/grade-summary/GradeSummary";
import DetailedGrades from "./src/course-home/progress-tab/grades/detailed-grades/DetailedGrades";
function useComponentVisibility(componentName) {

Replacement of progress page in Authoring MFE

Installation steps:

  • Clone this gist to a directory in your system.
  • Install it in the authoring MFE using npm install --no-save @openedx-plugins/course-app-progress@file:./path/to/this-repo

Testing steps:

  • Try using the new setting in this page.
@xitij2000
xitij2000 / proposed-new-pr-message-2024-09-13.md
Last active September 13, 2024 07:07
proposed-new-pr-message-2024-09-13

Thanks for the pull request, @someuser!

This repository is currently maintained by @some-team-or-user.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

@xitij2000
xitij2000 / tutor-devstack.py
Created August 18, 2023 11:22
tutor-devstack-plugin
import re
from urllib.parse import urlparse
import click
from tutor import hooks
from tutor import config as tutor_config
from tutor.commands.dev import DevContext
GITHUB_PR_REGEX = re.compile(
r"\/(?P[a-z0-9-_]+)\/(?P[a-z0-9-_]+)\/pull\/(?P[0-9]+)"
)
@xitij2000
xitij2000 / xblock-chat-sample.yml
Created September 17, 2020 17:48
Sample Code for XBlock Chat's YAML configuration
- welcome-step:
messages:
- alice: "Hello my name is Alice!"
- bob: "And I am Bob."
- alice: "Today we will ask you a basic trivia question."
- bob: "Would you like to continue?"
responses:
- "Yes": question-step
- "No": exit-step
- question-step:
from pathlib import Path
from babel.messages import pofile
from babel.messages.catalog import Catalog
missing = Catalog("ar")
changed = Catalog("ar")
added = Catalog("ar")
asu_django = pofile.read_po(Path("asu/django.po").open())
edx_django = pofile.read_po(Path("edx/django.po").open())