use of com.aware.ui.esms.ESMFactory in project aware-client by denzilferreira.
the class TestESM method testESMDate.
private void testESMDate(Context context) {
try {
ESMFactory factory = new ESMFactory();
ESM_Date date = new ESM_Date();
date.setTitle("ESM: Date");
date.setInstructions("On which day did this occur?");
date.setSubmitButton("OK");
// don't use calendar view, use date picker
date.setCalendar(false);
factory.addESM(date);
ESM.queueESM(context, factory.build());
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.aware.ui.esms.ESMFactory in project aware-client by denzilferreira.
the class TestESM method testDateTime.
private void testDateTime(Context context) {
ESMFactory factory = new ESMFactory();
try {
ESM_DateTime q1 = new ESM_DateTime();
q1.setTitle("Date and time").setInstructions("When did this happen?").setSubmitButton("OK").setTrigger("AWARE Test");
factory.addESM(q1);
ESM.queueESM(context, factory.build());
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.aware.ui.esms.ESMFactory in project aware-client by denzilferreira.
the class TestESM method testFlow.
private void testFlow(Context context) {
ESMFactory factory = new ESMFactory();
try {
ESM_PAM q1 = new ESM_PAM();
q1.setTitle("Your mood").setInstructions("Choose the closest to how you feel right now.").setSubmitButton("Thanks!");
ESM_Radio q2 = new ESM_Radio();
q2.addRadio("Eating").addRadio("Working").addRadio("Not alone").setTitle("Why is that?").setSubmitButton("Thanks!");
ESM_QuickAnswer q0 = new ESM_QuickAnswer();
q0.addQuickAnswer("Yes").addQuickAnswer("No").setTitle("Is this a good time to answer?").addFlow("Yes", q1.build()).addFlow("No", q2.build());
factory.addESM(q0);
ESM.queueESM(context, factory.build());
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.aware.ui.esms.ESMFactory in project aware-client by denzilferreira.
the class TestESM method testTimeoutQueue.
private void testTimeoutQueue(Context context) {
ESMFactory factory = new ESMFactory();
try {
ESM_Freetext esmFreetext = new ESM_Freetext();
esmFreetext.setTitle("Freetext").setTrigger("test").setExpirationThreshold(0).setNotificationTimeout(10).setSubmitButton("OK").setInstructions("Freetext ESM");
ESM_Checkbox esmCheckbox = new ESM_Checkbox();
esmCheckbox.addCheck("Check 1").addCheck("Check 2").addCheck("Other").setTitle("Checkbox").setTrigger("test").setExpirationThreshold(0).setNotificationTimeout(10).setSubmitButton("OK").setInstructions("Checkbox ESM");
ESM_Likert esmLikert = new ESM_Likert();
esmLikert.setLikertMax(5).setLikertMaxLabel("Great").setLikertMinLabel("Poor").setLikertStep(1).setTitle("Likert").setInstructions("Likert ESM").setTrigger("test").setExpirationThreshold(0).setNotificationTimeout(10).setSubmitButton("OK");
ESM_QuickAnswer esmQuickAnswer = new ESM_QuickAnswer();
esmQuickAnswer.addQuickAnswer("Yes").addQuickAnswer("No").setTrigger("test").setExpirationThreshold(0).setNotificationTimeout(10).setInstructions("Quick Answers ESM");
ESM_Radio esmRadio = new ESM_Radio();
esmRadio.addRadio("Radio 1").addRadio("Radio 2").setTitle("Radios").setInstructions("Radios ESM").setExpirationThreshold(0).setNotificationTimeout(10).setSubmitButton("OK");
ESM_Scale esmScale = new ESM_Scale();
esmScale.setScaleMax(100).setScaleMin(0).setScaleStart(50).setScaleMaxLabel("Perfect").setScaleMinLabel("Poor").setScaleStep(10).setTitle("Scale").setInstructions("Scale ESM").setExpirationThreshold(0).setNotificationTimeout(10).setSubmitButton("OK");
factory.addESM(esmFreetext);
factory.addESM(esmCheckbox);
factory.addESM(esmLikert);
factory.addESM(esmQuickAnswer);
factory.addESM(esmRadio);
factory.addESM(esmScale);
ESM.queueESM(context, factory.build());
} catch (JSONException e) {
e.printStackTrace();
}
}
Aggregations