agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq,
agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq ,
dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu
http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan
BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama
Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga
BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai
Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah
Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai
Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs
Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games
Comments
Hi @Soan,
If I understand you well, you want to be able to sort the responses produced by the participant.
Starting from the task example in another thread (https://forum.cogsci.nl/discussion/7816/can-i-show-keyboard-response-to-the-participant#latest), I modified slightly the code.
First, I noticed that in the example I posted earlier, while it worked well when participants pressed letters (or at least started with a letter), a problem occurred when they pressed only digits. THis is because Open Sesame then automatically treats the variable as a numerical one, so that when we try to concatenate the responses (e.g., "1", "2", "3") we get "6" (1+2+3) instead of "123". I fixed that with a small modification of the
concatenate_responses
code:The change consists in adding
vars.response.toString()
instead ofvars.response
tovars.concatenated
.Now on to the issue of sorting the responses in ascending order.
There are certainly several ways to do that but one simple way is to transform the
vars.concatenated
variable into an array (that is, a variable with distinct elements). and to make use of the.sort
function available in Javascript.I inserted the code after the loop where the three responses have been collected:
Here is the code:
The first part is where I declare the array as a string first and then put the content of the vars.concatenated into it (taking the string value of it). I then split the array (so that, for example, "321 becomes an array with three elements: "3", "2", "1"). I then sort the array (
myArray=myArray.sort()
). At that point, the array contains "1", "2", "3".Not knowing whether you want to save the individual elements of that array of a string assembling them, I did both. I first save each element of the sorted array into separated variables (
response1
,response2
,response3
) and then create a new variable (sorted.concatenated
) where I put the array as a string ("123").You can download my modified example here:
Good luck!
Fabrice.
Thank you!! I've sent you a coffee...! Thank you so much!
Dear Fabrice. Thank you so much for your code, but the program stops when I try to erase my answer with a backspace... I can solve the problem temporarily by changing the response options to alphabetical ones for now.
Hi @Soan,
Oops, had missed that bit... Indeed, the code struggles with backspace in the specific case where the responses only contain digits because of the way OS handles variables. Whenever a variable contains only digits, it treats it as a numerical variable. hence, in this case, the following line of code generates an error:
Fortunately, it is easy to fix. We just need to apply the toString() function before we apply the slice function:
You should now be able to use the backspace even when only inputting digits.
I update my example n Dropbox. You can download it using the link in my previous message.
Best,
Fabrice.
PS: Many thanks for the ☕️ yesterday! 😃
Thank you sooooo much!!