Save
This commit is contained in:
parent
e1e7c70147
commit
309bbcac5e
12 changed files with 57 additions and 9 deletions
|
|
@ -3,7 +3,7 @@ extends Control
|
|||
var current: int = -1
|
||||
|
||||
func _ready() -> void:
|
||||
for question in ReactionRegistry.current_lab.tests:
|
||||
for question in LabRuntime.current_lab.tests:
|
||||
var options = question.options.duplicate()
|
||||
options.shuffle()
|
||||
var vbox = VBoxContainer.new()
|
||||
|
|
@ -11,11 +11,12 @@ func _ready() -> void:
|
|||
description.text = question.question
|
||||
vbox.add_child(description)
|
||||
vbox.visible = false
|
||||
for option in options:
|
||||
for i in range(len(options)):
|
||||
var button = Button.new()
|
||||
button.text = option
|
||||
button.text = options[i]
|
||||
vbox.add_child(button)
|
||||
button.pressed.connect(next)
|
||||
button.pressed.connect(anwser.bind(i))
|
||||
add_child(vbox)
|
||||
next()
|
||||
|
||||
|
|
@ -28,3 +29,8 @@ func next() -> void:
|
|||
if current < get_child_count() - 1:
|
||||
current += 1
|
||||
get_child(current).visible = true
|
||||
else:
|
||||
get_parent().visible = false
|
||||
|
||||
func anwser(option: int):
|
||||
LabRuntime.anwsers.append(option)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue