Assets
Assets are images or video files that are referenced in assignment files or notes. For example, you might add a screenshot of your software to show a user where to click. Or you may wish to show a video before your user starts a challenge.

Usage

Assets are currently a CLI-only feature.

Assignment and track markdown

All assets must be placed in a folder named assets located in the track root directory.
1
.
2
├── 01-title
3
│ └── assignment.md
4
├── assets
5
│ ├── image.png
6
│ └── video.mp4
7
├── config.yml
8
└── track.yml
Copied!
The example above shows an image file and a video file in the assets folder. Assets should be referenced using the relative path from the current directory. In the examples below the ../ means "Go up one directory and then into the assets subdirectory". You can also create nested folders inside the assets directory to keep them organized.

Embed an image in the assignment text

This example includes an image in the assignment.md sidebar text. This is useful when you want to show a screenshot or other image to your user as part of the challenge instructions.
1
---
2
slug: my-challenge
3
id: un6vygpcp3mj
4
type: challenge
5
title: My Challenge
6
tabs:
7
- title: Google tab
8
type: website
9
url: https://google.com
10
difficulty: basic
11
timelimit: 600
12
---
13
Hello there, assets!
14
15
![Image Description](../assets/image.png)
Copied!

Embed a video in a challenge note

In the example below we are embedding a video in a challenge note. See how the relative path is formatted on line 12 of the assignment.md file.
1
---
2
slug: title
3
id: un6vygpcp3mj
4
type: challenge
5
title: Title
6
tabs:
7
- title: Challenge title
8
type: website
9
url: https://google.com
10
notes:
11
- type: video
12
url: ../assets/video.mp4
13
difficulty: basic
14
timelimit: 600
15
---
16
17
See the video url on line 12 of this file.
Copied!

Embed an image in the track.yml description

In this example we're embedding an image in the track description. Note how there is only a single dot before the slash ./ which means the assets folder is in the current directory:
1
slug: my-new-track
2
id: 7gespmlsjdzq
3
type: track
4
title: Track Title Here
5
teaser: This is the best track ever!
6
description: |-
7
Want to put an image in your track description? It's easy:
8
![Image Description](./assets/image.png)
Copied!

Local and remote assets

When you run instruqt track push the relative paths to images and videos are converted to fully qualified URLs so they can be viewed in the sandbox by your learners. You don't need to worry about this when developing your markdown content locally.
For example, if your local track has this code in an assignment.md file:
1
![My Image](../assets/image.png)
Copied!
When you push the track, it is automatically converted to this:
1
![My Image](https://play.instruqt.com/assets/tracks/[TRACK_ID]/[ASSET_HASH]/assets/image.png
Copied!
When you pull a track, the long URLs are converted back into relative paths so you can preview your files locally.
Tip: You can install a Markdown plugin in your text editor to make it easy and fast to insert videos and images. The Markdown All in One plugin works well with Visual Studio Code. Just point the completion.root setting at your assets directory and it will show a handy autocomplete menu any time you start to insert image code in your markdown.

Access

Only learners who are currently playing a track can view track assets. Assets cannot be shared across multiple tracks.
Last modified 11d ago
Copy link
Contents
Usage
Access