Components of interactive exercises

Course Creation at DataCamp

Kelsey McNeillie

Instructor Success Manager

Exercise components

A diagram showing the different exercise components

Course Creation at DataCamp

Screenshot of coding exercise with context section highlighted

Course Creation at DataCamp

Screenshot of coding exercise with instructions section highlighted

Course Creation at DataCamp

Screenshot of coding exercise with hint section highlighted

Course Creation at DataCamp

Screenshot of coding exercise with script window highlighted

Course Creation at DataCamp

Screenshot of coding exercise with solution window highlighted

Course Creation at DataCamp

Writing good sample code

Sample code

# Open a file: file
file = open(____,
            mode='____')

# Print the file
____

# Check whether file is closed
____(file.closed)

# Close file
____.____()

Solution code

# Open a file: file
file = open('moby_dick.txt',
             mode='r')

# Print the file
print(file.read())

# Check whether file is closed
print(file.closed)

# Close file
file.close()
Course Creation at DataCamp

Using hotkeys

 

  • Sample and solution code must match
  • Use Teach hotkeys during editing

 

Hotkey Function
'ctrl' and 'h' (1x) Show hint
'ctrl' and 'h' (2x) Show solution

Sample code sample code.png

Solution code solution code.png

Course Creation at DataCamp

Screenshot of coding exercise with console highlighted

Course Creation at DataCamp

Screenshot of coding exercise with success message section highlighted

Course Creation at DataCamp

Let's start exercising!

Course Creation at DataCamp

Preparing Video For Download...