Howdy, Stranger!

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

Supported by

[open] question about ways to give feedbacks

edited May 2014 in OpenSesame

Hii:)
I would like to give the participant feedback on task on runing score and the feedback would be given in different propotion and in different some of point- give sometime +1 +2 +3 in random order. e.g. to press 1 will give in 80% of the time a score. sometime it will give 2 point and sometime it will give 1 point.
I will be glad if one of you could help me find solution.
with alot of thanks
orit.

Comments

  • edited 2:23PM

    Hi,

    Although I am not quite sure what you mean, I think you want to explore inline scripting and the random module. A code snippet, as an example:

    # import the random module, so we can use it
    import random
    
    # get response (from previous keyboard_response)
    response = self.get("response")
    
    # check if the response was '1'
    if response == '1':
        # generate a random number between 0 and 1
        r = random.random()
        # check if the random number if lower than 0.8
        # (this will happen in 80% of the cases)
        if r < 0.8:
            # award one point
            points = 1
        # if the reward between 0.8 and 0.95
        elif r < 0.95:
            points = 2
        # if the reward was between 0.95 and 1
        else:
            points = 3
    
    # set the points variable, so you can use it in a feedback item
    exp.set("points", points)
    

    Place this script in the Run phase of an inline_script item placed directly after a keyboard_response item. Place a feedback item directly after it, in which you show the text [points].

    I hope this example and the links will set you off in the right direction. You could also try to do some tutorials, to get acquainted with OpenSesame first.

    Good luck!

  • edited 2:23PM

    @oritnaf: it would help if you could you define your question and rules a little more precise ? it is quite hard to get what you want to do.

    As Edwin pointed out you can the use the random class provided by Python and then decide on rules with if / else / elif statements. To help you with that one should know what your rules are and how you want to provide feedback.

Sign In or Register to comment.