i insert inside 40 elements array
what do you mean by that? are you setting the default values or something?
in any event ill post a screen shot of the second method i mentioned which will probably work better for you case since it will avoid the possibility for any loops.
so in the below method you basically create a list of all questions on construct then each time you use a question you remove it from the list. this is the opposite of the previous method where you were creating a list of used questions. ok so how this works is when the widget is created it gets all the row names of the datatable and stores them in an array, then we get a random index from that array and set it as the current row name (the one we will be using for the current question). we then remove that name from the array so it cannot be asked again. this method requires all the names to be unique (because i used the remove node) but this isnt a issue since all row names in a datatable have to be unique anyways. each time you run this script the array will become shorter, since we are using the last index which is not a set index this wont be an issue either (last index will always be recalculated when called).
hopefully that helps and gets you past the issues you were having.