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 Christian,
this is a typical problem that comes with your variable type.
Your variable is set as a number. Numbers do not start with a zero. If you manage to change the variable type to character/string (which means letters or names) this should not happen.
Another option would be to make it a list of numbers.
var = 012 --> saves as var = 12
var = '012' --> saves as var = '012' keep in mind that you are not working with a number any more. So, '012' - 10 is not possible. It treats '012' like a word. You cannot substract numbers from words ;)
var = [0,1,2] --> is a list of three numbers. --> I will need to learn JavaScript. In python you could use 'append', so the number of items in the list does not have to be the same.
Hope that helps you out.
Stephan
Hi @ChristianB ,
As @DahmSF pointed out, it has to do with the type of variable. I'm no Javascript expert, but I think that it would be straightforward with pure Javascript variables.
However, I think the problem here might be with how OS handles the variables declared with
vars.
. It looks as if for some reason it won't treat it as numerical if it contains only digits and no alphanumerical characters.The problem appears not to be when registering the first response, but when registering the next one. If the second response is a digit, then the leading 0 disappears (it seems that OS then considers that
vars.multichar_response
is a numerical variable of sort). I've adapted your code to allow the response "a", If you first type "0" and then "a", you'll see thatvars.multichar_response
actually contains "0a" (string variable)! However, if you typed "0", "1" and then "a",vars.multichar_response
would first be equal to "0", "1" and then "1a".I played around a bit and modified your code to:
(having set
vars.multichar_response
to""
before the loop begins)I'm setting up an actual Javascript variable (
var responsestring
) as opposed to declaring it using thevars.
method. When doing so, I can use code to detect when a leading zero is typed and if it is, use the.padStart
function applied to the.toString
function of thevars.multichar_response
variable. You'll see thatresponsestring
does work and contain all digit responses including the leading zero.The minute I try to pass it onto a newly created
vars.multichar2
variable, the leading zero disappears (unless the content ofvars.multichar2
contains at least one alphanumerical character somewhere).You can try out the example I worked on. Check out the console to monitor everything going on.
In summary, I couldn't work out how to keep a leading zero as part of a variables declared with the
vars.
method. I think the problem is not a Javascript one but has to do with the way OS interfaces with Javascript to handle variables.Perhaps the developers can shed some more light on this (I'm tagging @sebastiaan in case he or someone else on the team have suggestions to solve this issue).
The only thing I can think for now is to use a variable to detect whether there is a leading zero (as I've done in the code above) and then save that information in the data log, so that you can afterwards know that participants actually pressed zero first and add it in the data set afterwards (or is your program has to do different things if participants start with zero, you can use that variable to that effect). If you need to display the participants' responses on the screen as they type, you could use two distinct feedback objects, condition their presentation on the value of whatever variable you use to detect if there is a leading zero, and on the feedback object to be show when that is the case, display "0[multichar_response]" instead of "[multichar_response]" (as I've done in the example above).
So, unsolved, but I hope that the above helps you to find a workaround solution...
Perhaps other users with greater experience of Javascript and OS will have better solutions!
Fab.
That behaviour is intentional: https://osdoc.cogsci.nl/3.3/manual/variables/#smart-variable-typing-and-some-pitfalls
Hi @eduard,
Thanks for this! That makes sense 👍️
Fabrice.
Hi @ChristianB,
As an afterthought... One thing you could do is to accept the "0" (zero) as input but save an "O" (o letter) into
vars.multichar_response
. Perhaps it works out well in your design. Depending on what font you use on the screen, subjects would not see the difference between "O" and "0"...Try editing the code in my example above and replace "0" by "O"...
Best,
Fabrice.
Sorry for my late response.
Thank you all for your Input. Quite an obvious oversight on my side. However, with your input, I was able to fix the issue! :)
Best,
Christian
Hi @ChristianB and @Fab ,
I see it's already been resolved 👍️
Another way would've been to initialize the variable with something that actually isn't shown, but that does prevent the string from being converted to a number. For example, a
(non-breaking space):— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!