Work on Video Challenges
A video challenge is a small section of a full-length video course on a particular topic. A video challenge page embeds a YouTube video. Each challenge page has a single multiple-choice question related to the video. A user must answer the question correctly before moving on to the next video challenge in the course.
The video challenge pages are created by members of the freeCodeCamp team. YouTube videos are also uploaded by members of the freeCodeCamp team.
Numbering Challenges
Section titled “Numbering Challenges”Every challenge needs an id. If you don’t specify one, then MongoDB will create a new random one when it saves the data; however, we don’t want it to do that, since we want the challenge ids to be consistent across different environments (staging, production, lots of different developers, etc.).
To generate a new one in a shell (assuming MongoDB is running separately):
- Run
mongocommand. - Run
ObjectId()command.
For example:
$ mongoMongoDB shell version v3.6.1connecting to: mongodb://127.0.0.1:27017MongoDB server version: 3.4.10...$ ObjectId()ObjectId("5a474d78df58bafeb3535d34")The result is a new id, for example, 5a474d78df58bafeb3535d34 above.
Once you have your id, put it into the markdown file as the id field at the top, e.g.
---id: 5a474d78df58bafeb3535d34title: Challenge TitleChallenge Template
Section titled “Challenge Template”Below is a template of what the challenge markdown files look like.
---id: Unique identifier (alphanumerical, MongoDB_id)title: Challenge Titlesidebar: label: Work on Video ChallengeschallengeType: 11videoId: 'YouTube videoId for video challenge'---
# --description--
Challenge description text, in markdown
```html<div>example code</div>```
# --transcript--
Transcript of the video.
# --question--
These fields are currently used for the multiple-choice Python challenges.
## --text--
The question text goes here.
## --answers--
Answer 1
---
Answer 2
---
More answers
## --video-solution--
The number for the correct answer goes here.Creating Questions for Video Challenges
Section titled “Creating Questions for Video Challenges”First, find the videoId.
For example, in the following code from the header of a video challenge markdown file, the videoId is “nVAaxZ34khk”. On GitHub, the information should be laid out in a table format.
---id: 5e9a093a74c4063ca6f7c14dtitle: Data Analysis Example Asidebar: label: "Work on Video Challenges"challengeType: 11videoId: nVAaxZ34khk---Next, access the YouTube video with that videoId. The URL for the video will be:
https://www.youtube.com/watch?v=[videoId] (replace videoId in the URL with the video’s ID - without square brackets)
In the example above, the URL is https://www.youtube.com/watch?v=nVAaxZ34khk
Skim the YouTube video with that videoId and think of a multiple-choice question based on the content of the video.
Question examples
Section titled “Question examples”# --question--
## --text--
What does this JavaScript code log to the console?
```jsconsole.log('hello world');```
## --answers--
hello _world_
---
**hello** world
---
hello world
---
## --video-solution--
3# --question--
## --text--
What will print out after running this code:
```pywidth = 15height = 12.0print(height/3)```
## --answers--
39
---
4
---
4.0
---
5.0
---
5
## --video-solution--
3