Skip to content

Commit

Permalink
Merge pull request #98 from bu-ist/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
jdub233 authored Jun 11, 2020
2 parents 1a4d0f8 + d774e00 commit 81ae533
Show file tree
Hide file tree
Showing 42 changed files with 3,741 additions and 1,984 deletions.
76 changes: 24 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,48 @@
# BULB (Boston University Learning Blocks)
# BU Learning Blocks

[![Maintainability](https://api.codeclimate.com/v1/badges/b920b4489aa4ded7bd77/maintainability)](https://codeclimate.com/github/bu-ist/bu-learning-blocks/maintainability)

## Getting Started
## About

### Local Environment
BU Learning Blocks (BULB) is a collection of Gutenberg blocks and WordPress Custom Post Types that enable the easy creation of academic lessons. With BULB you can facilitate online learning by embedding self-assessment questions directly into your lesson. Creating and publishing a BULB Lesson is no different than creating a standard WordPress Page. The plugin provides two key capabilities that are not provided by WordPress:

First, you need a WordPress Environment to run the plugin on. The quickest way to get up and running is to use the provided docker setup. Install [docker](https://www.docker.com/) and [docker-compose](https://docs.docker.com/compose/) by following the most recent instructions on the docker site.
- A set of blocks that help you add different types of self-assessment questions
- A way to order and navigate multiple Lesson Pages in a specific sequence

In the folder of your preference, clone this project and enter the working directory:
BULB is not a Learning Management System (LMS) and, currently, does not have typical LMS features such as scoring or timers. The objective of BULB is to improve learning and retention through in-line questions that reinforce the subject matter and allow students to test their understanding directly within the Lesson Page.

```bash
git clone [email protected]:bu-ist/bu-learning-blocks.git
cd bu-learning-blocks
```
BULB questions are inserted into the lesson content through the placement of blocks into the page editor. The questions are added and articulated in the WordPress block editor and are saved within the Lesson Page content. BULB does not add any tables to the WordPress database.

Then, run a setup script to check if docker and node are configured properly and starts the local WordPress instance. You may need to run this script multiple times if prompted.
BULB is compatible with WordPress 5.3.2 and above and the Gutenberg editor must be enabled.

```
./bin/setup-local-env.sh
```
## Installing and activating

If everything was successful, you'll see the following ascii art:
BULB can be installed and activated like any other WordPress plugin.

```
Welcome to...
######## ## ## ## ########
## ## ## ## ## ## ##
## ## ## ## ## ## ##
######## ## ## ## ########
## ## ## ## ## ## ##
## ## ## ## ## ## ##
######## ####### ######## ########
```
When activated, BU Learning Blocks presents a choice to install only the question blocks or both the question blocks and the BULB custom post type. BULB Question Blocks can be used on WordPress Posts or Pages, and on BULB Lesson Pages. If you wish to use the question blocks in your site content, but do not wish to create BULB Lessons, select “Install Blocks Only”.

The WordPress installation should be available at `http://localhost:8888` (username: `admin`, password: `password`).
Inside this repository, you can use any docker command to interact with your containers. If this port is in use, you can override it in your `docker-compose.override.yml` file.
The plugin can be activated and deactivated, no custom posts will be deleted. Deleting the plugin will cause all of the custom post type data to be deleted as well.

To bring down this local WordPress instance later run:
## Developing with BULB

```
docker-compose down
```
To get started developing the plugin, clone this repo and run `npm install`.

If you'd like to see your changes reflected in this local WordPress instance, run:
To compile working changes run `npm start`.

```
npm start
```

## Testing
This plugin also includes the [wp-env local development setup](https://www.npmjs.com/package/@wordpress/env).

### PHP Testing
If you have Docker installed, you can start a local WordPress Docker container to test the plugin. Run this:

Tests for PHP use PHPUnit as the testing framework. If you're using the built-in local environment, you can run the PHP tests locally using this command:

```
npm run test-php
```bash
npm run wp-env start
```

Code style in PHP is enforced using PHP_CodeSniffer. It is recommended that you install PHP_CodeSniffer and the WordPress Coding Standards for PHP_CodeSniffer ruleset using Composer. With Composer installed, run composer install from the project directory to install dependencies. The above npm run test-php will execute both unit tests and code linting. Code linting can be verified independently by running npm run lint-php.

To run unit tests only, without the linter, use npm run test-unit-php instead.
to initialize a local wp site container.

### Toggling WP_DEBUG
After starting, a new WordPress site with the plugin installed will be available at http://localhost:8888/

```
$ npm run enable-wp-debug
$ npm run disable-wp-debug
```
## BU React Questions

## Create Guten Block
BULB uses [BU React Questions](https://www.npmjs.com/package/@bostonuniversity/react-questions) to render the interactive question blocks. Changes to the front-end rendering of interactive questions must be made there.

This project was bootstrapped with [Create Guten Block](https://github.com/ahmadawais/create-guten-block).
BU React Questions is also a standalone package that can be used independently of BULB.
6 changes: 0 additions & 6 deletions bin/bootstrap-env.sh

This file was deleted.

134 changes: 0 additions & 134 deletions bin/includes.sh

This file was deleted.

47 changes: 0 additions & 47 deletions bin/install-docker.sh

This file was deleted.

94 changes: 0 additions & 94 deletions bin/install-node-nvm.sh

This file was deleted.

Loading

0 comments on commit 81ae533

Please sign in to comment.