Anyway to create a stopwatch to track how much time lapses before a question is answered?

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping to
track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

Here is an option :

··· - - Create a multiple choice question named quest_start - Label : 'Are you ready ?' - with a single choice that is labeled as 'start' - with display condition set as 'quick' - Create a hidden value named 'start' with calculate condition set as : if(/quest_start = 'start', now(), '') - Create a question list with two things in it : - Your text as a label - A multiple choice question with parameters : - id : quest_stop - Only one choice named 'stop' - Create a hidden value named 'stop' with calculate condition set as : if(/quest_stop = 'stop', now(), '') - Create a hidden value or a label with calculate condition set as : stop - start. It will give you the time

When the reader starts the form, he will encounter the quest-start
question. When he press start, the phone goes automatically to the next
page witch shows the text to be read and the stop button. When stop is
pressed, the phone make the calculation to determine the difference between
time when start and time when stop.
Depending on the phone capabilities and the length of the text to be read,
this stop watch as a few milisecondes of precision. The result of the
substraction is a number of seconds I guess...

Michel

Le vendredi 3 février 2017 14:01:50 UTC+1, Staci Leigh a écrit :

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping to
track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

Hi Staci,

Unfortunately I'm not sure that Michel's solution will work (though worth
trying) - the reason being that calculations can fire more than once, for
example they would likely be re-triggered when the form is completed. This
would result in both hidden values just containing the end time of the form.

The easiest solution might be to have this passage be in its own form so
that you can use the form's built in start and end times as your proxies.
You could use end of form navigation
https://confluence.dimagi.com/display/commcarepublic/End+of+Form+Navigation
to
make the transition more seamless.

Cheers,
Will

··· On Fri, Feb 3, 2017 at 3:19 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Here is an option :

  • Create a multiple choice question named quest_start
    • Label : 'Are you ready ?'
    • with a single choice that is labeled as 'start'
    • with display condition set as 'quick'
  • Create a hidden value named 'start' with calculate condition set as
    : if(/quest_start = 'start', now(), '')
  • Create a question list with two things in it :
    • Your text as a label
    • A multiple choice question with parameters :
      • id : quest_stop
      • Only one choice named 'stop'
    • Create a hidden value named 'stop' with calculate condition set
      as : if(/quest_stop = 'stop', now(), '')
  • Create a hidden value or a label with calculate condition set as :
    stop - start. It will give you the time

When the reader starts the form, he will encounter the quest-start
question. When he press start, the phone goes automatically to the next
page witch shows the text to be read and the stop button. When stop is
pressed, the phone make the calculation to determine the difference between
time when start and time when stop.
Depending on the phone capabilities and the length of the text to be read,
this stop watch as a few milisecondes of precision. The result of the
substraction is a number of seconds I guess...

Michel

Le vendredi 3 février 2017 14:01:50 UTC+1, Staci Leigh a écrit :

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping to
track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks will for the precision. I didn't know the app re-triggered the
hidden values when the form is completed... I understand we won't be able
to store the value in a case property, but will the proposition works just
to output the time spent reading in the same form though ?

Michel

··· 2017-02-03 18:44 GMT+01:00 William Pride :

Hi Staci,

Unfortunately I'm not sure that Michel's solution will work (though worth
trying) - the reason being that calculations can fire more than once, for
example they would likely be re-triggered when the form is completed. This
would result in both hidden values just containing the end time of the form.

The easiest solution might be to have this passage be in its own form so
that you can use the form's built in start and end times as your proxies.
You could use end of form navigation
https://confluence.dimagi.com/display/commcarepublic/End+of+Form+Navigation to
make the transition more seamless.

Cheers,
Will

On Fri, Feb 3, 2017 at 3:19 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Here is an option :

  • Create a multiple choice question named quest_start
    • Label : 'Are you ready ?'
    • with a single choice that is labeled as 'start'
    • with display condition set as 'quick'
  • Create a hidden value named 'start' with calculate condition set as
    : if(/quest_start = 'start', now(), '')
  • Create a question list with two things in it :
    • Your text as a label
    • A multiple choice question with parameters :
      • id : quest_stop
      • Only one choice named 'stop'
    • Create a hidden value named 'stop' with calculate condition set
      as : if(/quest_stop = 'stop', now(), '')
  • Create a hidden value or a label with calculate condition set as :
    stop - start. It will give you the time

