Skip to content

initial spec for how content should be defined for problems / tests

Notifications You must be signed in to change notification settings

mottaquikarim/spectacles

Repository files navigation

Build Status Maintainability Test Coverage

^ Deployed app - however will only really work for collaborators. Pls open an issue if interested in contributing to the content for this repo!

Spec and scripts for generation of practice problems.

Purpose

Although there are many independent schools teaching software development, there are few consistent formats for the creation and consumption of programming practice problems.

Spectacles is a series of scripts and a simple Express server that enforces a predefined spec for practice problem generation. It also provides a UI for quickly and easily creating this content and the required unit tests for the content itself.

Through Spectacles, we are asserting a specification for how practice problem content can and should be created. Ideally, if this spec if followed and Github is used as a single source of truth for all practice problem content, it can and would be trivial to write multiple clients that consume this data for various purposes.

For instance, on the student-facing side, we can write homework / curriculum generation services that draw on this spec to reliably pull in practice content, parse it and do whatever is necessary as required by business logic.

Additionally, having a strongly formal spec can allow others (ie: a coding school in Guatemala) to draw from this content and build custom client implementations that fit their needs, which could be different from our use cases.

Usage

Clone this repo

$ git clone https://github.com/mottaquikarim/spectacles && cd spectacles

CD into /app and run npm install

$ cd app/ && npm install

Running tasks

Run npm run-script new-problem to create new problem

$ npm run-script new-problem

Should create a /content repo with subfolder, .contentrc, etc

Running Server

Run npm run-script run-app

$ npm run-script run-app

In browser, navigating to:

http://localhost:3000/content/${UUID}

would display JSON result of file contents if directory exists.

From terminal, CURLing:

curl -X POST "http://localhost:3000/content/${UUID}" -H "Content-Type: application/json" -d '{"prompt.js": "test"}'

Would update the prompt.js key to test in file system.

When happy with content, simply git push to commit to SCM and allow others to use as well.

Example

First,

$ npm run-script run-app

(There is a pre-made one committed as of now)

In browser, go here. Expect the following:

scrn1

Click on Run on top right hand corner. Expect the following:

scren2

About

initial spec for how content should be defined for problems / tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published