Hi Doti, Unfortunately I'm unable to get the code you suggested to work.
This is what I have tried,
def slaveChoice = null def slaveChosen = null def question = null def Image = null def correct = 0 def wrong = 0 def Q = null def QArray = null def A = null
def data = [ ["Q":"What is the year of the copyright of the image", "QArray":["2007", "2008", "2009", "2010", "2011"], "A":"2009", "Image":"1"], ["Q":"How many rings was the girl wearing?", "QArray":["1", "2", "3", "4", "5"], "A":"2", "Image":"2"], ["Q":"What is the correct one?", "QArray":["A", "B", "C"], "A":"B", "Image":"3"], ["Q":"How many tatoos does the girl have?", "QArray":["0", "1", "2","3", "4"], "A":"2", "Image":"4"], ["Q":"How many piercings does the girl have?", "QArray":["0", "1", "2","3", "4"], "A":"3", "Image":"5"], ["Q":"What color was the ballgag she's wearing?", "QArray":["Red", "Blue", "Green","Black", "White"], "A":"Green", "Image":"6"], ["Q":"What is the correct one?", "QArray":["A", "B", "C"], "A":"C", "Image":"7"], ["Q":"How many chothespins are punishing her breasts?", "QArray":["5", "6", "7", "8", "9"], "A":"7", "Image":"8"], ["Q":"What was written on the paper that she's holding?", "QArray":["121", "212", "222", "112", "211"], "A":"212", "Image":"9"], ["Q":"Wich one is correct?", "QArray":["A", "B", "C"], "A":"B", "Image":"10"], ]
//set data
question = getRandom(data.length) Q=data[question]["Q"] QArray=data[question]["QArray"] A=data[question]["A"] Image=data[question]["Image"]
// an image is then shown for a few seconds on screen and then the question is asked.
slaveChoice = getSelectedValue(""+Q+"", QArray) slaveChosen = QArray[slaveChoice] if (slaveChosen == A) {correct = correct +1} else {wrong = wrong +1}
The error I get is refereed to question = getRandom(data.length) statement and is:
Error in simulation (maybe not a real error) groovy.lang.MissingMethodException: No signature of method: ss.FullScript_teaseortorture_HaileysTeaseorTortureCopy.getRandom() is applicable for argument types: (ArrayList) values: [[null, null, null, null, null, null, null, null, null, null]] Possible solutions: getRandom(double), getRandom(java.lang.Integer)(@ line 329)
Do you have any ideas?
Thanks Taylor
|