Using MarkDown in GIFT Moodle Questions

Is there a way to use fixed width MarkDown code blocks in a quiz question?

I write my quiz questions in my text editor in GIFT format and then import them into my quiz pool. GIFT format is very fast and compact, and this method allows me to develop questions without Internet access.

However I am struggling with the use of MarkDown text format in the quiz questions. The docs say it is supported.

The problem is that GIFT does not allow lines to appear in the middle of a question, but MarkDown relies on new lines to mark up blocks of code. For example, I would like to ask the following question:

::Finding bugs::
[markdown] Consider the following code:

    x=5;
    if x=5
        disp("It worked!")
    else
        print('Uh oh!')
    done

On which lines do bugs occur? Answer in the form [1,2,3]. 
{
=[2,3,5,6]
}

      

This is not imported properly because GIFT format disallows newlines in the quiz question. But I am unable to remove new lines because MarkDown does not recognize the block of code.

Thoughts? Thank!

+3


source to share


1 answer


(Answering my own question) This seems to work:

::Finding bugs::
[markdown]
Consider the following code\:\n
\n    x\=5;
\n    if x\=5
\n        disp("It worked!")
\n    else
\n        print('Uh oh!')
\n    done
\n\n\n
On which lines do bugs occur? Answer in the form [1,2,3].
{
        =[2,3,5,6]
}

      



Notice the four spaces between each \ n and the code. Ugh.

+2


source







All Articles