1.3.8 • Published 4 years ago

aiken-to-moodlexml v1.3.8

Weekly downloads
18
License
MIT
Repository
github
Last release
4 years ago

Aiken to MoodleXML

Build Status dependencies Status devDependencies Status License: MIT

This JS library parses Aiken quizzes into MoodleXML files.

Usage

import aikenToMoodleXML from 'aiken-to-moodlexml';
// ...
aikenToMoodleXML(aikenString, (result, error) => {
	if (error) {
		console.error(error);
	} else {
		console.log(result);
	}
}); 

Examples

On the server

import aikenToMoodleXML from 'aiken-to-moodlexml';
const fs = require('fs');
const path = require('path');

const xmlString = fs.readFileSync("/path/to/your/aiken/file.txt", 'utf8');

aikenToMoodleXML(aikenString, (result, error) => {
	if (error) {
		console.error(error);
	} else {
		console.log(result);
	}
}); 

On a JS SPA

import aikenToMoodleXML from 'aiken-to-moodlexml';
// ...
fetch("https://myweb.org/aiken.txt")
  .then(res=>res.text())
  .then(aikenString => {
  	aikenToMoodleXML(aikenString, (result, error) => {
  		if (error) {
  			console.error(error);
  		} else {
  			console.log(result);
  		}
  	}); 
});

Development

Commands

  • npm run clean - Remove lib/ directory
  • npm test - Run tests with linting and coverage results.
  • npm test:only - Run tests without linting or coverage.
  • npm test:watch - You can even re-run tests on file changes!
  • npm test:prod - Run tests with minified code.
  • npm run test:examples - Test written examples on pure JS for better understanding module usage.
  • npm run lint - Run ESlint with airbnb-config
  • npm run cover - Get coverage report for your code.
  • npm run build - Babel will transpile ES6 => ES5 and minify the code.
  • npm run prepublish - Hook for npm. Do all the checks before publishing your module.

License

MIT © Sonsoles López Pernas

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago