Giter Site home page Giter Site logo

attiyaishaque / xblock-adventure Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openedx-unsupported/xblock-adventure

0.0 0.0 0.0 102 KB

"Choose Your Own Adventure" XBlock, aka Simulations

License: GNU Affero General Public License v3.0

Python 69.20% CSS 2.52% JavaScript 21.57% HTML 3.29% Makefile 3.42%

xblock-adventure's Introduction

Adventure XBlock

Adventure XBlock is an XBlock for creating a simple chose your own adventure style simulation.

It presents the user with a branching sequence of steps, each which can contain other XBlockLightChildrens.

Choosing a branch is mainly realized by selecting an option from a multiple choice question.

It also has the ability to embed other XBlockLightChildrens such as html, video, etc.

Installation

Install the requirements into the python virtual environment of your edx-platform installation by running the following command from the root folder:

$ pip install -r requirements.txt

Enabling in studio

You can enable the XBlock in studio through the advanced settings.

  1. From the main page of a specific course, navigate to Settings -> Advanced Settings from the top menu.
  2. Check for the advanced_modules policy key, and add "adventure" to the policy value list.
  3. Click the "Save changes" button.

Usage

When you add the Adventure component to a course in the studio, the block is field with default XML content.

The various xml elements are explained below.

<adventure> element

The wrapping <adventure> element can contain the following child elements:

  • <title> - Renders the title of the block.
  • <info> - Renders a shared info, it is displayed on every step, along with the title.
  • <step> - A step of the adventure. A typical adventure has at least a couple of steps.

<step> element

A step element represent a simple step of the adventure.

The <step> element has the following attributes:

  • name: The name of the step. It must be unique within an adventure, as this is how other steps refer to this one. The first step must be named first. This is how the adventure block finds the initial step for the adventure. This is a mandatory attribute.

  • back: The name of the previous step, for backtracking. This is an optional attribute. If missing, the controls for getting back to the previous step is disabled.

  • next: The name of the next step. This is an optional attribute. If missing and a choice mechanism such as <mcq> is present, it means this is a choice step. If missing and there are no such mechanism present, it means this is (one of the) final step(s) of the adventure.

The <step> element can contain various XBlockLightChild elements and other XBlocks, such as <html>, <title>, <mcq>, <ooyala-player>. To know more about them, see their documentation.

Of special interest is the <mcq> element, that can act as a selector for the next step. In this case, the selected value of the choice must be a valid name for one of the steps. Once selected, this choice will act the same way as if the step would have it as it's next attribute.

Example

For a complete example, see the contents of the default adventure a new adventure unit defaults to in the Studio.

Workbench installation, settings and testing

See general instructions on installing, using and testing XBlocks with the workbench.

TODO

When test are finish and working:

  • Add tests for get_student_choice and save_student_choice (previous state saving)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.