Can't get addlevel commant to do the trick...(plus another question)
gilis
giladsabo at gmail.com
Sun Oct 23 19:33:39 UTC 2011
Well the 0 is a mistake in the post, at first place I had nLevel
instead. In any case Liwi, the problem I still didn't have much
success to solve goes like this: I have to different lists of words
and I want eprime to sample 1 of them each time, each list contain 10
samples. Also, the "word" stimuli in one list should have the color of
white and cyan in the other. So I tried to solve it this way:
Dim indexstim(19) as integer
dim oddoreven as integer
dim stimuli(19) as string
dim Newcorrect(19) as integer
dim blonumber as integer
dim randi as integer
blonumber=c.getattrib("Block_Number") 'Block_Number is an attribute
within each trial list that indicate the number of the block
'do this only if you're in block 3
if blonumber=3 then
'randomize 20 values
randi=random(1,20)
'if this random number already been used loop it until unused value is
found. Also, if word from b list was already chosen in the previous
trial please randomize again until value from a list is chosen.
if indexstim(randi)=1 and oddoreven<>0 then
randi=random(1,20)
loop until indexstim(randi)<>1 and randi mod 2=0
end if
' do the opposite in case the previous item was taken from a list (so
each time the sample take item from different list).
if indexstim(randi)=1 and oddoreven=0 then
randi=random(1,20)
loop until indexstim(randi)<>1 and randi mod 2<>0
end if
'set oddoreven to distinguish between the two lists (values of a list
are always in even numbers in the array)
oddoreven= randi mod 2
'set the words array, words from list a are in even number (0, 2,
4..20) and words from list b are in odd numbers (1,3,5...19)
stimuli(0)= "word1"
.
.
.
.stimuli(19)="word20"
'set an array of correct answers that is in accordance with the word
list
newcorrcet(0)=1
.
.
.
.
newcorrect(19)=9
'the indexstim of the word that was chosen is now equal to 1 and the
word won't be chosen again
indexstim(randi)=1
'display the word that was chosen
triallist.setattrib randi, "word", stimuli(randi)
'update the correct answer
triallist.setattrib randi, "correct",newcorrect(randi)
'set different color for words from different lists
if oddoreven=0 then
mainlist.setattrib randi, "word_color",CColor("cyan")
else
mainlist.setattrib randi, "word_color",CColor("white")
end if
'close statement
end if
Now, this inline, in different versions that I tried (e.g., like using
c.set instead of addressing the level and list directly) was putted by
me after the stimuli slide and the results were peculiar-sometimes the
slide presented words taken from the attribute "word" (when I delete
those, it present blank trials sometimes) and sometimes words from the
arrays (and sometimes not even single one of them), it didn't reset
the correct attribute and didn't alter the color of the words
according to the lists from which they were taken. I also tried to
split this inline and to use it in the session process, before the
main list-nothing worked, and my experiment-which should be complete
or at least 99% so if it would work, still not running...
Would appreciate any advice
Warmest regards
Gili
On Oct 23, 1:27 pm, liwenna <liwe... at gmail.com> wrote:
> Hi Gilis,
>
> Not sure about the first question you ask, but could it have something
> to do with the line 'stimlist.AddLevel 0' ? Seems to me that you're
> adding zero levels there making that line either redundant or possibly
> messing up your script (given that the error message seems to have
> something to do with a mismatch between the numbering or number of
> levels).
>
> As for the second question: I think you'll have to use the
> stimlist.reset command before you can operate on the attribute values.
> But what confuses me more is what the possible location of this script
> is?? If it's on the proc that is nested in stimlist than you should
> (perhaps even could?) not tamper with the stimlist that the proc is in
> while if it's not on the proc that is nested into stimlist than you're
> in the wrong context (the c in c.getattrib) to get the value of the
> attribute using that command.
>
> Perhaps (guessing here) you overlooked the part where adding levels
> with a script should be done to a separate list that get's located
> later in the main procedure than the list that the program is
> currently 'working' in, i.e not the list that is active when the
> inline is encountered.
>
> On 23 okt, 00:08, gilis <gilads... at gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi all..
>
> > when I try to do that:
>
> > dim nLevel as integer
>
> > for nLevel= 1 to 10
>
> > stimlist.AddLevel 0
>
> > stimlist.SetWeight nLevel, "1"
>
> > stimlist.SetProc nLevel, "trialproc"
>
> > stimlist.SetAttrib nLevel, "word", "nothing"
>
> > stimlist.SetAttrib nLevel , "Word_type", "notrealy"
>
> > stimlist.SetAttrib nLevel, "correct", "0"
>
> > stimlist.SetAttrib nLevel, "xcolor", "black"
>
> > Set stimlist.TerminateCondition = Cycles(1)
>
> > Set stimlist.ResetCondition = Samples(10)
>
> > stimlist.Reset
>
> > Next nLevel
>
> > I get "level that is an integer with level count mismatch" -well, I
> > tried to solve it in many ways, but I guess that some help could be
> > more helpful.
>
> > Second question is about this issue:
>
> > dim a(9) as string
> > dim stimarray(9) as string
> > dim c1 as string
> > dim m as integer
>
> > a(0)="word1"
> > .
> > .
> > a(9)="word10"
> > .
> > .
> > .
>
> > for m=1 to 1o
> > stimlist.SetAttrib m, "word", stimarray(m-1)
> > c1 = c.getattrib("word")
> > if c1 = a(0) or a(1) or a(2) or a(3) or a(4) then
> > stimlist.SetAttrib m, "correct", 1
> > end if
>
> > It keep telling me that there is no such attribute as "word", though
> > you can see that I predefined one and just to make sure I also did it
> > in the relevant list object. Again, I tried to solve it in many ways
> > but your help sounds like a better idea.
>
> > Thanks in advance,
> > Gilis
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
More information about the Eprime
mailing list