library(knitr) opts_chunk$set(eval = FALSE)
You're welcome to give your students the exercises that we built in, but you probably want to offer your own in-class exercises. Here are simple instructions for uploading up your own quiz within SocraticSwirl, so that your students can take it.
First, make sure you've signed in with socratic_swirl_login
(or created an instructor account with socratic_swirl_signup
if you haven't already).
Exercises are created in SocraticSwirl the same way they are created for Swirl. Here you can read in detail about creating interactive exercises using the "swirlify" tool. In short, quiz questions are structured as YAML files, in a form something like this:
- Class: cmd_question Output: Now store the contents of the 'cars$mpgCity' in a new variable called 'myMPG'. CorrectAnswer: myMPG <- cars$mpgCity AnswerTests: newcmd=myMPG <- cars$mpgCity Hint: Use the assignment operator to assign 'cars$mpgCity' to a new variable called 'myMPG'.
Alternatively you could write a multiple choice question:
- Class: mult_question Output: Mean, median, and mode are all measures of ____________. AnswerChoices: variation; significance; deviation; central tendency CorrectAnswer: central tendency AnswerTests: word=central tendency Hint: This is a fancy term for the "middle" of a dataset.
Note: in regular Swirl, questions are usually interspersed with text paragraphs and demonstrations. This is probably not the right approach for a set of SocraticSwirl exercises, since your students will be taking them in your class. Instead, make each of your items a question (either multiple choice or command-based).
Now you've created one or more lessons in your course, which you put into a directory called my_course
. Suppose it has one lesson in it, called my_lesson
. Time to upload it!
upload_course("my_course")
Your students can then install and take your lesson with the following line of code. Make sure they include the instructor username in the function, which allows you to view the results.
socratic_swirl("my_lesson", "my_course", instructor = "your_username")
Then to view the results in real-time, simply run the dashboard and select that course:
dashboard()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.