String as array name?
Kerwin Olfers
kerwino at gmail.com
Fri Feb 7 16:02:18 UTC 2014
Hi everyone,
I was wondering if there is a way to take a string from an attribute and
use it as a variable/array name in inline?
My situation:
Participants are prompted with a questions and asked to type their answer
(which is displayed using the echo functions).
There are multiple correct answers per question. I know in Eprime 2.0.10
and up you can simple have the multiple answer comma separated in an
attribute lis <http://www.pstnet.com/support/kb.asp?TopicID=1400>t, which
would solve all my problems.
However we're running 2.0.8 with little hope of updating in the near future.
The solution so far is to store the multiple answers for each question in
separate arrays.
e.g.
question1(1) = "dog"
question1(2) = "labrador"
question2(1) = "fish"
question2(2)= "tuna"
Then after the question slide, I use an inline to run through the array to
check if the answer is correct.
However, since there is a different array for each question, I need a way
to select the proper array, which hopefully doesn't involve me putting a
whole list of 'if' statements.
Something like:
For Counter = 1 to Ubound(c.getAttrib("arrayName"))
If c.getAttrib("arrayName")(Counter) = Stimulus.RESP then
Stimulus.ACC = 1
end if
next
.. although the above obviously doesn't work in the current form. Does
anyone know of a way to do this, i.e. use strings stored in attributes as
variable names in inline (a bit like an eval function)?
Thanks!
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/f2417410-b03a-4b78-8db1-6636011c968e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20140207/0b22257b/attachment.htm>
More information about the Eprime
mailing list