Work on your vy.tools coding challenges in VS Code, then save and submit them for grading without leaving the editor.
- Save and submit from the status bar. Two buttons, VySave and VySubmit, send your work to vy.tools.
- See your score. After you submit, the VySubmit button shows your score when grading finishes.
- View results.
.vy.html files open as interactive visualizations of your challenge, and they update when you run your code.
- Works in the browser too. It runs in desktop VS Code and in browser-based VS Code such as GitHub Codespaces.
Video tutorials for setup and use are at vy.tools.
Getting started
- Get the challenge. Either:
- in VS Code, run Get Challenge from vy.tools from the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on a Mac). Log in to vy.tools if asked, pick your class, the challenge and a folder to put it in, and vylink downloads it and opens it. It starts the challenge on vy.tools for you if you haven't yet. Running it again on a challenge you already have lets you open your copy or download it again (your last save on vy.tools), or
- on the challenge's page on vy.tools, initialize the challenge, click Download Challenge and unzip the
.tar.gz file, then open that folder in VS Code (File → Open Folder…), or
- click Open in Codespaces to get a ready-to-use copy in your browser. You'll need a GitHub account.
- Install vylink if VS Code hasn't already. Search for vylink in the Extensions view. Codespaces installs it for you.
- Write your solution. The files you need to edit open automatically.
- Click VySave or VySubmit in the status bar at the bottom of the window. The first time, a browser tab opens so you can log in to vy.tools:
- Desktop VS Code: after you log in, click Link with VS Code, and VS Code connects on its own.
- Browser VS Code (Codespaces): after you log in, copy the code vy.tools shows and paste it into the box that opens in VS Code.
You stay logged in. You only need to repeat this if you disconnect or your session expires.
Saving and submitting
| Button |
What it does |
| VySave |
Saves your files to vy.tools without grading them. Use it to back up your work or to switch computers. |
| VySubmit |
Saves your files and sends them for grading. The button shows a spinner while grading runs, then your score. |
| VyUpdate |
Appears when the challenge has a configuration (vycnfig.json). Click it to replace vycnfig.json with your instructor (or group leader)'s current configuration, for example after they change the course. The .vy.html's Revert button then goes back to this configuration too. This also deletes vyrslts.json, your local results, so vylink asks you to confirm first. |
- Resubmitting can replace your current score. If it would, vylink asks you to confirm first.
- After the due date you can no longer save or submit. You'll see a message saying the challenge is past due.
Results viewer (.vy.html files)
Opening a .vy.html file shows the challenge's visualization instead of HTML source. It reads:
vyrslts.json, the results written when you run your code, and
vycnfig.json, the challenge settings, if there are no results yet.
The view updates automatically when either file changes. Results take priority, so whenever vylink writes vycnfig.json (the view's save button, or VyUpdate) it deletes vyrslts.json so the new settings show. To reload it by hand, click the refresh icon in the editor title bar, or run Refresh Vy Preview from the Command Palette.
For instructors or group leaders: viewing a student's files
If you own the class, or are an assistant in it, a VyStudents button appears in the status bar when you open your own download of one of its challenges. If you were made an assistant after downloading, download again to get the button, or run View a Student's Files from the Command Palette.
- Click VyStudents and pick a student. The list shows each student who has started the challenge, with their language and score.
- vylink copies that student's files, as they last saved them to vy.tools and in their language, into
.vystudents/<username>/ in your folder, then opens them.
The copy is read-only as far as vy.tools is concerned. Changes you make there stay on your computer, and VySave and VySubmit still only send your own files. Fetching the same student again replaces the copy, so vylink asks first. The .vystudents folder is kept out of git, so student code is never committed to your repository (for example in Codespaces).
To run or debug the student's code with their own tasks and launch settings, right-click their folder in the Explorer:
- Add Student Folder to Workspace shows it next to your folder in the same window. This works in desktop VS Code and Codespaces.
- Open Student Folder in New Window opens it on its own. This is only available in desktop VS Code.
Commands
Open the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on Mac) and type "vy":
| Command |
Description |
| Get Challenge from vy.tools |
Pick one of your classes and challenges, and vylink downloads it into a folder you choose and opens it. Works from an empty VS Code window. |
| Save Challenge Files |
Same as the VySave button. |
| Submit Challenge Solution |
Same as the VySubmit button. |
| Update vycnfig.json to the Instructor's (or Group Leader's) Configuration |
Same as the VyUpdate button. |
| View a Student's Files |
Same as the VyStudents button. See For instructors/group leaders. |
| Refresh Vy Preview |
Reloads the open .vy.html view. |
| Disconnect from vy.tools |
Logs this VS Code out of vy.tools. You'll log in again the next time you save or submit. |
When does vylink turn on?
vylink only activates in a folder that contains a .vytool.json file (vy.tools adds one to every challenge download), when you open a .vy.html file, or when you run Get Challenge from vy.tools. It does nothing in your other projects.
Troubleshooting
| Message |
What to do |
| Open a folder containing .vytool.json |
Open the challenge's top-level folder itself, not a folder above or inside it. |
| Your local code is outdated |
Your instructor or group leader updated the challenge. Download it again, or click Open in Codespaces again, then copy your work over. |
| Session expired. Please log in again. |
Click VySave or VySubmit to log in again. |
| Could not save/submit challenge. Are you offline? |
Check your internet connection and try again. |
| Cannot be re-submitted until current submission complete |
Wait for the current grading run to finish. |
| Nothing happens after you log in, in desktop VS Code |
Go back to the vy.tools tab and click Link with VS Code again. Your browser may ask for permission to open VS Code. |
Requirements
- VS Code 1.63 or later, desktop or browser
- A vy.tools account and a challenge from your instructor (group leader)
- To run your code locally, the language tools for your challenge (for example Python or a C++ compiler). Challenges also include a Dev Container configuration, so with Docker and the Dev Containers extension you can choose Reopen in Container to get an environment with the challenge's tools already installed.
| |