When the reader starts the form, he will encounter the quest-start
question. When he press start, the phone goes automatically to the next
page witch shows the text to be read and the stop button. When stop is
pressed, the phone make the calculation to determine the difference between
time when start and time when stop.
Depending on the phone capabilities and the length of the text to be
read, this stop watch as a few milisecondes of precision. The result of the
substraction is a number of seconds I guess...

Michel

Le vendredi 3 février 2017 14:01:50 UTC+1, Staci Leigh a écrit :

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping
to track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/commcare-users/0rks8RWvg8M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Michel,

Your calculation would be correct when first calculated; however, when the
calculations fire again they also re-trigger all the calculations that are
dependent on them. So, the differential would also be recalculated.

Cheers,
Will

··· On Fri, Feb 3, 2017 at 8:55 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Thanks will for the precision. I didn't know the app re-triggered the
hidden values when the form is completed... I understand we won't be able
to store the value in a case property, but will the proposition works just
to output the time spent reading in the same form though ?

Michel

2017-02-03 18:44 GMT+01:00 William Pride wpride@dimagi.com:

Hi Staci,

Unfortunately I'm not sure that Michel's solution will work (though worth
trying) - the reason being that calculations can fire more than once, for
example they would likely be re-triggered when the form is completed. This
would result in both hidden values just containing the end time of the form.

The easiest solution might be to have this passage be in its own form so
that you can use the form's built in start and end times as your proxies.
You could use end of form navigation
https://confluence.dimagi.com/display/commcarepublic/End+of+Form+Navigation to
make the transition more seamless.

Cheers,
Will

On Fri, Feb 3, 2017 at 3:19 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Here is an option :

  • Create a multiple choice question named quest_start
    • Label : 'Are you ready ?'
    • with a single choice that is labeled as 'start'
    • with display condition set as 'quick'
  • Create a hidden value named 'start' with calculate condition set
    as : if(/quest_start = 'start', now(), '')
  • Create a question list with two things in it :
    • Your text as a label
    • A multiple choice question with parameters :
      • id : quest_stop
      • Only one choice named 'stop'
    • Create a hidden value named 'stop' with calculate condition set
      as : if(/quest_stop = 'stop', now(), '')
  • Create a hidden value or a label with calculate condition set as :
    stop - start. It will give you the time

When the reader starts the form, he will encounter the quest-start
question. When he press start, the phone goes automatically to the next
page witch shows the text to be read and the stop button. When stop is
pressed, the phone make the calculation to determine the difference between
time when start and time when stop.
Depending on the phone capabilities and the length of the text to be
read, this stop watch as a few milisecondes of precision. The result of the
substraction is a number of seconds I guess...

Michel

Le vendredi 3 février 2017 14:01:50 UTC+1, Staci Leigh a écrit :

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping
to track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/commcare-users/0rks8RWvg8M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Am I right that all hidden values are re-calculated after every question?

Simon

··· On Fri, Feb 3, 2017 at 9:04 PM, William Pride wrote:

Hi Michel,

Your calculation would be correct when first calculated; however, when the
calculations fire again they also re-trigger all the calculations that are
dependent on them. So, the differential would also be recalculated.

Cheers,
Will

On Fri, Feb 3, 2017 at 8:55 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Thanks will for the precision. I didn't know the app re-triggered the
hidden values when the form is completed... I understand we won't be able
to store the value in a case property, but will the proposition works just
to output the time spent reading in the same form though ?

Michel

2017-02-03 18:44 GMT+01:00 William Pride wpride@dimagi.com:

Hi Staci,

Unfortunately I'm not sure that Michel's solution will work (though worth
trying) - the reason being that calculations can fire more than once, for
example they would likely be re-triggered when the form is completed. This
would result in both hidden values just containing the end time of the form.

The easiest solution might be to have this passage be in its own form so
that you can use the form's built in start and end times as your proxies.
You could use end of form navigation
https://confluence.dimagi.com/display/commcarepublic/End+of+Form+Navigation to
make the transition more seamless.

