Skip to content

OpenDSA/Parsons

Repository files navigation

Parsons

This is a server side rendered implementation of OpenDSA/Parsons. This implementation consumes the Parsons Problem Input Format (PIF) an extension of PEML.

How to run

  1. Clone the repo
git clone https://github.com/OpenDSA/Parsons.git

For Development

  1. Install dependencies
npm install 

Server-side development

  1. Run server
node server/index.js 

OR (for hot reloads on save)

nodemon server/index.js

The homepage will be served at http://localhost:3000/parsons/ by default. To use a different port set PORT in the environment to the desired one.

OR Copy .env.example and edit as desired

cp .env.example .env

Client-side development

  1. Client-side code can be found in ./src. This code is bundled with webpack into the ./public directory with the command below.
  npx webpack --config webpack.config.js

NB: Remember to bundle when changes are made so they are served to the browser.

For Production

docker compose up

Using as an npm package

const { parsePIF, loadParsonsBundle } = require('parsons');

// Server helpers work in plain Node
await parsePIF('github', 'example.peml');

// Browser-only bundle: requires window/document (e.g., in the browser or after setting up JSDOM)
const Parsons = loadParsonsBundle();

About

Support for Parsons Problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages