Skip to content

Commit

Permalink
feat!: replace old demo course with the new one
Browse files Browse the repository at this point in the history
The old demo course can still be accessed by checking out
named release tags of this repo.
  • Loading branch information
kdmccormick committed Jan 10, 2024
1 parent 51d2166 commit a2c735b
Show file tree
Hide file tree
Showing 2,152 changed files with 39,647 additions and 444,111 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Ensure the test course and libraries can be imported.

name: CI

on:
pull_request:
branches: ["master"]
push:
branches: ["master"]

jobs:

source_and_tars_match:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2

- name: Unpack tars
run: make unpack

- name: Confirm that unpacked tars match source
run: |
git update-index --refresh && git diff-index HEAD -- && {
echo -e "\033[1;32m=============================================================================\033[0m"
echo -e "\033[1;32mUnpacked .tar.gz files do match source XML, all is well.\033[0m"
echo -e "\033[1;32m=============================================================================\033[0m"
exit 0
} || {
echo -e "\033[1;31m=============================================================================\033[0m"
echo -e "\033[1;31mERROR: Unpacked .tar.gz files do not match source XML! See differences below.\033[0m"
echo -e "\033[0;31mYou can fix this by either:\033[0m"
echo -e "\033[0;31m * updating the source using the tars (run: make unpack), or\033[0m"
echo -e "\033[0;31m * updating the tars using the source (run: make dist).\033[0m"
echo -e "\033[1;31m=============================================================================\033[0m"
git diff
exit 1
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
.DS_Store?
.ehthumbs.db
Icon?
Thumbs.db.DS_Store
661 changes: 0 additions & 661 deletions AGPL_LICENSE

This file was deleted.

661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.PHONY: clean dist help import unpack

REPO_NAME=openedx-demo-course

COURSE=demo-course
COURSE_TAR=dist/$(COURSE).tar.gz
LIBRARY=demo-content-library
LIBRARY_TAR=dist/$(LIBRARY).tar.gz

TUTOR:=tutor
TUTOR_CONTEXT:=local
LIBRARY_IMPORT_USER:=admin

help: ## Display this help message.
@echo "Please use \`make <target>' where <target> is one of"
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | sort | awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'

clean: ## Delete all generated course and library exports.
rm -f $(COURSE_TAR) $(LIBRARY_TAR)

dist: ## Create/overwrite exports in ./dist/ folder for course and libary.
cd $(COURSE) && tar czfv ../$(COURSE_TAR) ./course/
cd $(LIBRARY) && tar czfv ../$(LIBRARY_TAR) ./library/

unpack: ## Unpack course and library exports from ./dist/ folder into source OLX.
[ -f $(COURSE_TAR) ] && (cd $(COURSE) && tar xzfv ../$(COURSE_TAR)) || echo "No course to unpack."
[ -f $(LIBRARY_TAR) ] && (cd $(LIBRARY) && tar xzfv ../$(LIBRARY_TAR)) || echo "No content library to unpack."

import: dist ## Import course and libraries into a locally-running Tutor instance. Requires an admin user.
$(TUTOR) mounts add cms,cms-worker:.:/openedx/data/$(REPO_NAME)
yes | \
$(TUTOR) $(TUTOR_CONTEXT) run $(MOUNT_REPO) cms \
./manage.py cms import_content_library /openedx/data/$(REPO_NAME)/$(LIBRARY_TAR) $(LIBRARY_IMPORT_USER)
$(TUTOR) $(TUTOR_CONTEXT) run $(MOUNT_REPO) cms \
./manage.py cms import /openedx/data $(REPO_NAME)/$(COURSE)/course
$(TUTOR) $(TUTOR_CONTEXT) run cms \
./manage.py cms reindex_course --all --setup
18 changes: 0 additions & 18 deletions README.md

This file was deleted.

126 changes: 126 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
Open edX Demo Course, v2
########################

Contents
********

This repository contains a course and some libraries that you can import into your Open edX instance to learn more about platform features. This course is geared mainly towards instructors, but learners can also benefit from learning how the platform and problem types work. For convenience, we include both:

* The ``.tar.gz`` files for you to import into Studio, located in the ``./dist/`` folder.
* The source code (a.k.a. "OLX") in the other top-level folders.

.. list-table::
:header-rows: 1

* - Name
- Key
- Download
- Source OLX
* - *Open edX demo Course*
- ``course-v1:demo+Course+1``
- `<./dist/demo-course.tar.gz>`_
- `<./demo-course>`_
* - *Open edX Example Content Library*
- ``library-v1:demo+ContentLibrary``
- `<./dist/demo-content-library.tar.gz>`_
- `<./demo-content-library>`_

Rationale
*********

This course and its associated libraries aim to expose as many Open edX Studio & courseware features as possible.
It does so by providing example usages of various block types and features such as cohorts and discussion forums.

This course serves as a user-facing introduction and tutorial to the Open edX platform.

It is useful for basic testing, but also needs to remain a suitable first experience for Open edX learners.
For deep testing, we recommend using the `Open edX Test Course <https://github.com/openedx/openedx-test-course>`_.

Status
******

This course is new as of the Redwood (June 2024) release.

Usage
*****

To use this course and its libraries, you will need to import them into an Open edX instance. All new Open edX
instances will get this course installed by default.

Manual import
=============

In Studio:

1. Create a library with the org ``demo`` and the slug ``ContentLibrary``.
2. Import ``dist/demo-content-library.tar.gz`` into the library.
3. Create a course run with the org ``demo``, name ``Course``, and run ``1``.
4. Import ``dist/demo-course.tar.gz`` into the course run.

Scripted import (for Tutor users)
=================================

In the same environment that use to run tutor, execute the command::

make import TUTOR=... TUTOR_CONTEXT=... LIBRARY_IMPORT_USER=...
where:

* ``TUTOR`` should be the command that you use to run Tutor (defaults to simply ``tutor``).
* ``TUTOR_CONTEXT`` should be the mode in which you want to import the course (defaults to ``local``, other acceptable values are ``k8s`` and ``dev``).
* ``LIBRARY_IMPORT_USER`` is the username of an existing user in your Open edX instance that will be given ownership of the imported library (defaults to ``admin``).

For example::

# Import in developer mode using a custom tutor root, and make alice the library admin.
make import TUTOR='tutor --root=~/tutor-root' TUTOR_CONTEXT=dev LIBRARY_IMPORT_USER=alice

Or::

# Import in kubernetes mode, and make bob the library admin.
make import TUTOR_CONTEXT=k8s LIBRARY_IMPORT_USER=bob

Re-generating the importable content
====================================

If you make changes to the course or library OLX and want to re-generate the importable ``.tar.gz`` files, simply run::

make dist

This will package the OLX into the ``dist`` directory.

Contributing
************

Contributions of bug fixes are welcome. There are two ways you can make changes to this course.

OLX Editing
===========

If you are experienced with editing raw OLX, then you can make changes directly to the XML and asset files this repository. Before opening a pull request, please:

* Run ``make dist``, which will generate the ``dist/*.tar.gz`` archives. Include these changes in your commit.
* Import the updated ``dist/*.tar.gz`` archives into an Open edX Studio (as described above) and ensure the test course still works as expected, both in Studio and LMS.

Studio Editing
==============

Once you've imported the test course and libraries into an Open edX instance (as described above), you can edit the course and its libraries in Studio. Make sure to Publish any changes you make from Studio so that you can test them out in LMS.

When you're ready to contribute the changes back into this repository, simply:

1. Export the course and any libraries you changed.
2. Move to exported ``.tar.gz`` archives into this repository's ``dist/`` folder, and name them to match the top-level OLX folders. For example, the course archive should be named ``dist/demo-course.tar.gz``, and the problem bank archive should be named ``dist/demo-content-library.tar.gz``.
3. Run ``make unpack``, which will unpack the archives into OLX.
4. Review your OLX changes using ``git diff``.
5. Commit your changes and open a pull request.

Tag @openedx/openedx-demo-course-maintainers in all pull requests. We'll do our best to take a look! All pull requests should pass the GitHub Actions suite, which ensures that the course and libraries can be imported into a freshly-provisioned Tutor instance.

License
*******

All content is made available under a `Creative Commons BY-NC-SA 3.0 US
License <http://creativecommons.org/licenses/by-nc-sa/3.0/us/>`_.

All code is made available under an `AGPLv3 License <./AGPL_LICENSE>`_
49 changes: 0 additions & 49 deletions about/overview.html

This file was deleted.

32 changes: 32 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file records information about this repo. Its use is described in OEP-55:
# https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html

apiVersion: backstage.io/v1alpha1
# (Required) Acceptable Values: Component, Resource, System
# A repo will almost certainly be a Component.
kind: Component
metadata:
name: 'openedx-demo-course'
description: "Open edX DemoX Course"
links:
annotations:
# (Optional) Annotation keys and values can be whatever you want.
# We use it in Open edX repos to have a comma-separated list of GitHub user
# names that might be interested in changes to the architecture of this
# component.
openedx.org/arch-interest-groups: "sarina"
spec:

# (Required) This can be a group (`group:<github_group_name>`) or a user (`user:<github_username>`).
# Don't forget the "user:" or "group:" prefix. Groups must be GitHub team
# names in the openedx GitHub organization: https://github.com/orgs/openedx/teams
#
# If you need a new team created, create an issue with tCRIL engineering:
# https://github.com/openedx/tcril-engineering/issues/new/choose
owner: user:sarina

# (Required) Acceptable Type Values: service, website, library
type: 'website'

# (Required) Acceptable Lifecycle Values: experimental, production, deprecated
lifecycle: 'production'
3 changes: 0 additions & 3 deletions chapter/1414ffd5143b4b508f739b563ab468b7.xml

This file was deleted.

3 changes: 0 additions & 3 deletions chapter/d8a6192ade314473a78242dfeedfbf5b.xml

This file was deleted.

5 changes: 0 additions & 5 deletions chapter/graded_interactions.xml

This file was deleted.

4 changes: 0 additions & 4 deletions chapter/interactive_demonstrations.xml

This file was deleted.

5 changes: 0 additions & 5 deletions chapter/social_integration.xml

This file was deleted.

1 change: 0 additions & 1 deletion course.xml

This file was deleted.

8 changes: 0 additions & 8 deletions course/Demo_Course.xml

This file was deleted.

9 changes: 9 additions & 0 deletions demo-content-library/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Demo Content Library
====================

This directory contains all the content for the demo library in an unzipped view. You can use it to:

- Inspect the OLX code
- Review the assets in the library

It should not be used to import the library into your Open edX® instance. To import the library into your Open edX® instance, you should import the library's .tar.gz file found in the `dist folder <../../dist>`_.
8 changes: 8 additions & 0 deletions demo-content-library/library/library.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<library url_name="library" xblock-family="xblock.v1" display_name="Respiratory System Question Bank 1" org="Dummy" library="RESP_Q1">
<problem url_name="dd88975768314dcd91363359d38371a8"/>
<problem url_name="4e98cc7d3ed6413b9afbdf64e4a1b682"/>
<problem url_name="19c4d31df12b423c8944cf66ed8aa11d"/>
<problem url_name="6b74196a21a245ceb52873f50fb4c1b4"/>
<problem url_name="b7597ae2c50d49e69dd0379465edbdd0"/>
<problem url_name="5cd09d2566e8409b8ddcb57b0ff2361f"/>
</library>
1 change: 1 addition & 0 deletions demo-content-library/library/policies/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<problem display_name="Which muscle contracts to help with inhalation during breathing?" markdown="null">
<multiplechoiceresponse>
<label>Which muscle contracts to help with inhalation during breathing?</label>
<choicegroup type="MultipleChoice">
<choice correct="true">A. Diaphragm</choice>
<choice correct="false">B. Biceps</choice>
<choice correct="false">C. Hamstrings</choice>
<choice correct="false">D. Triceps</choice>
</choicegroup>
<solution>
<div class="detailed-solution">
<p>Answer: A. Diaphragm</p>
<p>The diaphragm contracts during inhalation, increasing the volume of the thoracic cavity and allowing air to be drawn into the lungs.</p>
</div>
</solution>
</multiplechoiceresponse>
</problem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<problem display_name="What is the primary function of the alveoli in the lungs?" markdown="null">
<multiplechoiceresponse>
<label>What is the primary function of the alveoli in the lungs?</label>
<choicegroup type="MultipleChoice">
<choice correct="false">A. Producing mucus</choice>
<choice correct="false">B. Vocalization</choice>
<choice correct="true">C. Gas exchange</choice>
<choice correct="false">D. Humidifying incoming air</choice>
</choicegroup>
<solution>
<div class="detailed-solution">
<p>Answer: C. Gas exchange</p>
<p>The alveoli are tiny sacs in the lungs where oxygen is exchanged for carbon dioxide in the blood.</p>
</div>
</solution>
</multiplechoiceresponse>
</problem>
Loading

0 comments on commit a2c735b

Please sign in to comment.