Getting CTAT Component Value: CTAT Table Cells Value

17 views
Skip to first unread message

Indrabudhi Kusuma

unread,
Jul 20, 2024, 4:29:53 PM7/20/24
to CTAT Users
Dear CTAT Users & Team,

I am trying to build my Cognitive Tutor using nools. But I got stuck on getting the value of the table cells value after inserting the facts through TPA (Fig 2 Line 40).  

As on the screenshot I have attached (Fig 1), I tried to get the value of  cell with id ctatdiv38 inside the coinRowTabR1C1, but it is undefined. I try to do the same for the other cells that have been filled, but it also returned undefined meanwhile the textfield (id = ctatdiv102) could return the value.

Is there any possible way to get the table value?

Thanks in advance!
Fig2.png
Fig1.png

Octav Popescu

unread,
Jul 20, 2024, 7:18:54 PM7/20/24
to ctat-...@googlegroups.com, Indrabudhi Kusuma

'innerHTML' does what is says, it returns the HTML content of some given element. So if you had in your interface something like: <textarea>Some text</textarea>, then innerHTML would return 'Some text'. However if you type text into an input element like 'textarea' or 'input', that text does not end up as the HTML content of the input element. It can instead be retrieved using the 'value' attribute of the element. TPAs simulate user typing, so end up using the same mechanism.

Moreover if you're writing nools rules, you should get your input from working memory facts rather than by inspecting the interface directly. If you've set those texts through TPAs as your attachment shows, then those TPA facts should still be present in working memory and can be used in a rule's left-hand side matching.

Best,
Octav

--
You received this message because you are subscribed to the Google Groups "CTAT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ctat-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ctat-users/238bd109-9f0d-4d69-9e4e-53b9936c7000n%40googlegroups.com.

Indrabudhi Kusuma

unread,
Jul 21, 2024, 12:55:33 AM7/21/24
to CTAT Users
Thanks Octav, now I understand how to take the value of it. 

Regards,
Indra 

Reply all
Reply to author
Forward
0 new messages