Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normal code blocks #59

Closed
4 tasks
kenpower opened this issue Nov 16, 2022 · 4 comments
Closed
4 tasks

Normal code blocks #59

kenpower opened this issue Nov 16, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@kenpower
Copy link

kenpower commented Nov 16, 2022

Need to add some source code to the questions. So would like to preserve the original meaning of ```

Need a question that looks like:

==========================
Question 42: What does the following program output?

void main(){
    std::cout << "Hello";
}
  • "Hello"
  • "GoodBye"
  • Empty string
  • None of the above
@gpoore
Copy link
Owner

gpoore commented Nov 16, 2022

You want something like this:

42. What does the following program output?

    ```
    void main(){
        std::cout << "Hello";
    }
    ```

[*] "Hello"
[]  "GoodBye"
[]  Empty string
[]  None of the above

@kenpower
Copy link
Author

kenpower commented Nov 16, 2022

Ah no! I've wasted so much time on this.

@gpoore your example works for me. Thanks.

The backticks need to be indented 4 spaces. (my backticks had no indent or 2 space indent). I'm so used to github markdown.

@gpoore
Copy link
Owner

gpoore commented Nov 16, 2022

You probably want to think about the plain text format for quizzes as a wrapper around Markdown. Each individual chunk of text (question, answer, feedback, etc.) is Markdown. But the outermost level of text (no indent) is the text2qti plain-text quiz format. So the 42. is a number indicating a question in text2qti format, and then the content of the question is (indented) Markdown. And [] indicates a choice, and the choice itself is (indented) Markdown. The fact that the Markdown is indented is only really more visible when multiple lines are involved. The indentation doesn't have to be 4 spaces, it just has to be the same for the whole chunk of text that makes up each element of a question.

@kenpower
Copy link
Author

I didn't read this section carefully enough. Maybe a code block example there would be helpful.

I think the line in the section on executable blocks :"The code block fences (```) must not be indented; " also threw me off.

@gpoore gpoore added the documentation Improvements or additions to documentation label Oct 28, 2023
@gpoore gpoore closed this as completed in f383b99 Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants