thepieterdc / dodona-plugin-vscode

Plugin for Visual Studio Code to submit exercises to Dodona.
MIT License
5 stars 5 forks source link

[BUG] Single-line exercises not possible due to exercise link #720

Closed Prozilla closed 1 month ago

Prozilla commented 1 month ago

Description

Single-line shell script exercises can't be submitted via the vscode plugin using the vscode editor, because it requires a comment with a link to the exercise on the first line. This first line is evaluated as part of the shell script in Dodona, making the command invalid and making the exercise always fail.

Expected Behavior

/* https://dodona.be/nl/courses/4165/series/46398/activities/578459704 */
/* https://dodona.be/nl/courses/4165/series/46398/activities/578459704 */

echo "Hello world!"

Actual Behavior

/* https://dodona.be/nl/courses/4165/series/46398/activities/578459704 */

echo "Hello world!"

Alternative

echo "Hello world!"

Steps to Reproduce

  1. Start any shell exercise that expects the solution on a single line
  2. Try to submit with/without the comment with the link to the exercise in the editor

Proposed solutions

Environment

BTWS2 commented 1 month ago

This is similar to https://github.com/thepieterdc/dodona-plugin-vscode/pull/252.

Does this code work on Dodona? If so, can you make a PR (src/util/comments.ts)?

# https://dodona.be/nl/courses/4165/series/46398/activities/578459704

echo "Hello world!"
Prozilla commented 1 month ago

That snippet works, I will try to make a PR

Beaness commented 1 month ago

Is the bash programming language defined as "bash" or "sh"? (this is needed for the comment mapping)

BTWS2 commented 1 month ago

If I remember correctly, you can base yourself on this: https://dodona.be/nl/programming_languages/

image

This is the information about the mentioned exercise: image