use of com.aware.ui.esms.ESM_PAM in project aware-client by denzilferreira.
the class TestESM method testESMS.
private void testESMS(Context context) {
ESMFactory factory = new ESMFactory();
try {
ESM_Freetext esmFreetext = new ESM_Freetext();
esmFreetext.setTitle("Freetext").setTrigger("test").setReplaceQueue(true).setSubmitButton("OK").setInstructions("Freetext ESM");
ESM_Checkbox esmCheckbox = new ESM_Checkbox();
esmCheckbox.addCheck("Check 1").addCheck("Check 2").addCheck("Other").setTitle("Checkbox").setTrigger("test").setSubmitButton("OK").setInstructions("Checkbox ESM");
ESM_Likert esmLikert = new ESM_Likert();
esmLikert.setLikertMax(7).setLikertMaxLabel("Great").setLikertMinLabel("Poor").setLikertStep(1).setTitle("Likert 3").setInstructions("Likert ESM").setTrigger("test").setSubmitButton("OK");
ESM_QuickAnswer esmQuickAnswer = new ESM_QuickAnswer();
esmQuickAnswer.addQuickAnswer("Yes").addQuickAnswer("No").setTrigger("test").setInstructions("Quick Answers ESM");
ESM_Radio esmRadio = new ESM_Radio();
esmRadio.addRadio("Radio 1").addRadio("Radio 2").setTitle("Radios").setInstructions("Radios ESM").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").setSubmitButton("OK");
ESM_DateTime esmDate = new ESM_DateTime();
esmDate.setTitle("Date and Time").setTrigger("AWARE Test").setInstructions("Specify date and time").setSubmitButton("OK");
ESM_PAM esmPAM = new ESM_PAM();
esmPAM.setTitle("PAM").setInstructions("Pick the closest to how you feel right now.").setSubmitButton("OK").setTrigger("AWARE Test").setAppIntegration("fourtwentystudy://");
factory.addESM(esmFreetext);
factory.addESM(esmCheckbox);
factory.addESM(esmLikert);
factory.addESM(esmQuickAnswer);
factory.addESM(esmRadio);
factory.addESM(esmScale);
factory.addESM(esmPAM);
factory.addESM(esmDate);
ESM.queueESM(context, factory.build());
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.aware.ui.esms.ESM_PAM in project aware-client by denzilferreira.
the class TestESM method testPAM.
private void testPAM(Context context) {
ESMFactory factory = new ESMFactory();
try {
ESM_PAM q1 = new ESM_PAM();
q1.setTitle("PAM").setInstructions("Pick the closest to how you feel right now.").setSubmitButton("OK").setNotificationTimeout(10).setTrigger("AWARE Test");
factory.addESM(q1);
ESM.queueESM(context, factory.build());
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.aware.ui.esms.ESM_PAM in project aware-client by denzilferreira.
the class TestScheduler method testESMTrigger.
private void testESMTrigger(Context c) {
try {
ESM_PAM esmPAM = new ESM_PAM();
esmPAM.setTitle("PAM").setInstructions("Pick the closest to how you feel right now.").setSubmitButton("OK").setNotificationTimeout(10).setTrigger("AWARE Test");
ESMFactory factory = new ESMFactory();
factory.addESM(esmPAM);
Scheduler.Schedule contextual = new Scheduler.Schedule("test_contextual");
contextual.addContext(Screen.ACTION_AWARE_SCREEN_ON);
contextual.setActionType(Scheduler.ACTION_TYPE_BROADCAST);
contextual.setActionIntentAction(ESM.ACTION_AWARE_QUEUE_ESM);
contextual.addActionExtra(ESM.EXTRA_ESM, factory.build());
Scheduler.saveSchedule(c, contextual);
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.aware.ui.esms.ESM_PAM 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();
}
}
Aggregations