Code Monkey home page Code Monkey logo

learn.co-commonmark's Introduction

learn.co-CommonMark

Specification and samples for learn.co flavored CommonMark.

We use learn.co-CommonMark when writing our quizzes.

For quiz templates, refer to quiz_template.md.
For sample quizzes, refer to samples/quizzes directory.

Quiz Specs

All quizzes should be built right inside your lesson README.md files. Quizzes are parsed by our custom quiz parser, which utilizes Redcarpet, a markdown parser. Quiz blocks begin and end with a triple question mark reserved character ???.

Below is a basic quiz template that summarizes all required quiz elements:

???

# Title

?: Question with one correct answer

( ) Answer 1
(X) Answer 2

?: Question with multiple correct answers

[X] Correct answer
[X] Another correct answer
[ ] Incorrect answer

???

Quiz Titles

The first h1 inside of the ??? ... ??? block is the title of the quiz. The title must have a newline above and below it. This h1 title is required; the quiz will not render properly without it.

Below the title, write any directions for the quiz. The text will be parsed as markdown and can accept codeblocks. Again, leave a newline space above and below the directions text.

Question Blocks

Questions are delineated by ?: followed by the question text. Include a newline between the question and the first answer choice.

?: Is this a question?

(X) yes
( ) no

You don't need to number your questions. This will be handled for you by our CSS once the lesson is rendered on Learn.

Answer Choices

Questions with one answer have ( ) to indicate the choices. These will be parsed into radio buttons.

Questions with multiple answers have [ ] to indicate the choices. These will be parsed into check boxes.

Answers are specified inline using an upcase X character inside parentheses: (X).

Do not include any newlines between your answer choices.

?: Can I select only one answer for this question?

( ) no
(X) yes

?: How many answers can I select for this question?

[X] 1
[X] 2
[X] all of them
[ ] I don't know, I didn't read the instructions.

Any standard markdown included as part of your question or answer choices will be parsed normally within quiz blocks.

?: Can I include **bold** text or `code` as part of my question?

(X) yes, you can use any markup, including code blocks.
```ruby
  def cool_method
    puts "remember: no spaces between code block and answer choices."
  end
`` `
( ) no

Note: The final answer choice delimits the end of a question. The parser expects the next character to either be the end of the quiz block ??? or a new question ?:, so do not include any additional material after your answer block. See the example below for further clarification.

?: Example question: What is 1+1?

This text here is ok.

( ) 3
(X) 2
( ) 1

This text down here is going to to break the quiz.

?: This question will not be parsed or rendered correctly.

( ) Broken
( ) womp womp

For sample quizzes, refer to samples/quizzes directory.

learn.co-commonmark's People

Contributors

ahimmelstoss avatar aviflombaum avatar ktravers avatar mikespangler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.