Repository navigation
feat: add a Study Hub button to visualize and trace code - #16
Merged
Merged
Conversation
Adds a 'Visualize and trace in Study Hub' link on the editor toolbar and on each visible test case. It opens the Study Hub tracer with the student's current code, and for a test case its input and expected output, so they can step through the run and see where it goes wrong. The data travels in the URL fragment, so it never reaches a server. Only what the student can already see is sent: hidden test cases get no link and solution code is never used. NEXT_PUBLIC_STUDYHUB_URL sets the Study Hub address (default https://studyhub.dcism.org).
Contributor
|
LGTM! This is a very helpful feature for students, making it easier to trace, understand, and visualize how their code executes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a "Visualize and trace in Study Hub" link to the problem page. It opens the Study Hub C tracer with the student's code already loaded, so they can step through it line by line and see their variables and data structures drawn.
How it looks
1. In CisCode. A submission fails the second test case. The button is on the editor toolbar, and each visible test case has a small icon (red on the failed one). The hidden test case has none.
2. In Study Hub, after clicking the icon on the failed test case. The tracer opens with the student's code, the test case's input and its expected output already filled in.
3. After pressing Run. The tracer shows where the output first differs: expected
1 2 4 6, got2 1 4 6.4. Stepping through. The student's own linked list is drawn as it is built. Here
1has been linked in after2, which is the bug.What Study Hub is
Study Hub (https://studyhub.dcism.org) is a free study site built by DCISM students and hosted on the DCISM server. It turns course material into practice the site can check, and it needs no account to use.
It covers Programming 1, Data Structures and Algorithms, Information Assurance and Security, Graph Theory and Automata Theory. Two of its tools are for C:
The tracer runs entirely in the student's browser. Their code is not uploaded anywhere.
Study Hub is maintained by Cris Lawrence Lucero (@lucerocris), Simon Gementiza (@saiimonn) and Niño Calunod (@noni-was-taken). It is a student project and not an official DCISM or CISCO service.
Why link the two
CisCode is where students write and submit solutions. When a test case fails, CisCode shows that the output is wrong but not where the program went wrong. This link takes the student's code and the failing test case straight into the tracer, where they can watch it run and find the line. CisCode stays the place to write code; Study Hub helps with reading and debugging it.
Where the link appears
What is sent, and how
#), so it is never sent to any server, CisCode's or Study Hub's.Configuration
NEXT_PUBLIC_STUDYHUB_URLsets the Study Hub address. It is optional and defaults tohttps://studyhub.dcism.org.Scope
src/lib/studyhub.ts, the problem page, the code editor, the test case and test case bar components, and.env.example.Testing