The DataCamp practice backend can currently not generate plots. That is why we use the MultipleChoiceChallenge exercise type to test a learner's understanding of syntax to generate plots.
Here's an example of an MC-code exercise on mobile:
And this is how that exercise looks on desktop:
Authoring an MC-code exercise
This section describes the syntax to write an MC-code exercise in the Teach editor. To learn about using DataCamp's Teach editor to create practice content, take a look at this article.
An MC-code exercise uses the MultipleChoiceChallenge template in the Teach editor. Read this article to understand how the MultipleChoiceChallenge template looks and works.
To test the learner's knowledge of plotting syntax, consider the MC-code exercise as a variant of the BlanksChallenge: you will present the learner with a piece of code in which a key-word is replaced by a blank. The learner needs to select the missing keyword from the presented options.
The assignment block of an MC-code exercise contains following elements:
- the actual assignment:
Fill in the blank to produce the plot.,
- the code required to create the plot with the relevant keyword replaced by triple underscore, flanked by triple back ticks to indicate code block formatting, and
- the link to the resulting plot, which you generated locally and uploaded via the Teach Assets tab (step-by-step instructions).
Here's how the assignment block of the example MC-code exercise looks like:
The options block will include the correct keyword, along with relevant distractors, all formatted as code using single back ticks. The correct keyword is wrapped in square brackets (
] ). Here's how the option block of the example MC-code exercise looks like:
Now that you've seen the details of creating an MC-code exercise, take another look at the examples provided at the beginning of this article. Do you see how the described syntax leads to the exercise?
Now it's your turn: head over to the Teach editor and make some challenging MC-code exercises for your Practice pool!