Skip to content

Instantly share code, notes, and snippets.

@vwxyzh
Last active February 23, 2018 02:09
Show Gist options
  • Save vwxyzh/d536fd09e68c577298b0c0f9c6d47679 to your computer and use it in GitHub Desktop.
Save vwxyzh/d536fd09e68c577298b0c0f9c6d47679 to your computer and use it in GitHub Desktop.
  1. What this markdown file talking about:

    • Brainstorming of markdown file format for quiz.
    • Finallize the spec.
    • Anything about Quiz Service
  2. Can quiz support multi-choice and single-choice?

    • For multi-choice, it is supported natively, this is a sample.
    • For single-choice, we try to check whether only one choice is checked.
    • Single/multi-choice with hint is opening.
  3. Can this format handle code block or images like following?

    Code!
    
    • Yes, you can do it.

    • And you can create it in answers like this:

      Code!!!!
      
    • No.

  4. Can it support explanation?

    • We do not talking about this extension yet.

    • Maybe it looks like this one.

      :::feedback

      Some explanation for this choice.

      :::feedback-end

    • This is opening by now.

  5. What the advantage of this format for quiz?

    • Easy to preview on GitHub site.
    • Reuse current syntax supported in markdig.
    • Support code or images natively.
    • Support multi-choice natively.
    • No work for localize.
    • No work for build
  6. What is the work flow?

    • OPS Build read this markdown file (no work).

    • OPS Build parse the content to AST (little work).

    • OPS Build transform the AST to quiz model (very like markdown fragment).

    • OPS Build submit model to DHS (in json format).

      {
        "quiz_id": "some id",
        "commits": "12345678",
        // other properties
        "questions": [
          {
            "question_id": 1,
            "question": "<html>for question</html>",
            "choices": [
              {
                "choice_id": 1,
                "correct": true,
                "choice": "<html>for choice 1<html>"
              },
              {
                "choice_id": 2,
                "correct": false,
                "choice": "<html>for choice 2<html>"
              }
            ]
          },
          // ...
        ]
      }
    • Quiz Service read the model and extract useful information.

    • Rendering read from DHS or Quiz Service (opening).

@fenxu
Copy link

fenxu commented Feb 12, 2018

About question 6, 1~4 can be done in build, so the notification and report are already implemented.

@OsmondJiang
Copy link

bettert to add question id and choice id to make the mapping clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment