Giter Site home page Giter Site logo

shafqatfarhan / problem-builder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-craft/problem-builder

0.0 0.0 0.0 4.54 MB

An XBlock for posing questions to students

License: GNU Affero General Public License v3.0

Python 79.08% CSS 2.96% JavaScript 13.09% HTML 4.87%

problem-builder's Introduction

Problem Builder and Step Builder

Circle CI

This repository provides two XBlocks: Problem Builder and Step Builder.

Both blocks allow to create questions of various types. They can be used to simulate the workflow of real-life mentoring, within an edX course.

Supported features include:

  • Free-form answers (textarea) which can be shared accross different XBlock instances (for example, to allow a student to review and edit an answer they gave before).
  • Self-assessment MCQs (multiple choice questions), to display predetermined feedback to a student based on his choices in the self-assessment. Supports rating scales and arbitrary answers.
  • MRQs (Multiple Response Questions), a type of multiple choice question that allows the student to select more than one choice.
  • Answer recaps that display a read-only summary of a user's answer to a free-form question asked earlier in the course.
  • Progression tracking, to require that the student has completed a particular step before allowing them to complete the next step. Provides a link to the next step to the student.
  • Tables, which allow to present answers from the student to free-form answers in a concise way. Supports custom headers.
  • Dashboards, for displaying a summary of the student's answers to multiple choice questions. Details

The following screenshot shows an example of a Problem Builder block containing a free-form question, two MCQs and one MRQ:

Problem Builder Example

Installation

You can install Problem Builder from PyPI using this command:

pip install xblock-problem-builder

For full details, see "Open edX Installation", below.

Usage

See Usage Instructions

Workbench installation and settings

For developers, you can install this XBlock into the XBlock SDK workbench's virtualenv by running the following command from the problem builder repo root:

pip install -r requirements.txt

In the main XBlock repository, create the following configuration file in workbench/settings_pb.py in the XBlock repository:

from settings import *

INSTALLED_APPS += ('problem_builder',)
DATABASES['default']['NAME'] = 'workbench.sqlite'

Because this XBlock uses a Django model, you need to sync the database before starting the workbench. Run this from the XBlock repository root:

$ ./manage.py syncdb --settings=workbench.settings_pb

Running the workbench

$ ./manage.py runserver 8000 --settings=workbench.settings_pb

Access it at http://localhost:8000/.

Running tests

First, make sure the XBlock SDK (Workbench) is installed in the same virtual environment as xblock-problem-builder.

From the xblock-problem-builder repository root, run the tests with the following command:

$ ./run_tests.py

If you want to run only the integration or the unit tests, append the directory to the command. You can also run separate modules in this manner.

$ ./run_tests.py problem_builder/tests/unit

Extracting Translatable Strings

To extract/update strings for translation, you will need i18n_tools:

pip install git+https://github.com/edx/i18n-tools.git#egg=i18n_tools

To extract strings, use i18n_tool. We added two dummy translations for testing. Easily set your openedx instance to use one of them (eo and rtl) and check.
If you want to add a new language:

  1. Clone en directory to problem_builder/locale/<lang_code>/ for example: problem_builder/locale/fa_IR/
  2. Make neccessary changes to translation files headers. Make sure you have proper Language and Plural-Forms lines.
  3. Edit the contents of .po files located in problem_builder/locale/<lang_code>/LC_MESSAGES as you wish
  4. When you finished your modification process, re-compile the translation messages manually by executing the following command in the root of xblock:
i18n_tool generate

Adding custom scenarios to the workbench

Within the xblock-problem-builder repository, create the templates/xml and add XML scenarios to it - all files with the *.xml extension will be automatically loaded by the workbench:

$ mkdir templates/xml
$ cat > templates/xml/my_pb_scenario.xml

Restart the workbench to take the new scenarios into account.

Upgrading from Version 1

To upgrade a course from xblock-mentoring ("v1") to xblock-problem-builder ("v2"), run the following command on a system with edx-platform, xblock-mentoring, and xblock-problem-builder installed:

$ SERVICE_VARIANT=cms DJANGO_SETTINGS_MODULE="cms.envs.devstack" python -m problem_builder.v1.upgrade "Org/Course/Run"

Where "Org/Course/Run" is replaced with the ID of the course to upgrade.

Open edX Installation

Problem Builder releases are tagged with a version number, e.g. v2.6.0, v2.6.5. We recommend installing the most recently tagged version, with the exception of the following compatibility issues:

  • edx-platform version open-release/eucalyptus.2 and earlier must use โ‰คv2.6.0. See PR 128 for details.
  • edx-platform version named-release/dogwood.3 and earlier must use v2.0.0.

The edx-platform master branch will generally always be compatible with the most recent Problem Builder tag. See the EDXAPP_PRIVATE_REQUIREMENTS setting for the version currently installed on edx.org.

To install new versions of Problem Builder (v3.1.3+), use pip install xblock-problem-builder or specify a version using e.g. pip install xblock-problem-builder==3.1.3. To do this on Open edX could look like:

$ sudo -Hu edxapp bash
edxapp $ cd && . edxapp_env  && . ./venvs/edxapp/bin/activate && cd edx-platform/
edxapp $ pip install xblock-problem-builder
edxapp $ ./manage.py lms migrate --settings=aws  # or openstack, as appropriate

Then, restart the edxapp services:

$ sudo /edx/bin/supervisorctl restart edxapp:
$ sudo /edx/bin/supervisorctl restart edxapp_workers:

To install old verions of Problem Builder (< v3.1.3) on an Open edX installation, choose the tag you wish to install, follow the above instructions but instead of the pip install xblock-problem-builder command, use:

TAG='v2.6.5' pip install "git+https://github.com/open-craft/problem-builder.git@$TAG#egg=xblock-problem-builder==$TAG"

Note that Problem Builder requires xblock-utils. If you are installing it into a virtualenv used by edx-platform, xblock-utils should already be installed. But if you are installing it into another virtualenv, you may need to first install xblock-utils manually (recent versions of it are not available on PyPI so will not be automatically installed).

See Usage Instructions for how to enable in Studio.

Publishing to PyPI

Whenever we tag a new version, e.g. v3.1.3 and push it to GitHub, CircleCI will build it and deploy it to PyPI automatically. For details on how this works, see this pull request.

License

This XBlock is available under the GNU Affero General Public License (AGPLv3).

problem-builder's People

Contributors

aboudreault avatar antoviaque avatar atlaspilotpuppy avatar bogdanl avatar bradenmacdonald avatar cgopalan avatar dino-cikatic avatar dragonfi avatar e-kolpakov avatar filosottile avatar itsjeyd avatar jbzdak avatar jcdyer avatar jmbowman avatar kaizoku avatar kelketek avatar lgp171188 avatar mahyard avatar mhaton avatar msaqib52 avatar mtyaka avatar ny0m avatar omarkhan avatar pomegranited avatar replaceafill avatar rocioar avatar smarnach avatar symbolist avatar tomaszgy avatar xitij2000 avatar

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.