L17.P1: uncaught script errors when running this code
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- godot
- Domain
- testing
Research direction
Start by reproducing the bug: type cell = cell.y + 1 in the L17.P1 practice and check whether the SCRIPT ERROR lines appear in the output while the test still passes. The error path runs through ui/UIPractice.gd (_test_student_code around line 611, _run_if_valid around line 930) and script_checking/PracticeTester.gd (run_tests around line 72), with the failing test at course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd line 20. Done means a runtime script error during student code makes the practice fail with a visible message, and the test no longer passes.
Written by the indexing model from the issue text.
Description
Running the following code raises script errors that are currently not captured by the testing system:
L17.P1 I can type 'cell = cell.y + 1' rather than 'cell += Vector2(0, 1)' and the robot will not move on screen, but the practice will tell me I have succeded and the robot is on the last row.
Technical information:
- Location: L17.P1 - Introduction to For Loops > Using a for loop to move to the end of the board
- File: res://course/lesson-18-for-loops/lesson.bbcode
- Platform: Web
- Commit: edde160
Code from the current practice
var board_size = Vector2(5, 5) var cell = Vector2(2, 0) func move_to_bottom(): for number in range(board_size.y - 1): cell = cell.y + 1
Godot does raise errors in the script, but instead of being caught by the practice system like with almost all other script errors, they go to the output and the code attempts to run; in turn this abort execution of various functions and allows the practice to pass.
SCRIPT ERROR: Invalid access to property or key 'y' on a base object of type 'float'.
at: move_to_bottom (gdscript://-9223371198983825982.gd:35)
GDScript backtrace (most recent call first):
[0] move_to_bottom (gdscript://-9223371198983825982.gd:35)
[1] _run (gdscript://-9223371198983825982.gd:19)
[2] _run_if_valid (res://ui/UIPractice.gd:930)
SCRIPT ERROR: Invalid assignment of property or key 'cell' with value of type 'float' on a base object of type 'Node2D (robot_l17_p1.gd)'.
at: _run (gdscript://-9223371198983825982.gd:20)
GDScript backtrace (most recent call first):
[0] _run (gdscript://-9223371198983825982.gd:20)
[1] _run_if_valid (res://ui/UIPractice.gd:930)
SCRIPT ERROR: Invalid access to property or key 'y' on a base object of type 'float'.
at: test_robot_gets_to_bottom_of_board (res://course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd:20)
GDScript backtrace (most recent call first):
[0] test_robot_gets_to_bottom_of_board (res://course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd:20)
[1] run_tests (res://script_checking/PracticeTester.gd:72)
[2] _test_student_code (res://ui/UIPractice.gd:611)
[3] _on_autotimer_timeout (res://ui/UIPractice.gd:870)
- Dominant language
- GDScript
- Stars
- 2.8k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GDQuest/learn-gdscript
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
GDQuest/learn-gdscript#1446 ·
-
user experience
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
GDQuest/learn-gdscript#1438 ·
-
user experience
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
GDQuest/learn-gdscript#1420 ·
-
bug user experience
Difficulty 3/5 1-2 days Newbie friendliness 55/100
GDQuest/learn-gdscript#1449 ·
-
Consider adding SFXOpenuser experience
Difficulty 4/5 3-5 days Newbie friendliness 30/100
GDQuest/learn-gdscript#1448 ·
All issues in GDQuest/learn-gdscript
Similar issues
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue tools
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
biomejs/biome#12475 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
huggingface/peft#4019 ·
Maintainers usually reply within 1 day
-
heic-converter: decodeHeic replaces Sharp's 422 verdict with a 503 when CLI HEIF decoder is missingOpenarea: backend area: image-engine bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
snapotter-hq/SnapOtter#2895 ·
Maintainers usually reply within 1 day