Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Calculating Correct responses in a single loop

edited January 27 in OSWeb

Hi there,

i have created a nested loop.

In the outer loop sequence i have put the following:

vars.RT_Sum=0
vars.ERR_SUM=0
vars.COR_SUM=0

In the inner loop sequence i have put this:

vars.RT= vars.response_time_Resp
if (vars.correct_Resp== 1){
  vars.COR=1
  vars.COR_SUM = vars.COR_SUM + 1
}
else if (vars.correct_Resp== 0){
  vars.COR=0
  vars.ERR_SUM = vars.ERR_SUM + 1
}
vars.RT_Sum = vars.RT_Sum + vars.RT

The variable vars.EER_SUM is then used again in the outer loop in a feedback_item.

It works fine if i run it the normal way (single green play-button), but not if i run it in the browser. In the browser i always get the feedback that all respones were incorrect.

Any ideas what i am doing wrong here?

Stephan

Comments

  • Hi Stephan,

    I would use the browser debugger for this. If you put a line with the statement debugger at the end of the script and then run the experiment while the browser console is active (Ctrl+Shift+I in Chrome), the experiment will pause when it comes across the debugger statement. That way you will be able to inspect the values of all relevant variables. (Simply typing them into the browser console, like so: vars.response.)

    Does that help?

    -- Sebastiaan

    Buy Me A Coffee

  • Hi Sebastiaan,

    the problem is not as much that i do not see my variables, but that something that works in normal run, does not work in OSWeb.

    It appears that I do not get into the if clause, but only into the else if. The only logical reason is that vars.correct_Resp is always 0, even if the response was correct.

    I therefore played around a little with the correct_response input in the keyboard response item.

    I have two variables that are defined in the loop. I have 4 allowed responses, each in upper and lower case. Two correct responses (one is upper case the other lower case) --> just in case participants use caps lock.

    I tried [COR1];[COR2] and COR1;COR2 and vars.COR1;vars.COR2 and [COR1],[COR2]

    --> only the first brings the correct number of errors in normal run, but not in OSWeb

    --> the other options do not result in errors stopping the script, but do not count correct responses neither in normal run, nor in OSWeb.

    I believe I am close, but what is the correct version to use in OSWeb?

    Cheers, Stephan

  • Hi there,

    i found a workaround. There seems a bug when using the correct_resp in OSWeb.

    This worked for me. The console.log function may be added in the manual of common functions. It was very helpful ;)

    console.log (vars.correct_Resp)
    vars.RT= vars.response_time_Resp
    if (vars.response_Resp== vars.COR1 | vars.response_Resp== vars.COR2){
    vars.COR=1
    vars.COR_SUM = vars.COR_SUM + 1
    }
    else {
    vars.COR=0
    vars.ERR_SUM = vars.ERR_SUM + 1
    }
    console.log (vars.COR, vars.response, vars.COR1)
    vars.RT_Sum = vars.RT_Sum + vars.RT
    
  • Hi @DahmSF ,

    Ok, I see what you mean now. OSWeb indeed doesn't recognize multiple correct responses, whereas OpenSesame on the desktop does. That's the issue, right? I filed an issue for it here.

    — Sebastiaan

    Buy Me A Coffee

Sign In or Register to comment.

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