parsons-prakhar
v1.0.5
Published
This is a server side rendered implementation of OpenDSA/Parsons. This implementation consumes the [Parsons Problem Input Format (PIF)](https://docs.google.com/document/d/1ZzEgS4_2SyS88fhWVp0041KmfWFnXBKgMWmPEDI7chw/edit?usp=sharing) an extension of [PEML
Readme
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
- Clone the repo
git clone https://github.com/OpenDSA/Parsons.gitFor Development
- Install dependencies
npm install Server-side development
- Run server
node server/index.js OR (for hot reloads on save)
nodemon server/index.jsThe 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 .envClient-side development
- Client-side code can be found in
./src. This code is bundled with webpack into the./publicdirectory with the command below.
npx webpack --config webpack.config.jsNB: Remember to bundle when changes are made so they are served to the browser.
For Production
docker compose upUsing 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();