Optimal-Learning-Lab / LKT

12 stars 2 forks source link

Function to make `Duration..sec.` from unix timestamps #19

Open wbreilly opened 11 months ago

wbreilly commented 11 months ago

Duration..sec. is listed as a requirement for practiceTime and therefore computeSpacingPredictors. The dataset I'm working with does not have this column, but it does have timestamps. A definition of Definition..sec. would be helpful. Thank you!

imrryr commented 11 months ago

This is the duration in seconds of each event. This typically includes both practice and feedback time for some sort of exercise. If you sum the durations you get the total time the student was working.

imrryr commented 11 months ago

If you only have beginning OR end of event times for each event, the last or first event will need to be estimated, since you can't infer it with subraction.

imrryr commented 11 months ago

practiceTime was originally a way to work around a lack of proper timestamps. It uses the duration to estimate timestamps using cumsum (this doesn't work well if there are breaks or long-term intervals)....

These 2 lines in computeSpacingPredictors merely infer the relative time CF..reltime. (time without spacing) and true time CF..time. from duration if needed. If CF..reltime. (which is just timestamp in seconds from start minus breaks) is computed and CF..Time. (timestamp in seconds) is also available, I'm pretty sure duration is not needed.

if (!("CF..reltime." %in% colnames(data))) { data$CF..reltime. <- practiceTime(data) } if (!("CF..Time." %in% colnames(data))) { data$CF..Time. <- data$CF..reltime. }