Cheers,
Will

On Fri, Feb 3, 2017 at 3:19 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Here is an option :

  • Create a multiple choice question named quest_start
    • Label : 'Are you ready ?'
    • with a single choice that is labeled as 'start'
    • with display condition set as 'quick'
  • Create a hidden value named 'start' with calculate condition set as
    : if(/quest_start = 'start', now(), '')
  • Create a question list with two things in it :
    • Your text as a label
    • A multiple choice question with parameters :
      • id : quest_stop
      • Only one choice named 'stop'
    • Create a hidden value named 'stop' with calculate condition set
      as : if(/quest_stop = 'stop', now(), '')
  • Create a hidden value or a label with calculate condition set as :
    stop - start. It will give you the time

When the reader starts the form, he will encounter the quest-start
question. When he press start, the phone goes automatically to the next
page witch shows the text to be read and the stop button. When stop is
pressed, the phone make the calculation to determine the difference between
time when start and time when stop.
Depending on the phone capabilities and the length of the text to be read,
this stop watch as a few milisecondes of precision. The result of the
substraction is a number of seconds I guess...

Michel

Le vendredi 3 février 2017 14:01:50 UTC+1, Staci Leigh a écrit :

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping to
track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-users/0rks8RWvg8M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Please excuse any syntax errors. This email was sent from my phone.
07932 107109.

Hi Simon,

The set of calculations to update is determined by a fairly complex
algorithm that figures out the minimum set of calculations that need to be
updated as an optimization. In theory, however, this should result in the
same behavior as if all calculations were re-calculated (IE any value that
could have changed, would have changed).

Cheers,
Will

··· On Fri, Feb 3, 2017 at 21:33 Simon Berry wrote:

Am I right that all hidden values are re-calculated after every question?

Simon

On Fri, Feb 3, 2017 at 9:04 PM, William Pride wpride@dimagi.com wrote:

Hi Michel,

Your calculation would be correct when first calculated; however, when the
calculations fire again they also re-trigger all the calculations that are
dependent on them. So, the differential would also be recalculated.

Cheers,
Will

On Fri, Feb 3, 2017 at 8:55 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Thanks will for the precision. I didn't know the app re-triggered the
hidden values when the form is completed... I understand we won't be able
to store the value in a case property, but will the proposition works just
to output the time spent reading in the same form though ?

Michel

2017-02-03 18:44 GMT+01:00 William Pride wpride@dimagi.com:

Hi Staci,

Unfortunately I'm not sure that Michel's solution will work (though worth
trying) - the reason being that calculations can fire more than once, for
example they would likely be re-triggered when the form is completed. This
would result in both hidden values just containing the end time of the form.

The easiest solution might be to have this passage be in its own form so
that you can use the form's built in start and end times as your proxies.
You could use end of form navigation
https://confluence.dimagi.com/display/commcarepublic/End+of+Form+Navigation to
make the transition more seamless.

Cheers,
Will

On Fri, Feb 3, 2017 at 3:19 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Here is an option :

  • Create a multiple choice question named quest_start
    • Label : 'Are you ready ?'
    • with a single choice that is labeled as 'start'
    • with display condition set as 'quick'
  • Create a hidden value named 'start' with calculate condition set as
    : if(/quest_start = 'start', now(), '')
  • Create a question list with two things in it :
    • Your text as a label
    • A multiple choice question with parameters :
      • id : quest_stop
      • Only one choice named 'stop'
    • Create a hidden value named 'stop' with calculate condition set
      as : if(/quest_stop = 'stop', now(), '')
  • Create a hidden value or a label with calculate condition set as :
    stop - start. It will give you the time

When the reader starts the form, he will encounter the quest-start
question. When he press start, the phone goes automatically to the next
page witch shows the text to be read and the stop button. When stop is
pressed, the phone make the calculation to determine the difference between
time when start and time when stop.
Depending on the phone capabilities and the length of the text to be read,
this stop watch as a few milisecondes of precision. The result of the
substraction is a number of seconds I guess...

Michel

