CoughDrop/coughdrop

Unspoken linked buttons included in OBL as spoken

juliatuttle opened this issue · 1 comments

I have a home board with links to several sub-boards (e.g. "things") that do not vocalize their labels, but in the OBL that Coughdrop produces, clicks on those buttons are marked as "spoken": true.

I believe the problem is that:

  1. activateButton doesn't initialize obj.spoken to false when it creates obj (here).
  2. app_state.activate_button only sets obj.spoken in one place (here), to true; it is never set to false.
  3. At some point, this log event gets uploaded, with "spoken" set to true if the button was spoken or unset entirely if it was unspoken.
  4. Exporter.event_session sets "spoken" on the OBL event (here) to true if "spoken" on the log event is true or if it is nil. (I'm not 100% confident, but I assume the unset "spoken" in the client-side log event translates to a nil "spoken" in the server-side log event.)

I'm not currently able to send a pull request to fix this (I'm waiting on my employer's copyright folks to get back to me), but my proposed fix would be:

  1. Set obj.spoken explicitly in all cases in activate_button. This will ensure future logs are uploaded with "spoken" set properly to false for unspoken buttons events.
  2. Remove the || event['button']['spoken'] == nil clause in Exporter.event_session. This will ensure past unspoken button events are not labelled as spoken in the OBL logs.
  3. If the nil check was there because some older logs never have "spoken" included, I would assume that any session where "spoken" is never set is from that era, and force it to true only for those sessions.

spoken-unspoken.txt is a barebones subset of my OBL file demonstrating the issue; please compare the button events with "spoken": true to the utterance at the end.

Please let me know if I can provide any more information. I hope to be able to provide a fix at some point, if you'd like it, my employer's okay with me contributing, and my proposed solution is amenable.

Thanks for all your tireless work on Coughdrop; it has been a wonderful tool for me.

Pardon the error, I was a little too aggressive minimizing spoken-unspoken.txt.
spoken-unspoken.txt should be valid JSON and should show the issue.