L17.P1: uncaught script errors when running this code
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- godot
- Área
- testing
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- GDScript
- Estrellas
- 2.8k
- Forks
- 237
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de GDQuest/learn-gdscript
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
GDQuest/learn-gdscript#1446 ·
-
user experience
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
GDQuest/learn-gdscript#1438 ·
-
user experience
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
GDQuest/learn-gdscript#1420 ·
-
Dificultad 3/5 Medio día Aptitud para principiantes 50/100
GDQuest/learn-gdscript#1445 ·
-
bug
Dificultad 3/5 1-3 horas Aptitud para principiantes 52/100
GDQuest/learn-gdscript#1444 · 1 comentario ·
Todos los issues de GDQuest/learn-gdscript
Issues similares
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug runtime
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
frostney/GocciaScript#1741 ·
Los mantenedores suelen responder en 1 día
-
agent-review-finding bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jordansmall/spindrift#5455 ·
Los mantenedores suelen responder en 1 día
-
curriculum documentation quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
githubnext/gh-aw-workshop#4673 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
dosemu2/dosemu2#3178 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día