enforcing time on task in a given screen

28 views
Skip to first unread message

kmul...@gmail.com

unread,
Mar 9, 2021, 4:22:21 PM3/9/21
to CTAT Users
Hello,

We are trying to implement a "minimum time on task" functionality in our CTAT example tracing tutor, where students have to spend a minimum length of time on a given  problem (e.g., by having the Done button become active or visible only after a certain amount of time has passed, and/or some related way). Is this possible and if so is there any documentation on how to implement it?

There is a related question on the discussion group: https://groups.google.com/g/ctat-users/c/lrxiQhyNjeo/m/PKvq1Y-VCQAJ but the reply does not include the answer...

Any advice would be appreciated - many thanks in advance.

Kasia Muldner
Carleton University, Canada

Jonathan Sewall

unread,
Mar 9, 2021, 11:52:07 PM3/9/21
to ctat-...@googlegroups.com
Here's some custom JavaScript that might help. It assumes that your CTAT Done button has id="done" and is initially hidden via the CSS style property "visibility: hidden;". The CTAT runtime code emits the "tutorInitialized" event when the tutor is ready for student actions. Using the functions createInterfaceActionMessage() and sendToInterface() as shown will result in the reveal event being logged to DataShop.  

        document.addEventListener("tutorInitialized",
            e => {
                let msBeforeDoneAppears = 30000;  // half a minute
                new Promise((resolve, reject) => {
                    let startTime=Date.now();
                    setTimeout(()=>resolve(startTime), msBeforeDoneAppears);
                }).then(startTime => {
                    console.log("revealing Done button, ms elapsed", Date.now()-startTime);
                    let msgBldr=new CTATTutoringServiceMessageBuilder();
                    CTAT.ToolTutor.sendToInterface(msgBldr.createInterfaceActionMessage(CTATGuid.guid(),new CTATSAI("done", "setVisible", "true"), "DATA"));
                });
                console.log("tutorInitialized?", e);
            }
        );


--
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/00e47e6f-64a7-403c-a8f1-e2b096873dden%40googlegroups.com.

kmul...@gmail.com

unread,
Mar 11, 2021, 5:10:45 PM3/11/21
to CTAT Users
Wonderful - thank you very much for your help!

Kasia

Reply all
Reply to author
Forward
0 new messages