Howdy, Stranger!

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

Supported by

Random digit analysis & 4th level analysis for MC Questions.

Hello OpenSesame community,

I need some help regarding some programming in OpenSesame because what is required I do not think that it may be done with the loop table. The experiment is about remembering random digits, and the area that I have difficulty is the following:

Random Digits Analysis

The five random digits that my experiment is already producing should be independent from one another. For example, the random digit 54321 is not Fifty-Four-Thousand-And-Three-Hundred-And-Twenty one, but is Five Four Three Two One. Should another random number such as 12345 be removed from 54321 the result should not be 41975, but it should be 4 2 0 -8 -6, like so:

54321 -
12345


41975 (not right)

5 4 3 2 1 -
1 2 3 4 5


4 2 0 -8 -6 (right).

So OpenSesame should calculate how many zeros there are when the provided random digits are removed from the presented ones. The greater the number of zeros the more accurately they remembered the presented random digits that I am measuring. The digits are provided from OpenSesame with the following inline script:

import random
randnr = random.randint(10000,99999)
exp.set("randnum",randnr)

The other issue is about level four calculations in multiple choice questions. Here is what I mean:

Level one

Correct_Answer = 1
Incorrect_Answer = 0

Level two

Yes = 1
No = 0.5

Level Three

Yes + Correct_Answer = 2
No + Correct_Answer = 1.5
Yes + Incorrect_Answer = 1
No + Incorrect_Answer = 0.5

Level 4

If 2 then = Happy
If 1.5 then = Meltdown
If 1 then = Fabulous
If 0.5 then = Reality

So OpenSesame should calculate how many Happy-ies, Meltdown-s, Fabulous-s, and Reality-s a participant scored while providing their random digits after viewing the presented ones. I know a bit of programming, I know that it should be a simple if/then issue, but I do not know what exactly should be typed where in order to get what I want in OpenSesame 3.1.

Thanks in Advance
Diedon

Comments

  • edited July 2016

    And I better mention this in time also,

    The MC Questions are randomized. So I have all the choice answers and a question in column 1, then 2, 3, 4, 5, ... and so on. I am keeping it this way so as to randomize the order of the presented MC question. Thereby solutions such as calling Correct_Answer variables as numbers or as "congruent" such as below does not work. The MC Questions have to be numerized some other way first, and then be called as Happy, Meltdown, Fabulous, and Reality.

    http://osdoc.cogsci.nl/2.9/tutorials/step-by-step-tutorial/#step-8-configure-the-incorrect-sampler-item

  • Hi,

    To start with the first question. You give the following as an example of what should happen:

       5  4  3  2  1 
    -  1  2  3  4  5 
    =  4  2  0 -8 -6
    

    But I don't understand this. If you simply subtract the second numbers from the first ones, shouldn't it be:

       5  4  3  2  1 
    -  1  2  3  4  5 
    =  4  2  0 -2 -4
    

    Or do I misunderstand?

    Regarding the second question, you can access experimental variables using var.[varname]. So what you're describing would go something like:

    var.level1 = var.correct
    var.level2 = 1 if var.response == 'yes' else 0
    if var.level1 and var.level2:
        var.level3 = 2
        var.level4 = 'Happy'
    elif var.level1 and not var.level2:
        var.level3 = 1.5
        var.level4 = 'Meltdown'
    elif not var.level1 and var.level2:
        var.level3 = 1
        var.level4 = 'Fabulus'
    else:
        var.level3 = 0.5
        var.level4 = 'Reality'
    

    Of course, this is just a rough sketch. The details depend on how you have coded your experiment.

    Cheers!
    Sebastiaan

  • Thanks Sebastian,

    Regarding the numbers, you subtract the 1st from the second.

  • Regarding the numbers, you subtract the 1st from the second.

    You'll have to be a little more specific here, because in your example you're clearly not subtracting the first from the second digit.

    In any case, say that you do want subtract the first from the second digit, then you could do so with a script like the one below. You could implement other operations in a similar way.

    # Two input numbers in str type
    n1 = '12345'
    n2 = '54321'
    
    n3 = ''
    # Loop through the digits of bopth numbers
    for i1, i2 in zip(n1, n2):
        # Subtract the 1st digit from the 2nd
        i3 = int(i2) - int(i1)
        # Append the result to a result string
        n3 += str(i3)
    # Print the result string
    print(n3)
    
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