I'm making my first YUI application - an activity where the user drags
words into spaces in a body of text. This is to become a Moodle
question type.
So that I can assess how well the user has done, (and pass that
information to Moodle) when they click Submit, I need to work out which
words are in which spaces. I'm currently doing this by maintaining
a "Drop Record", but this is quite tedious. For example, if the user
drags a word off its target and drops it back in the "pool" of words I
have to update my drop record in the OnInvalidDrop method. I can't help
thinking I must be missing something.
Is there a simple way of asking a target what draggable items it has on
top of it? Or should I persevere with my drop record?
+ Windows: n. - The most successful computer virus, ever. +
+ A computer without a Microsoft operating system is like a dog
without bricks tied to its head +
+ A Microsoft Certified Systems Engineer is to computing what a
McDonalds Certified Food Specialist is to fine cuisine +
----- Original Message ----
From: hg.davies <hg.davies@...>
To: ydn-javascript@yahoogroups.com
Sent: Friday, January 25, 2008 1:47:37 AM
Subject: [ydn-javascript] Missing Words Drag and Drop
Hi
I'm
making
my
first
YUI
application
-
an
activity
where
the
user
drags
words
into
spaces
in
a
body
of
text.
This
is
to
become
a
Moodle
question
type.
So
that
I
can
assess
how
well
the
user
has
done,
(and
pass
that
information
to
Moodle)
when
they
click
Submit,
I
need
to
work
out
which
words
are
in
which
spaces.
I'm
currently
doing
this
by
maintaining
a
"Drop
Record",
but
this
is
quite
tedious.
For
example,
if
the
user
drags
a
word
off
its
target
and
drops
it
back
in
the
"pool"
of
words
I
have
to
update
my
drop
record
in
the
OnInvalidDrop
method.
I
can't
help
thinking
I
must
be
missing
something.
Is
there
a
simple
way
of
asking
a
target
what
draggable
items
it
has
on
top
of
it?
Or
should
I
persevere
with
my
drop
record?
I didn't understand the code in that example very well, but your
message prompted me to look again and I can see now that, if I use a
similar approach, at the end of the user's interaction I can cycle
through the targets and, for those which have a "player" property, it
will point to the item on top of the target.