Howdy, Stranger!

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

Supported by

[solved] Mc-question and feedback item doesn't work when using inline-script

edited January 2015 in OpenSesame

i'm a beginner in phyton ;)
I tried to get a feedback on my mc-items (response1, 2 , 3 ,4 . In experiment, independent if answer was correct or not, the feedback is always:" your answer was wrong". the variable with the correct response is called: correct_response

I used following inline script:

correctness = self.get ("correct")

if correctness == 1:
feedback = "answer was correct"
else:
feedback = "answer was wrong"

exp.set ("correct", correctness)
exp.set ("Feedback", feedback)

it would be great, if someone would find the mistake :) Thanks a lot

Comments

  • edited 2:38PM

    Hi Laura,

    Based on what you posted, I can see only one error, which is unlikely to have caused your troubles, but just for completion, the line:
    exp.set ("correct", correctness) exp.set ("Feedback", feedback)
    should be
    exp.set ("correct", correctness); exp.set ("Feedback", feedback)
    (note the semicolon between commands).
    Aside of that, I can't see what went wrong right away. I suppose your variable correct doesn't look like you expect it (wrong datatype?). You can try to print it and its type at different positions in your script to see whether it looks how it should be and is not changed at any point. In general printing variables is the simplest way to find out what your code is doing. So, give it a try. From my side, I can't help much more without seeing the entire experiment (You can upload it if you like)

    Let us now if you find the error or have more questions.

    Good luck,

    Eduard

    Btw. I don't see why you set correct to correctness again. This is probably unnecessary.

    Buy Me A Coffee

  • edited 2:38PM

    Hi Eduard,
    thx for your reply! The variable correct didn't worked well because i used the multiple choice form. After replacing the multiple choice form with a sketchpad, it finally worked!
    Another question: I would like to set a break into my experiment. Before and after the break, 20 randomised questions are presented. its important that before and after the break should be presented 10 different questions. So ten questions before, and 10 questions after the break :) i tried to use the countmemorysequence in the run if options in the sketchpad, but nothing has happened
    Greets,
    Laura

  • edited 2:38PM

    The solution for the problem: Insert the break as a sketchpad into the questionloop and type in the run if condition: [count_sequencename]==number of questions before break plus one. so if you want to show 10 items before the break and your sequence is called sequencebreak it's : [count_sequencebreak]==10

  • edited 2:38PM

    Good to hear that you found the problem.
    I will mark your question as solved.

    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