Howdy, Stranger!

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

Supported by

The variable 'target' does not exist.

Hello, this might be a quiet simple question, but I have trouble causing the experiment to stop.

I am making self-paced reading experiment with this inline script(the 'sentence' source is in table :

sentence_decomposition=var.sentence.split(" ")
var.word_count=len(sentence_decomposition)
var.target_words_list=sentence_decomposition[::-1]

This part is running smoothly.

I added a new loop to display the target, and repeat it for [word_count]

define loop new_loop

set source_file ""

set source table

set repeat "[word_count]"

set order random

set cycles 1

set continuous no

set break_if_on_first yes

set break_if never

setcycle 0 empty_column ""

run new_sequence

inside the loop, I added new sequence with another inline script to show words.

this is the code of inline script 'get_sentence'

define inline_script get_sentence

set description "Executes Python code"

set _run "var.target=target_words_list.pop()"

set _prepare ""

and it seems like this part is causing the issue. I've designated the target and added sketchpad in the same sequence to print the target. but it says the variable target does not exist.

--

The variable 'target' does not exist. Tip: Use the variable inspector (Ctrl+I) to see all variables.

details:

item-stack: experiment[run].practice_loop[run].block_sequence[run].block_loop[run].trial_sequence[run].new_loop[run].new_sequence[prepare].t1[prepare]

--

I viewed the variable inspector and saw target value was empty, but target_words_list had proper value.

Since I am a beginner with OpenSesame, cannot find out what is problem with my code.

Comments

  • Hi @fredcowh,

    Can you share your experiment? With solely the snippets that you shared, I cannot tell what is happening here.

    Thanks,

    Eduard

    Buy Me A Coffee

  • Hello @eduard , Thank you for your comment.

    I will share the file here.


  • Hi,

    I recommend you check out the information on prepare/run in the documentation:https://osdoc.cogsci.nl/4.0/manual/prepare-run/

    In your case, you need to put your code in the get_sentence inline_script in the prepare phase and not in the run phase. Similarly, I would do the same for the inline_script analyze_sentence .

    Hope this clears things up.

    Eduard

    Buy Me A Coffee

  • edited June 13

    Hi, @eduard

    Thank you for your help. I just moved both codes to prepare phase.

    But I still have an issue with Name error.

    NameError: name 'target_words_list' is not defined

    I checked all the name and there was no mistake.

    Still 'target_words_list' has the value (the reversed word), and it is global, variable 'target' couldn't get the value.

    I have no idea why this happens.

  • You called this variable var.target_words_list not target_words_list You need to be consistent. If I add the var. it works for me.

    Eduard

    Buy Me A Coffee

  • Hi,

    I checked the variable name, and it worked! That was a silly question...

    Your answer helped me a lot.

    Thank you so much!

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