Howdy, Stranger!

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

Supported by

Accuracy in a multiple choice questionnaire

Hey there!

I’m currently trying to build a multiple choice questionnaire, which will finally display the acc% of the correct responses.

My crucial problem is, that I cannot link the response variable of the multiple choice item (let's say my_response) to the correct_response variable (a variable that i defined through the loop, see the first image)


Then, I wrote the following inline script but the matching of the correct_response and my_response variables was not possible (and subsequently acc% was always 0). Any suggestions?


Kind regards,

Vassilis.

Comments

  • Hi Vassilis,


    Can you try to put the code in the run phase of the inline_script? At prepare time, a choice hasn't been made yet.


    Eduard

    Thanked by 1Vassilis
  • Thanks Eduard for your immediate response!

    Unfortunately, nothing has changed.

    However, I feel that the problem is elsewhere. I think that the correct_response variable is referred to a sting of letters, while the response variable of the multiple choice item is not an entity of letters, but rather clicking a box (i suppose). Thus, the problem may be that that correct_response and my_response are different entities. Then, I have to somehow match these two variables to another level, something I cannot imagine at the moment. I don't know if this has any meaning at all!


    Vassilis

  • Update:

    With your proposed change, the variable "correct" takes the correct values (0 or 1). However, the acc feedback always displays 0%.

  • Okay, in that case, a first step is to print out the actual values. So, in your inline_script add the lines:

    print(var.response,var.correct_response)
    print(type(var.response),type(var.correct_response))
    
    

    Also, I just see a problem in your code. Can you replace this line

    if self.get('correct') == '1':
        self.experiment.total_correct += '1'
      
    

    with this line?

    if self.get('correct') == 1: # note, no quotation marks
        self.experiment.total_correct +=1
    

    Does the problem still persist?


    Eduard


    Btw. Please, if you present code, copy the text inside your comment. Screenshots of code are annoying to work with (can't copy & paste)

Sign In or Register to comment.