2017-02-04 19:35:44

Hi guys.
I hope you can help me: I want to code something in bgt and I read the bgt tutorial, but can't come to a solution.
Here is an example which I want to put into code:
{Question: What is 2+2?
(press return, a field pops up with the following information)
Please write the answer.
(now a field pops up where you have to enter the correct answer, when finished, press return)
(here comes the solution)
1. That's right, the answer was 4.
2. Sorry, your answer was wrong. The right answer was 4.
}
Hope someone can help me to put this thing into code.
Thanks in advance!

2017-02-04 19:41:08

I'm pretty sure there are examples for such things in the tutorials, but input boxes are handeled by the input_box function which you can find somewhere in the function refference, no idea where though.

I used to be a knee like you, then I took an adventurer in the arrow.

2017-02-04 22:10:27

Thank you!

2017-02-05 07:28:15

Hi,
I threw together an example in less than 10 minutes. Please let me know if this helps. This has been commented quite a bit throughout so it shouldn't be too hard to follow.
https://www.dropbox.com/s/ih8woni4lbeja … e.bgt?dl=1
Save it, and open it in your preferred text editor.
Hope this helps.

2017-02-05 09:24:02

@Omar Alvarado
Thank you for your help. I already downloaded it and tested this.
I have another question: I know how to put two or more imput_boxes together. How is it possible to mix those boxes?
example:
normal: imput_box 1, imput_box 2, imput_box 3, ...
mixed: imput_box 3, imput_box 1, imput_box 2, ...
How to program this one?
Thanks in advance!

2017-02-06 19:44:14 (edited by Saman 2017-02-06 19:45:59)

hello, you should use string to numbers, something like the below example.  You can download this file from the link below
:
http://s000.tinyupload.com/index.php?fi … 9630836300
best regards
hope i could help.

2017-02-06 21:08:19

Thanks, you helped me.

2017-02-17 23:08:42

@omar Nice example, although its pretty common practice to use string_to_number and convert that string. Otherwise, you could be attempting to complete numeric operations with text, and that obviously wouldn't go over very well