Le vendredi 3 février 2017 14:01:50 UTC+1, Staci Leigh a écrit :

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping to
track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/commcare-users/0rks8RWvg8M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Please excuse any syntax errors. This email was sent from my phone.
07932 107109.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

As one more confusing wrench in the works - Technically the now()
calculation is a bit unique in that it sometimes evaluates only once, which
may make it possible to exhibit the behavior that has been mentioned here,
but that behavior is hard to predict and quite finicky.

We have a plan for how to execute this behavior cleanly in the future, but
it isn't implemented in a usable way currently.

Currently I can think of one way, though to create a timestamp of when a
question was answered (or answered in a specific way) which would be to
make a repeat whose count is set to

if(/data/question_to_answer = '', 0, 1)

and set a now() based calculation as the Default Value of a member of
that repeat.

that should result in one element whose calculation only triggers once,
conditionally based on a question in the form.

-Clayton

··· On Sun, Feb 5, 2017 at 3:42 PM, William Pride wrote:

Hi Simon,

The set of calculations to update is determined by a fairly complex
algorithm that figures out the minimum set of calculations that need to be
updated as an optimization. In theory, however, this should result in the
same behavior as if all calculations were re-calculated (IE any value that
could have changed, would have changed).

Cheers,
Will

On Fri, Feb 3, 2017 at 21:33 Simon Berry simon@colalife.org wrote:

Am I right that all hidden values are re-calculated after every question?

Simon

On Fri, Feb 3, 2017 at 9:04 PM, William Pride wpride@dimagi.com wrote:

Hi Michel,

Your calculation would be correct when first calculated; however, when
the calculations fire again they also re-trigger all the calculations that
are dependent on them. So, the differential would also be recalculated.

Cheers,
Will

On Fri, Feb 3, 2017 at 8:55 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Thanks will for the precision. I didn't know the app re-triggered the
hidden values when the form is completed... I understand we won't be able
to store the value in a case property, but will the proposition works just
to output the time spent reading in the same form though ?

Michel

2017-02-03 18:44 GMT+01:00 William Pride wpride@dimagi.com:

Hi Staci,

Unfortunately I'm not sure that Michel's solution will work (though worth
trying) - the reason being that calculations can fire more than once, for
example they would likely be re-triggered when the form is completed. This
would result in both hidden values just containing the end time of the form.

The easiest solution might be to have this passage be in its own form so
that you can use the form's built in start and end times as your proxies.
You could use end of form navigation
https://confluence.dimagi.com/display/commcarepublic/End+of+Form+Navigation to
make the transition more seamless.

Cheers,
Will

On Fri, Feb 3, 2017 at 3:19 PM, Michel Akkaoui - de Sousa < akkaouim@gmail.com> wrote:

Here is an option :

  • Create a multiple choice question named quest_start
    • Label : 'Are you ready ?'
    • with a single choice that is labeled as 'start'
    • with display condition set as 'quick'
  • Create a hidden value named 'start' with calculate condition set as
    : if(/quest_start = 'start', now(), '')
  • Create a question list with two things in it :
    • Your text as a label
    • A multiple choice question with parameters :
      • id : quest_stop
      • Only one choice named 'stop'
    • Create a hidden value named 'stop' with calculate condition set
      as : if(/quest_stop = 'stop', now(), '')
  • Create a hidden value or a label with calculate condition set as :
    stop - start. It will give you the time

When the reader starts the form, he will encounter the quest-start
question. When he press start, the phone goes automatically to the next
page witch shows the text to be read and the stop button. When stop is
pressed, the phone make the calculation to determine the difference between
time when start and time when stop.
Depending on the phone capabilities and the length of the text to be
read, this stop watch as a few milisecondes of precision. The result of the
substraction is a number of seconds I guess...

Michel

Le vendredi 3 février 2017 14:01:50 UTC+1, Staci Leigh a écrit :

Hi all,

Is there anyway to create a stopwatch function in CommCare? I'm hoping to
track how long it takes for someone to read a small passage. Rather than
using an actual stopwatch and recording the time manually in CommCare, I
wanted to know if there was any start/stop function or workaround I could
use.

Cheers,

Staci

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/commcare-users/0rks8RWvg8M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Please excuse any syntax errors. This email was sent from my phone.
07932 107109.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.