apprenticelearner / AL_Train

A repository for the CTAT HTML based training harness for Apprentice Learner agents.
MIT License
5 stars 5 forks source link

firstChildElement pointers break often #6

Closed eharpste closed 5 years ago

eharpste commented 5 years ago

When interfacing with CTAT widgets there are several places where we are referencing elem.firstChildElement when there is no child element. We do this because CTAT generally wraps a child <input> element in its own div so if we want to effect the <input> we need the child. Sometimes when we request an element from CTAT we actually get the <input>, instead of the CTATElement and so it chokes trying to reference the child. I haven't determined exactly when this does and doesn't happen but we should probably be gating things to check is children are null.

eharpste commented 5 years ago

This might actually be a CTAT issue. After digging into some of the examples from the summer school it looks like this is caused by the <input> child elements being given ids from CTAT elements elsewhere in the DOM. This is a known issue with the CTAT interface builder if you do a lot of copy-pasting while building an interface. All summer school participants that were having this issue solved it by rebuilding their interface from scratch.