You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to have an app stay on a static message screen for 10 minutes if someone indicates a particular answer to a question, then after that time automatically go to another screen. However, no matter what length of time I indicate, the page just blinks for less than a second before continuing on to the next screen.
Here are some relevant lines of code:
if ( question_index == 1 ) {
app.snoozeNotif();
localStore.snoozed = 0;
app.saveData();
}
if ((current_time - localStore.pause_time) > 600000 || localStore.snoozed == 1) {
uniqueKey = new Date().getTime();
localStore.snoozed = 0;
snoozeNotif:function() {
var now = new Date().getTime(), snoozeDate = new Date(now + 600000);
var id = '99';
cordova.plugins.notification.local.schedule({
icon: 'ic_launcher',
id: id,
title: 'Emotions Survey',
text: 'Time to take the survey',
at: snoozeDate,
});
},
The text was updated successfully, but these errors were encountered:
Thanks for your question! I have recently developed a new feature that will do exactly this. However, you would not implement this in the snooze function. This is a new type of question format. The only thing is that it will not automatically advance. The button that participants use to advance to the next screen will show up after 10 minutes. I hope that is okay for the study design you are using.
In the renderQuestion function, you will need to add the following block of code before the penultimate }:
case 'delayInstructions':
question.buttons = Mustache.render(instructionTmpl, {id: question.variableName+"1"});
$("#question").html(Mustache.render(questionTmpl, question)).fadeIn(400);
var instruction = [];
$("#question ul li button").hide().delay(600000).show(0).click(function(){
instruction.push(question.variableName);
instruction.push($(this).val());
app.recordResponse(String(instruction), question_index, question.type);
});
break;
Then, you implement this in surveyQuestions
{
"type":"delayInstructions",
"variableName":"variableName",
"questionPrompt":"Instructions you want to stay on the screen for 10 minutes."
},
Change the values above to reflect what you want.
And then implement your question logic correctly in recordResponse
I’m trying to have an app stay on a static message screen for 10 minutes if someone indicates a particular answer to a question, then after that time automatically go to another screen. However, no matter what length of time I indicate, the page just blinks for less than a second before continuing on to the next screen.
Here are some relevant lines of code:
The text was updated successfully, but these errors were encountered: