Skip to content

imbus/quizdown-extended

 
 

Repository files navigation

quizdown

Markdownish syntax to instantly create simple interactive quiz apps for your static website.

I'm working on this project in my free time to learn more about modern web development and languages. This is a toy project and should not be used in serious projects for now.

  • supports markdown text formatting, images, syntax highlighting and math rendering.
  • different quiz-types: single-choice, multiple-choice, sequence.
  • support for hints and explanations.
  • options for color theme, question shuffling, localization.
  • can be easily included in any website, static site generator or other web projects.
  • mobile friendly with touch support for all question types.

Usage

quizdown is easy to setup and best used in combination with existing static site generators like Jekyll, Hugo or Sphinx. Check out the extensions hugo-quiz and sphinxcontrib-quizdown.

Stand-alone Example

To keep the bundle size low, syntax highlighting and math rendering are implemented in separate extensions that can be loaded and registered manually if needed:

<head>
	...
    <script src="./build/quizdown.js"></script>
	<script src="./build/extensions/quizdownKatex.js"></script>
	<script src="./build/extensions/quizdownHighlight.js"></script>
	<script>
		quizdown.register(quizdownKatex).register(quizdownHighlight).init();
	</script>
	...
</head>

Write questions within a quizdown class (edit in the 🚀quizdown editor):

...
<div class="quizdown">
	---
	primaryColor: steelblue
	shuffleQuestions: false
	shuffleAnswers: true
	---

	### Select your superpowers!

	- [ ] Enhanced Strength
	- [ ] Levitation
	- [x] Shapeshifting

	### What's the capital of Germany?

	> Hint: The _largest_ city in Germany...

	1. [x] Berlin
	1. [ ] Frankfurt
	1. [ ] Paris
	1. [ ] Cologne
</div>
...

Register a new language

You can register a new language that is supported by highlight.js with

// Parameters: name of the language, hljsDefineRobot-method
quizdownHighlight.registerHljsLanguage("robot", hljsDefineRobot);

Set the theme for hljs

You can change the highlight.js with

// Parameters: the path/url the the theme
quizdownHighlight.setTheme("https://cdn.jsdelivr.net/npm/[email protected]/styles/github.css");

Contributing

Pull requests and feature requests are welcome. For major changes, please open an issue first to discuss what you would like to change. I'm happy for any feedback on how to improve the code base.

Wish List

  • support for videos via youtube api (bonartm#10)
  • customizable reward page at the end of the quiz (bonartm#14)
  • fill in the blanks quiz (bonartm#17)
  • link quizzes on different pages together via a results summary page (bonartm#18)

How To

After cloning, install the packages with

npm install

Build the library with

npm run build

You can also preview a live version with

npm run dev

Credits

Inspired by the mermaid library and the python package quizdown.

About

Markdown syntax for generating interactive quizzes in the browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Svelte 47.1%
  • TypeScript 41.1%
  • HTML 7.5%
  • JavaScript 4.3%