|
|
|
|
47
|
import java.io.FileNotFoundException;
|
47
|
import java.io.FileNotFoundException;
|
48
|
import java.io.FileOutputStream;
|
48
|
import java.io.FileOutputStream;
|
49
|
import java.io.IOException;
|
49
|
import java.io.IOException;
|
50
|
-import java.net.MalformedURLException;
|
|
|
51
|
|
50
|
|
52
|
import uprrp.tania.GlobalValues;
|
51
|
import uprrp.tania.GlobalValues;
|
53
|
import uprrp.tania.R;
|
52
|
import uprrp.tania.R;
|
|
|
|
|
55
|
|
54
|
|
56
|
public class GettingStartedActivity extends AppCompatActivity {
|
55
|
public class GettingStartedActivity extends AppCompatActivity {
|
57
|
|
56
|
|
|
|
57
|
+ private static final String TAG = "GettingStartedActivity";
|
58
|
private static final int REQUEST_CONSENT = 0;
|
58
|
private static final int REQUEST_CONSENT = 0;
|
59
|
-
|
|
|
60
|
public static final String VISUAL_CONSENT_IDENTIFIER = "visual_consent_identifier";
|
59
|
public static final String VISUAL_CONSENT_IDENTIFIER = "visual_consent_identifier";
|
61
|
public static final String CONSENT_DOC = "consent_doc";
|
60
|
public static final String CONSENT_DOC = "consent_doc";
|
62
|
- public static final String SIGNATURE_FORM_STEP = "form_step";
|
|
|
63
|
- public static final String NAME = "name";
|
|
|
|
|
61
|
+// public static final String SIGNATURE_FORM_STEP = "form_step";
|
|
|
62
|
+// public static final String NAME = "name";
|
64
|
public static final String CONSENT = "consent";
|
63
|
public static final String CONSENT = "consent";
|
65
|
public static final String SIGNATURE = "signature";
|
64
|
public static final String SIGNATURE = "signature";
|
66
|
|
65
|
|
67
|
@Override
|
66
|
@Override
|
68
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
67
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
68
|
+
|
|
|
69
|
+ // Constructor stuff
|
69
|
super.onCreate(savedInstanceState);
|
70
|
super.onCreate(savedInstanceState);
|
70
|
setContentView(R.layout.activity_getting_started);
|
71
|
setContentView(R.layout.activity_getting_started);
|
71
|
|
72
|
|
72
|
// Get permission to write to external storage - files
|
73
|
// Get permission to write to external storage - files
|
73
|
- String[] permissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE};
|
|
|
|
|
74
|
+ String[] permissions = { Manifest.permission.WRITE_EXTERNAL_STORAGE };
|
74
|
requestPermissions(permissions, 1);
|
75
|
requestPermissions(permissions, 1);
|
75
|
|
76
|
|
76
|
- Button createAccount = findViewById(R.id.buttonCreateAccount);
|
|
|
77
|
- Button loginAccount = findViewById(R.id.buttonRecoverAccount);
|
|
|
78
|
-
|
|
|
79
|
- createAccount.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
77
|
+ // Attach onClick listeners to buttons
|
|
|
78
|
+ Button createAccountButton = findViewById(R.id.buttonCreateAccount);
|
|
|
79
|
+ Button loginAccountButton = findViewById(R.id.buttonRecoverAccount);
|
|
|
80
|
+ createAccountButton.setOnClickListener(new View.OnClickListener() {
|
80
|
@Override
|
81
|
@Override
|
81
|
public void onClick(View v) {
|
82
|
public void onClick(View v) {
|
82
|
- try {
|
|
|
83
|
launchConsent();
|
83
|
launchConsent();
|
84
|
- } catch (Exception e) {
|
|
|
85
|
- e.printStackTrace();
|
|
|
86
|
- }
|
|
|
87
|
}
|
84
|
}
|
88
|
});
|
85
|
});
|
89
|
-
|
|
|
90
|
- loginAccount.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
86
|
+ loginAccountButton.setOnClickListener(new View.OnClickListener() {
|
91
|
@Override
|
87
|
@Override
|
92
|
public void onClick(View v) {
|
88
|
public void onClick(View v) {
|
93
|
- try {
|
|
|
94
|
- Intent loginAccountIntent = new Intent(GettingStartedActivity.this, LoginActivity.class);
|
|
|
95
|
- startActivity(loginAccountIntent);
|
|
|
96
|
-
|
|
|
97
|
- } catch (Exception e) {
|
|
|
98
|
- e.printStackTrace();
|
|
|
99
|
- }
|
|
|
|
|
89
|
+ Intent loginAccountIntent = new Intent(GettingStartedActivity.this, LoginActivity.class);
|
|
|
90
|
+ startActivity(loginAccountIntent);
|
100
|
}
|
91
|
}
|
101
|
});
|
92
|
});
|
102
|
|
93
|
|
103
|
-
|
|
|
104
|
}
|
94
|
}
|
105
|
|
95
|
|
106
|
@Override
|
96
|
@Override
|
107
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
97
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
108
|
super.onActivityResult(requestCode, resultCode, data);
|
98
|
super.onActivityResult(requestCode, resultCode, data);
|
109
|
-
|
|
|
110
|
- if (requestCode == REQUEST_CONSENT && resultCode == RESULT_OK) {
|
|
|
|
|
99
|
+ if(requestCode == REQUEST_CONSENT && resultCode == RESULT_OK) {
|
111
|
processConsentResult((TaskResult) data.getSerializableExtra(ViewTaskActivity.EXTRA_TASK_RESULT));
|
100
|
processConsentResult((TaskResult) data.getSerializableExtra(ViewTaskActivity.EXTRA_TASK_RESULT));
|
112
|
}
|
101
|
}
|
113
|
}
|
102
|
}
|
|
|
|
|
115
|
|
104
|
|
116
|
@Override
|
105
|
@Override
|
117
|
public void onRequestPermissionsResult(int requestCode, String permissions [], int[] grantResults) {
|
106
|
public void onRequestPermissionsResult(int requestCode, String permissions [], int[] grantResults) {
|
118
|
- if (requestCode == 1) {
|
|
|
119
|
- if (grantResults[0] != PackageManager.PERMISSION_GRANTED) {
|
|
|
120
|
- Toast.makeText(getApplicationContext(), "Permission for writing to external storage: DENIED", Toast.LENGTH_LONG).show();
|
|
|
121
|
- }
|
|
|
|
|
107
|
+ if(requestCode == 1) {
|
|
|
108
|
+ if(grantResults[0] != PackageManager.PERMISSION_GRANTED) {
|
|
|
109
|
+ Toast.makeText(getApplicationContext(), "Permission for writing to external storage: DENIED", Toast.LENGTH_LONG).show();
|
|
|
110
|
+ }
|
122
|
}
|
111
|
}
|
123
|
}
|
112
|
}
|
124
|
|
113
|
|
125
|
|
114
|
|
126
|
private void processConsentResult(TaskResult result) {
|
115
|
private void processConsentResult(TaskResult result) {
|
|
|
116
|
+
|
127
|
boolean consented = (boolean) result.getStepResult(CONSENT_DOC).getResult();
|
117
|
boolean consented = (boolean) result.getStepResult(CONSENT_DOC).getResult();
|
|
|
118
|
+ StorageAccess.getInstance().getAppDatabase().saveTaskResult(result);
|
128
|
|
119
|
|
129
|
- if (consented) {
|
|
|
|
|
120
|
+ if(consented) {
|
130
|
try {
|
121
|
try {
|
131
|
- StorageAccess.getInstance().getAppDatabase().saveTaskResult(result);
|
|
|
132
|
|
122
|
|
|
|
123
|
+ // Get signature in base64
|
133
|
TaskResult taskResult = StorageAccess.getInstance()
|
124
|
TaskResult taskResult = StorageAccess.getInstance()
|
134
|
.getAppDatabase()
|
125
|
.getAppDatabase()
|
135
|
.loadLatestTaskResult(CONSENT);
|
126
|
.loadLatestTaskResult(CONSENT);
|
136
|
-
|
|
|
137
|
String signatureBase64 = (String) taskResult.getStepResult(SIGNATURE)
|
127
|
String signatureBase64 = (String) taskResult.getStepResult(SIGNATURE)
|
138
|
.getResultForIdentifier(ConsentSignatureStepLayout.KEY_SIGNATURE);
|
128
|
.getResultForIdentifier(ConsentSignatureStepLayout.KEY_SIGNATURE);
|
139
|
|
129
|
|
|
|
130
|
+ // Get signature date
|
140
|
String signatureDate = (String) result.getStepResult(SIGNATURE)
|
131
|
String signatureDate = (String) result.getStepResult(SIGNATURE)
|
141
|
.getResultForIdentifier(ConsentSignatureStepLayout.KEY_SIGNATURE_DATE);
|
132
|
.getResultForIdentifier(ConsentSignatureStepLayout.KEY_SIGNATURE_DATE);
|
142
|
|
133
|
|
|
|
134
|
+ // Use signature to get encoded consent form
|
143
|
byte[] signatureBytes = Base64.decode(signatureBase64, Base64.DEFAULT);
|
135
|
byte[] signatureBytes = Base64.decode(signatureBase64, Base64.DEFAULT);
|
144
|
-
|
|
|
145
|
String consentFormBase64 = createPdf(signatureBytes, signatureDate);
|
136
|
String consentFormBase64 = createPdf(signatureBytes, signatureDate);
|
146
|
|
137
|
|
147
|
-
|
|
|
148
|
- JSONObject signature = new JSONObject();
|
|
|
149
|
- try {
|
|
|
150
|
- signature.put("signaturePDFBase64", consentFormBase64);
|
|
|
151
|
- signature.put("signatureDate", signatureDate);
|
|
|
152
|
- signature.put("token", GlobalValues.getInstance().getDeviceToken()); // FirebaseInstanceId.getInstance().getToken()
|
|
|
153
|
-
|
|
|
154
|
- } catch (JSONException e) {
|
|
|
155
|
- e.printStackTrace();
|
|
|
156
|
- }
|
|
|
157
|
-
|
|
|
158
|
- Log.d("CONSENT JSON", signature.toString());
|
|
|
|
|
138
|
+ // Send JSON with consent form, signature date, and token
|
|
|
139
|
+ JSONObject signatureJSON = new JSONObject();
|
|
|
140
|
+ signatureJSON.put("signaturePDFBase64", consentFormBase64);
|
|
|
141
|
+ signatureJSON.put("signatureDate", signatureDate);
|
|
|
142
|
+ signatureJSON.put("token", GlobalValues.getInstance().getDeviceToken()); // FirebaseInstanceId.getInstance().getToken()
|
|
|
143
|
+ Log.d("CONSENT JSON", signatureJSON.toString()); // log
|
159
|
SendConsentForm sendConsentForm = new SendConsentForm();
|
144
|
SendConsentForm sendConsentForm = new SendConsentForm();
|
160
|
- sendConsentForm.execute(signature.toString());
|
|
|
|
|
145
|
+ sendConsentForm.execute(signatureJSON.toString());
|
161
|
|
146
|
|
|
|
147
|
+ // Save consent signature and date separately on preferences
|
162
|
SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
|
148
|
SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
|
163
|
SharedPreferences.Editor editor = prefs.edit();
|
149
|
SharedPreferences.Editor editor = prefs.edit();
|
164
|
editor.putString("consentSignature", signatureBase64);
|
150
|
editor.putString("consentSignature", signatureBase64);
|
165
|
editor.putString("consentDate", signatureDate);
|
151
|
editor.putString("consentDate", signatureDate);
|
166
|
editor.apply();
|
152
|
editor.apply();
|
167
|
|
153
|
|
|
|
154
|
+ // Prompt user to register as student
|
168
|
Intent registration = new Intent(this, RegisterActivity.class);
|
155
|
Intent registration = new Intent(this, RegisterActivity.class);
|
169
|
startActivity(registration);
|
156
|
startActivity(registration);
|
|
|
157
|
+
|
|
|
158
|
+ } catch (JSONException e) {
|
|
|
159
|
+ Log.e(TAG, "Couldn't prepare consent form JSON!");
|
|
|
160
|
+ e.printStackTrace();
|
170
|
} catch (Exception e) {
|
161
|
} catch (Exception e) {
|
171
|
- Log.e("CONSENT ERROR", e.getMessage());
|
|
|
|
|
162
|
+ Log.e(TAG, "Error on processConsentResult(): " + e.getMessage());
|
|
|
163
|
+ e.printStackTrace();
|
172
|
}
|
164
|
}
|
173
|
}
|
165
|
}
|
|
|
166
|
+
|
174
|
}
|
167
|
}
|
175
|
|
168
|
|
176
|
|
169
|
|
177
|
private void launchConsent() {
|
170
|
private void launchConsent() {
|
178
|
- ConsentDocument document = new ConsentDocument();
|
|
|
179
|
- document.setTitle("TANIA Consent");
|
|
|
180
|
- document.setSignaturePageTitle(R.string.rsb_consent);
|
|
|
181
|
|
171
|
|
182
|
- // Create consent visual sections
|
|
|
|
|
172
|
+
|
|
|
173
|
+ // Consent Section 1 - Overview (Welcome)
|
183
|
ConsentSection section1 = new ConsentSection(ConsentSection.Type.Overview);
|
174
|
ConsentSection section1 = new ConsentSection(ConsentSection.Type.Overview);
|
184
|
- section1.setTitle("Welcome");
|
|
|
185
|
- section1.setSummary("You have been invited to participate in this study whose objectives are" +
|
|
|
186
|
- " (1) to develop and demonstrate the utility of a mobile application (TANIA) " +
|
|
|
187
|
- "to collect perception data of students participating in research experiences " +
|
|
|
188
|
- "and (2) to use TANIA to determine the sources of self-efficacy that lead to " +
|
|
|
189
|
- "career exploration and decision-making in undergraduate students.");
|
|
|
|
|
175
|
+ section1.setTitle(getString(R.string.overviewTitleText));
|
|
|
176
|
+ section1.setSummary(getString(R.string.overviewConsentSectionSummaryText));
|
|
|
177
|
+ section1.setContent(getString(R.string.overviewConsentSectionContentText));
|
190
|
|
178
|
|
191
|
- section1.setContent("This study is been carried out under the supervision of Dr. Juan S. Ramírez Lugo," +
|
|
|
192
|
- " Department of Biology and Dr. Carlos Corrada Bravo, Department of Computer Sciences" +
|
|
|
193
|
- " at the University of Puerto Rico, Rio Piedras Campus. You were selected to participate " +
|
|
|
194
|
- "in this study because you are enrolled in a course that offers a research experience " +
|
|
|
195
|
- "or you voluntarily participate in research with a professor affiliated to the Río Piedras" +
|
|
|
196
|
- " Campus. ");
|
|
|
|
|
179
|
+ ConsentVisualStep visualStep1 = new ConsentVisualStep(VISUAL_CONSENT_IDENTIFIER);
|
|
|
180
|
+ visualStep1.setStepTitle(R.string.rsb_consent);
|
|
|
181
|
+ visualStep1.setSection(section1);
|
|
|
182
|
+ visualStep1.setNextButtonString("Next");
|
197
|
|
183
|
|
198
|
|
184
|
|
|
|
185
|
+ // Consent Section 2 - Time Commitment
|
199
|
ConsentSection section2 = new ConsentSection(ConsentSection.Type.TimeCommitment);
|
186
|
ConsentSection section2 = new ConsentSection(ConsentSection.Type.TimeCommitment);
|
200
|
- section2.setTitle("Time Commitment");
|
|
|
201
|
- section2.setSummary("In the study you will be asked to answer a questionnaire, about your perception of self-efficacy" +
|
|
|
202
|
- " in research, scientific identity and decision-making about your professional career at the beginning" +
|
|
|
203
|
- " and end of your research experience. It will take you between 10-20 minutes to answer this questionnaire.");
|
|
|
204
|
- section2.setContent("You are also expected to respond to short questionnaires between 1-3 times per week while you are participating" +
|
|
|
205
|
- " in the research. You will receive notifications at random times during your research experience and answer " +
|
|
|
206
|
- "questions adapted from survey instruments that have been previously validated. It will take you between " +
|
|
|
207
|
- "1-3 minutes to answer these questionnaires. It is expected that 25 students will participate in this phase " +
|
|
|
208
|
- "of the study.");
|
|
|
209
|
-
|
|
|
210
|
- ConsentSection section3 = new ConsentSection(ConsentSection.Type.DataGathering);
|
|
|
211
|
- section3.setTitle("Data Gathering");
|
|
|
212
|
- section3.setSummary("While answering the questions, you may feel uncomfortable because the questions " +
|
|
|
213
|
- "are about your general opinion about science and research and your career. If you feel " +
|
|
|
214
|
- "uncomfortable with the questions, you can stop and choose not to answer the question.");
|
|
|
215
|
-
|
|
|
216
|
- section3.setContent("In addition, when you download the application, it will occupy space in the memory " +
|
|
|
217
|
- "of your mobile device and also consume your data plan in the transmission of information when you " +
|
|
|
218
|
- "answer the questionnaires. It is estimated that the application will have a size of 40 Mb " +
|
|
|
219
|
- "(As reference the WhatsApp application is 88.9 Mb). Although at the moment we cannot say exactly " +
|
|
|
220
|
- "how much memory or data you will consume, we understand that both will be minimal. The risks of this" +
|
|
|
221
|
- " study are minimal. ");
|
|
|
222
|
-
|
|
|
223
|
- ConsentSection section4 = new ConsentSection(ConsentSection.Type.Privacy);
|
|
|
224
|
- section4.setTitle("Privacy");
|
|
|
225
|
- section4.setSummary("Your identity will be protected throughout the study. Your identifiable information " +
|
|
|
226
|
- "will be handled confidentially and when presenting the results of the investigation you will not " +
|
|
|
227
|
- "be identified.");
|
|
|
228
|
-
|
|
|
229
|
- section4.setContent("The information you issue through the application will be through access credentials " +
|
|
|
230
|
- "(username and password) that only you will know. These access credentials will be encrypted and any " +
|
|
|
231
|
- "subsequent association between you and your data will be made by reference to the encrypted " +
|
|
|
232
|
- "information, not your personal identity. The data collected through the questionnaires will " +
|
|
|
233
|
- "be stored digitally on a secure hard drive in the researcher's office. These data will also be stored " +
|
|
|
234
|
- "virtually in the cloud, with access limited only to researchers.");
|
|
|
235
|
-
|
|
|
236
|
- ConsentSection section5 = new ConsentSection(ConsentSection.Type.DataUse);
|
|
|
237
|
- section5.setTitle("Use of Data");
|
|
|
238
|
- section5.setSummary("The data obtained will be used to improve academic offerings and research experiences. " +
|
|
|
239
|
- "The results of this study may be part of a scientific publication on science education strategies and " +
|
|
|
240
|
- "will serve as a basis to improve the teaching curriculum. ");
|
|
|
241
|
- section5.setContent("It may be used to develop proposals for obtaining external funds for research. The officials " +
|
|
|
242
|
- "of the Rio Piedras Campus of the University of Puerto Rico and / or federal agencies responsible for ensuring " +
|
|
|
243
|
- "the integrity of the research may require the researcher to prove the data obtained in this study, including " +
|
|
|
244
|
- "this informed consent.\n" + "\n" + "The information handled by your device can be intervened or revised by " +
|
|
|
245
|
- "third parties. These people can be people with legitimate or illegitimate access to the device and its content " +
|
|
|
246
|
- "such as a family member, employer, hackers, intruders, etc. In addition, the device that you use may keep track " +
|
|
|
247
|
- "of the information you access or send over the Internet.\n");
|
|
|
248
|
-
|
|
|
249
|
- // ...add more sections as needed, then create a visual consent step
|
|
|
250
|
- ConsentVisualStep visualStep = new ConsentVisualStep(VISUAL_CONSENT_IDENTIFIER);
|
|
|
251
|
- visualStep.setStepTitle(R.string.rsb_consent);
|
|
|
252
|
- visualStep.setSection(section1);
|
|
|
253
|
- visualStep.setNextButtonString("Next");
|
|
|
254
|
-
|
|
|
|
|
187
|
+ section2.setTitle(getString(R.string.timeCommitmentTitleText));
|
|
|
188
|
+ section2.setSummary(getString(R.string.timeCommitmentConsentSectionSummaryText));
|
|
|
189
|
+ section2.setContent(getString(R.string.timeCommitmentConsentSectionContentText));
|
255
|
|
190
|
|
256
|
ConsentVisualStep visualStep2 = new ConsentVisualStep("visual_step_2");
|
191
|
ConsentVisualStep visualStep2 = new ConsentVisualStep("visual_step_2");
|
257
|
visualStep2.setStepTitle(R.string.rsb_consent);
|
192
|
visualStep2.setStepTitle(R.string.rsb_consent);
|
|
|
|
|
259
|
visualStep2.setNextButtonString("Next");
|
194
|
visualStep2.setNextButtonString("Next");
|
260
|
|
195
|
|
261
|
|
196
|
|
|
|
197
|
+ // Consent Section 3 - Data Gathering
|
|
|
198
|
+ ConsentSection section3 = new ConsentSection(ConsentSection.Type.DataGathering);
|
|
|
199
|
+ section3.setTitle(getString(R.string.dataGatheringTitleText));
|
|
|
200
|
+ section3.setSummary(getString(R.string.dataGatheringConsentSectionSummaryText));
|
|
|
201
|
+ section3.setContent(getString(R.string.dataGatheringConsentSectionContentText));
|
|
|
202
|
+
|
262
|
ConsentVisualStep visualStep3 = new ConsentVisualStep("visual_step_3");
|
203
|
ConsentVisualStep visualStep3 = new ConsentVisualStep("visual_step_3");
|
263
|
visualStep3.setStepTitle(R.string.rsb_consent);
|
204
|
visualStep3.setStepTitle(R.string.rsb_consent);
|
264
|
visualStep3.setSection(section3);
|
205
|
visualStep3.setSection(section3);
|
265
|
visualStep3.setNextButtonString("Next");
|
206
|
visualStep3.setNextButtonString("Next");
|
266
|
|
207
|
|
267
|
|
208
|
|
|
|
209
|
+ // Consent Section 4 - Privacy
|
|
|
210
|
+ ConsentSection section4 = new ConsentSection(ConsentSection.Type.Privacy);
|
|
|
211
|
+ section4.setTitle(getString(R.string.privacyTitleText));
|
|
|
212
|
+ section4.setSummary(getString(R.string.privacyConsentSectionSummaryText));
|
|
|
213
|
+ section4.setContent(getString(R.string.privacyConsentSectionContentText));
|
|
|
214
|
+
|
268
|
ConsentVisualStep visualStep4 = new ConsentVisualStep("visual_step_4");
|
215
|
ConsentVisualStep visualStep4 = new ConsentVisualStep("visual_step_4");
|
269
|
visualStep4.setStepTitle(R.string.rsb_consent);
|
216
|
visualStep4.setStepTitle(R.string.rsb_consent);
|
270
|
visualStep4.setSection(section4);
|
217
|
visualStep4.setSection(section4);
|
271
|
visualStep4.setNextButtonString("Next");
|
218
|
visualStep4.setNextButtonString("Next");
|
272
|
|
219
|
|
273
|
|
220
|
|
|
|
221
|
+ // Consent Section 5 - Data Use
|
|
|
222
|
+ ConsentSection section5 = new ConsentSection(ConsentSection.Type.DataUse);
|
|
|
223
|
+ section5.setTitle(getString(R.string.dataUseTitleText));
|
|
|
224
|
+ section5.setSummary(getString(R.string.dataUseConsentSectionSummaryText));
|
|
|
225
|
+ section5.setContent(getString(R.string.dataUseConsentSectionContentText));
|
|
|
226
|
+
|
274
|
ConsentVisualStep visualStep5 = new ConsentVisualStep("visual_step_5");
|
227
|
ConsentVisualStep visualStep5 = new ConsentVisualStep("visual_step_5");
|
275
|
visualStep5.setStepTitle(R.string.rsb_consent);
|
228
|
visualStep5.setStepTitle(R.string.rsb_consent);
|
276
|
visualStep5.setSection(section5);
|
229
|
visualStep5.setSection(section5);
|
|
|
|
|
282
|
signature.setRequiresName(true);
|
235
|
signature.setRequiresName(true);
|
283
|
signature.setRequiresSignatureImage(true);
|
236
|
signature.setRequiresSignatureImage(true);
|
284
|
|
237
|
|
|
|
238
|
+
|
285
|
// Create our HTML to show the user and have them accept or decline.
|
239
|
// Create our HTML to show the user and have them accept or decline.
|
286
|
- StringBuilder docBuilder = new StringBuilder(
|
|
|
287
|
- "</br><div style=\"padding: 10px 10px 10px 10px;\" class='header'>");
|
|
|
288
|
- String title = getString(R.string.rsb_consent_review_title);
|
|
|
289
|
- docBuilder.append(String.format(
|
|
|
290
|
- "<h1 style=\"text-align: center; font-family:sans-serif-light;\">%1$s</h1>",
|
|
|
291
|
- title));
|
|
|
292
|
- String detail = getString(R.string.rsb_consent_review_instruction);
|
|
|
293
|
- docBuilder.append(String.format("<p style=\"text-align: center\">%1$s</p>", detail));
|
|
|
294
|
- docBuilder.append("</div></br>");
|
|
|
295
|
- docBuilder.append("<div> <h2> Welcome </h2>\n" +
|
|
|
296
|
- "<p align='justify'> You have been invited to participate in this study whose objectives are (1) " +
|
|
|
297
|
- "to develop and demonstrate the utility of a mobile application (TANIA) to collect " +
|
|
|
298
|
- "perception data of students participating in research experiences and (2) to use " +
|
|
|
299
|
- "TANIA to determine the sources of self-efficacy that lead to career exploration " +
|
|
|
300
|
- "and decision-making in undergraduate students. This study is been carried out " +
|
|
|
301
|
- "under the supervision of Dr. Juan S. Ramirez Lugo, Department of Biology and " +
|
|
|
302
|
- "Dr. Carlos Corrada Bravo, Department of Computer Sciences at the University of " +
|
|
|
303
|
- "Puerto Rico, Rio Piedras Campus. You were selected to participate in this study " +
|
|
|
304
|
- "because you are enrolled in a course that offers a research experience or you " +
|
|
|
305
|
- "voluntarily participate in research with a professor affiliated to the " +
|
|
|
306
|
- "Rio Piedras Campus. </p> " +
|
|
|
307
|
- "\n" +
|
|
|
308
|
- "<h2> Time Commitment </h2> " +
|
|
|
309
|
- "<p align='justify'> In the study you will be asked to answer a questionnaire, about your " +
|
|
|
310
|
- "perception of self-efficacy in research, scientific identity and decision-making " +
|
|
|
311
|
- "about your professional career at the beginning and end of your research experience. " +
|
|
|
312
|
- "It will take you between 10-20 minutes to answer this questionnaire. You are " +
|
|
|
313
|
- "also expected to respond to short questionnaires between 1-3 times per week " +
|
|
|
314
|
- "while you are participating in the research. You will receive notifications at " +
|
|
|
315
|
- "random times during your research experience and answer questions adapted from " +
|
|
|
316
|
- "survey instruments that have been previously validated. It will take you between " +
|
|
|
317
|
- "1-3 minutes to answer these questionnaires. It is expected that 25 students will " +
|
|
|
318
|
- "participate in this phase of the study.</p> " +
|
|
|
319
|
- "\n" +
|
|
|
320
|
- "<h2> Data Gathering </h2> " +
|
|
|
321
|
- "<p align='justify'> While answering the questions, you may feel uncomfortable because " +
|
|
|
322
|
- "the questions are about your general opinion about science and research and your career. " +
|
|
|
323
|
- "If you feel uncomfortable with the questions, you can stop and choose not to answer the question. " +
|
|
|
324
|
- "When you download the application, it will occupy space in the memory of your mobile device and " +
|
|
|
325
|
- "also consume your data plan in the transmission of information when you answer the questionnaires. " +
|
|
|
326
|
- "It is estimated that the application will have a size of 40 Mb (As reference the WhatsApp " +
|
|
|
327
|
- "application is 88.9 Mb). Although at the moment we cannot say exactly how much memory or " +
|
|
|
328
|
- "data you will consume, we understand that both will be minimal. The risks of this study " +
|
|
|
329
|
- "are minimal. </p> " +
|
|
|
330
|
- "\n" +
|
|
|
331
|
- "<h2> Privacy </h2> " +
|
|
|
332
|
- "<p align='justify'> Your identity will be protected throughout the study. Your identifiable " +
|
|
|
333
|
- "information will be handled confidentially and when presenting the results of " +
|
|
|
334
|
- "the investigation you will not be identified. The information you issue through " +
|
|
|
335
|
- "the application will be through access credentials (username and password) that " +
|
|
|
336
|
- "only you will know. These access credentials will be encrypted and any subsequent " +
|
|
|
337
|
- "association between you and your data will be made by reference to the encrypted " +
|
|
|
338
|
- "information, not your personal identity. The data collected through the " +
|
|
|
339
|
- "questionnaires will be stored digitally on a secure hard drive in the researcher's " +
|
|
|
340
|
- "office. These data will also be stored virtually in the cloud, with access limited " +
|
|
|
341
|
- "only to researchers. </p> " +
|
|
|
342
|
- "\n" +
|
|
|
343
|
- "<h2> Use of Data </h2> " +
|
|
|
344
|
- "<p align='justify'> The data obtained will be used to improve academic offerings and research " +
|
|
|
345
|
- "experiences. The results of this study may be part of a scientific publication " +
|
|
|
346
|
- "on science education strategies and will serve as a basis to improve the teaching " +
|
|
|
347
|
- "curriculum. It may be used to develop proposals for obtaining external funds for " +
|
|
|
348
|
- "research. The officials of the Rio Piedras Campus of the University of Puerto Rico " +
|
|
|
349
|
- "and / or federal agencies responsible for ensuring the integrity of the research " +
|
|
|
350
|
- "may require the researcher to prove the data obtained in this study, including " +
|
|
|
351
|
- "this informed consent. </p> " +
|
|
|
352
|
- "\n" +
|
|
|
353
|
- "<h2> General </h2> " +
|
|
|
354
|
- "<p align ='justify'> If you decide to participate in this study, understand that your participation " +
|
|
|
355
|
- "is completely voluntary and that you have the right to abstain from participating or even withdraw at " +
|
|
|
356
|
- "any time of the study without incurring in any penalty. In the application you will find the instructions " +
|
|
|
357
|
- "to withdraw from the study and stop receiving notifications if you wish. You also have the right not to " +
|
|
|
358
|
- "answer any question if you wish. Your participation in this study will not affect in any way your academic " +
|
|
|
359
|
- "evaluation in the courses in which you are carrying out this research. Finally, you have the right to " +
|
|
|
360
|
- "receive a copy of this document.\n" +
|
|
|
361
|
- "\n" + "If you have any questions or would like more information about this study, please contact " +
|
|
|
362
|
- "Prof. Ramirez Lugo at 787-764-0000 Ext. 88068, at 787-918-5330 or by email at juan.ramirez3@upr.edu " +
|
|
|
363
|
- "at any moment. If you have any questions about your rights as a participant or claim or complaint related " +
|
|
|
364
|
- "to your participation in this study, you may contact the Compliance Officer of the R’o Piedras Campus of " +
|
|
|
365
|
- "the University of Puerto Rico, at telephone 764-0000, extension 86773 or cipshi. degi@upr.edu.\n" +
|
|
|
366
|
- "\n" +
|
|
|
367
|
- "Your signature on this document means that you have decided to participate voluntarily, that the information " +
|
|
|
368
|
- "presented on this Consent Sheet has been discussed and that you have received a copy of this document. " +
|
|
|
369
|
- "This printed sheet will be stored under lock and key for a period of 5 years after completion of the " +
|
|
|
370
|
- "investigation and will then be shredded and discarded.</div>");
|
|
|
371
|
-
|
|
|
372
|
- // Create the Consent doc step, pass in our HTML doc
|
|
|
|
|
240
|
+ String consentHtmlString =
|
|
|
241
|
+
|
|
|
242
|
+ "<br>" +
|
|
|
243
|
+
|
|
|
244
|
+ "<div style='padding: 10px;' class='header'>" +
|
|
|
245
|
+ "<h1 style='text-align: center; font-family:sans-serif-light;'>" + getString(R.string.rsb_consent_review_title) + "</h1>" +
|
|
|
246
|
+ "<p style='text-align: center'>" + getString(R.string.rsb_consent_review_instruction) + "</p>" +
|
|
|
247
|
+ "</div>" +
|
|
|
248
|
+
|
|
|
249
|
+ "<br>" +
|
|
|
250
|
+
|
|
|
251
|
+ "<div>" +
|
|
|
252
|
+ "<h2>" + getString(R.string.overviewTitleText) + "</h2>" +
|
|
|
253
|
+ "<p align='justify'>" + getString(R.string.consentOverview) + "</p>" +
|
|
|
254
|
+
|
|
|
255
|
+ "<h2>" + getString(R.string.timeCommitmentTitleText) + "</h2>" +
|
|
|
256
|
+ "<p align='justify'>" + getString(R.string.consentTimeCommitment) + "</p>" +
|
|
|
257
|
+
|
|
|
258
|
+ "<h2>" + getString(R.string.dataGatheringTitleText) + "</h2>" +
|
|
|
259
|
+ "<p align='justify'>" + getString(R.string.consentDataGathering) + "</p>" +
|
|
|
260
|
+
|
|
|
261
|
+ "<h2>" + getString(R.string.privacyTitleText) + "</h2>" +
|
|
|
262
|
+ "<p align='justify'>" + getString(R.string.consentPrivacy) + "</p>" +
|
|
|
263
|
+
|
|
|
264
|
+ "<h2>" + getString(R.string.dataUseTitleText) + "</h2>" +
|
|
|
265
|
+ "<p align='justify'>" + getString(R.string.consentDataUse) + "</p>" +
|
|
|
266
|
+
|
|
|
267
|
+ "<h2>" + getString(R.string.generalTitleText) + "</h2>" +
|
|
|
268
|
+ "<p align='justify'>" + getString(R.string.consentGeneral) + "</p>" +
|
|
|
269
|
+ "<p align='justify'>" + getString(R.string.consentConclusion) + "</p>" +
|
|
|
270
|
+ "</div>";
|
|
|
271
|
+
|
|
|
272
|
+
|
|
|
273
|
+ // Create the consent document step and pass in our HTML
|
373
|
ConsentDocumentStep documentStep = new ConsentDocumentStep(CONSENT_DOC);
|
274
|
ConsentDocumentStep documentStep = new ConsentDocumentStep(CONSENT_DOC);
|
374
|
- documentStep.setConsentHTML(docBuilder.toString());
|
|
|
|
|
275
|
+ documentStep.setConsentHTML(consentHtmlString);
|
375
|
documentStep.setConfirmMessage(getString(R.string.rsb_consent_review_reason));
|
276
|
documentStep.setConfirmMessage(getString(R.string.rsb_consent_review_reason));
|
376
|
|
277
|
|
|
|
278
|
+
|
377
|
// Create Consent form step, to get users first & last name
|
279
|
// Create Consent form step, to get users first & last name
|
378
|
// FormStep formStep = new FormStep(SIGNATURE_FORM_STEP,
|
280
|
// FormStep formStep = new FormStep(SIGNATURE_FORM_STEP,
|
379
|
// "Form Title",
|
281
|
// "Form Title",
|
|
|
|
|
386
|
// QuestionStep fullName = new QuestionStep(NAME, "Full name", format);
|
288
|
// QuestionStep fullName = new QuestionStep(NAME, "Full name", format);
|
387
|
// formStep.setFormSteps(Collections.singletonList(fullName));
|
289
|
// formStep.setFormSteps(Collections.singletonList(fullName));
|
388
|
|
290
|
|
389
|
- // Create Consent signature step, user can sign their name
|
|
|
|
|
291
|
+
|
|
|
292
|
+ // Create the consent signature step (so that user can sign)
|
390
|
ConsentSignatureStep signatureStep = new ConsentSignatureStep(SIGNATURE);
|
293
|
ConsentSignatureStep signatureStep = new ConsentSignatureStep(SIGNATURE);
|
391
|
signatureStep.setStepTitle(R.string.rsb_consent);
|
294
|
signatureStep.setStepTitle(R.string.rsb_consent);
|
392
|
signatureStep.setTitle(getString(R.string.rsb_consent_signature_title));
|
295
|
signatureStep.setTitle(getString(R.string.rsb_consent_signature_title));
|
|
|
|
|
395
|
signatureStep.setOptional(false);
|
298
|
signatureStep.setOptional(false);
|
396
|
signatureStep.setStepLayoutClass(ConsentSignatureStepLayout.class);
|
299
|
signatureStep.setStepLayoutClass(ConsentSignatureStepLayout.class);
|
397
|
|
300
|
|
|
|
301
|
+
|
|
|
302
|
+ // Create consent document
|
|
|
303
|
+ ConsentDocument document = new ConsentDocument();
|
|
|
304
|
+ document.setTitle(getString(R.string.appName) + " Consent");
|
|
|
305
|
+ document.setSignaturePageTitle(R.string.rsb_consent);
|
|
|
306
|
+ document.addSignature(signature);
|
|
|
307
|
+ document.getHtmlReviewContent();
|
|
|
308
|
+
|
|
|
309
|
+
|
398
|
// Finally, create and present a task including these steps.
|
310
|
// Finally, create and present a task including these steps.
|
399
|
Task consentTask = new OrderedTask(CONSENT,
|
311
|
Task consentTask = new OrderedTask(CONSENT,
|
400
|
- visualStep,
|
|
|
|
|
312
|
+ visualStep1,
|
401
|
visualStep2,
|
313
|
visualStep2,
|
402
|
visualStep3,
|
314
|
visualStep3,
|
403
|
visualStep4,
|
315
|
visualStep4,
|
|
|
|
|
406
|
// formStep,
|
318
|
// formStep,
|
407
|
signatureStep);
|
319
|
signatureStep);
|
408
|
|
320
|
|
409
|
- document.addSignature(signature);
|
|
|
410
|
- document.getHtmlReviewContent();
|
|
|
411
|
|
321
|
|
412
|
// Launch using the ViewTaskActivity and make sure to listen for the activity result
|
322
|
// Launch using the ViewTaskActivity and make sure to listen for the activity result
|
413
|
Intent intent = ViewTaskActivity.newIntent(this, consentTask);
|
323
|
Intent intent = ViewTaskActivity.newIntent(this, consentTask);
|
|
|
|
|
418
|
|
328
|
|
419
|
private String createPdf(byte[] signatureBytes, String consentDate) {
|
329
|
private String createPdf(byte[] signatureBytes, String consentDate) {
|
420
|
|
330
|
|
421
|
- Document document = new Document();
|
|
|
422
|
- String consentBase64 = null;
|
|
|
423
|
try {
|
331
|
try {
|
424
|
- String directory_path = Environment.getExternalStorageDirectory().getPath() + "/consent-tania-app.pdf";
|
|
|
425
|
|
332
|
|
426
|
- PdfWriter.getInstance(document, new FileOutputStream(directory_path));
|
|
|
|
|
333
|
+ // Open document
|
|
|
334
|
+ Document document = new Document();
|
|
|
335
|
+ String filePath = Environment.getExternalStorageDirectory().getPath() + getString(R.string.consentFileName);
|
|
|
336
|
+ PdfWriter.getInstance(document, new FileOutputStream(filePath));
|
427
|
document.open();
|
337
|
document.open();
|
428
|
|
338
|
|
|
|
339
|
+
|
|
|
340
|
+ // Define fonts and offsets
|
429
|
Font titleFont = new Font(Font.FontFamily.HELVETICA, 20, Font.BOLD, BaseColor.BLACK);
|
341
|
Font titleFont = new Font(Font.FontFamily.HELVETICA, 20, Font.BOLD, BaseColor.BLACK);
|
430
|
- Chunk titleChunk = new Chunk("Consent form:\nTANIA", titleFont);
|
|
|
|
|
342
|
+ Font subtitleFont = new Font(Font.FontFamily.HELVETICA, 14, Font.BOLD, BaseColor.BLACK);
|
|
|
343
|
+ Font signatureSectionFont = new Font(Font.FontFamily.HELVETICA, 12, Font.BOLDITALIC, BaseColor.BLACK);
|
|
|
344
|
+ int signatureOffsetX = 145;
|
|
|
345
|
+ int signatureOffsetY = -24;
|
|
|
346
|
+
|
|
|
347
|
+
|
|
|
348
|
+ // Consent Title
|
|
|
349
|
+ Chunk titleChunk = new Chunk("Consent form:\n" + getString(R.string.appName), titleFont);
|
431
|
Paragraph title = new Paragraph(titleChunk);
|
350
|
Paragraph title = new Paragraph(titleChunk);
|
432
|
title.setAlignment(Element.ALIGN_CENTER);
|
351
|
title.setAlignment(Element.ALIGN_CENTER);
|
433
|
document.add(title);
|
352
|
document.add(title);
|
434
|
|
353
|
|
435
|
- Paragraph newLine = new Paragraph("\n");
|
|
|
|
|
354
|
+ Paragraph newLine = new Paragraph("\n"); // TODO: find out if this is necessary
|
436
|
document.add(newLine);
|
355
|
document.add(newLine);
|
437
|
|
356
|
|
438
|
- String consentIntro = "You have been invited to participate in this study whose objectives are (1) " +
|
|
|
439
|
- "to develop and demonstrate the utility of a mobile application (TANIA) to collect " +
|
|
|
440
|
- "perception data of students participating in research experiences and (2) to use " +
|
|
|
441
|
- "TANIA to determine the sources of self-efficacy that lead to career exploration " +
|
|
|
442
|
- "and decision-making in undergraduate students. This study is been carried out " +
|
|
|
443
|
- "under the supervision of Dr. Juan S. Ramirez Lugo, Department of Biology and " +
|
|
|
444
|
- "Dr. Carlos Corrada Bravo, Department of Computer Sciences at the University of " +
|
|
|
445
|
- "Puerto Rico, Rio Piedras Campus. You were selected to participate in this study " +
|
|
|
446
|
- "because you are enrolled in a course that offers a research experience or you " +
|
|
|
447
|
- "voluntarily participate in research with a professor affiliated to the " +
|
|
|
448
|
- "Rio Piedras Campus. \n\n";
|
|
|
449
|
- Paragraph paragraph1 = new Paragraph(consentIntro);
|
|
|
|
|
357
|
+
|
|
|
358
|
+ // Consent Section 1 - Overview (Welcome)
|
|
|
359
|
+ String consentOverview = getString(R.string.consentOverview);
|
|
|
360
|
+ Paragraph paragraph1 = new Paragraph(consentOverview);
|
450
|
paragraph1.setAlignment(Element.ALIGN_JUSTIFIED);
|
361
|
paragraph1.setAlignment(Element.ALIGN_JUSTIFIED);
|
451
|
document.add(paragraph1);
|
362
|
document.add(paragraph1);
|
452
|
|
363
|
|
453
|
|
364
|
|
454
|
- Font subTitlesFont = new Font(Font.FontFamily.HELVETICA, 14, Font.BOLD, BaseColor.BLACK);
|
|
|
455
|
- Chunk subtitle1 = new Chunk("Time Commitment", subTitlesFont);
|
|
|
|
|
365
|
+ // Consent Section 2 - Time Commitment
|
|
|
366
|
+ Chunk subtitle1 = new Chunk(getString(R.string.timeCommitmentTitleText), subtitleFont);
|
456
|
Paragraph timeCommitmentTitle = new Paragraph(subtitle1);
|
367
|
Paragraph timeCommitmentTitle = new Paragraph(subtitle1);
|
457
|
document.add(timeCommitmentTitle);
|
368
|
document.add(timeCommitmentTitle);
|
458
|
|
369
|
|
459
|
- String consentTimeCommitment = "In the study you will be asked to answer a questionnaire, about your " +
|
|
|
460
|
- "perception of self-efficacy in research, scientific identity and decision-making " +
|
|
|
461
|
- "about your professional career at the beginning and end of your research experience. " +
|
|
|
462
|
- "It will take you between 10-20 minutes to answer this questionnaire. You are " +
|
|
|
463
|
- "also expected to respond to short questionnaires between 1-3 times per week " +
|
|
|
464
|
- "while you are participating in the research. You will receive notifications at " +
|
|
|
465
|
- "random times during your research experience and answer questions adapted from " +
|
|
|
466
|
- "survey instruments that have been previously validated. It will take you between " +
|
|
|
467
|
- "1-3 minutes to answer these questionnaires. It is expected that 25 students will " +
|
|
|
468
|
- "participate in this phase of the study.\n ";
|
|
|
|
|
370
|
+ String consentTimeCommitment = getString(R.string.consentTimeCommitment);
|
469
|
Paragraph paragraph2 = new Paragraph(consentTimeCommitment);
|
371
|
Paragraph paragraph2 = new Paragraph(consentTimeCommitment);
|
470
|
paragraph2.setAlignment(Element.ALIGN_JUSTIFIED);
|
372
|
paragraph2.setAlignment(Element.ALIGN_JUSTIFIED);
|
471
|
document.add(paragraph2);
|
373
|
document.add(paragraph2);
|
472
|
|
374
|
|
473
|
- Chunk subtitle2 = new Chunk("Data Gathering", subTitlesFont);
|
|
|
|
|
375
|
+
|
|
|
376
|
+ // Consent Section 3 - Data Gathering
|
|
|
377
|
+ Chunk subtitle2 = new Chunk(getString(R.string.dataGatheringTitleText), subtitleFont);
|
474
|
Paragraph dataGatheringTitle = new Paragraph(subtitle2);
|
378
|
Paragraph dataGatheringTitle = new Paragraph(subtitle2);
|
475
|
document.add(dataGatheringTitle);
|
379
|
document.add(dataGatheringTitle);
|
476
|
|
380
|
|
477
|
- String consentDataGathering = "While answering the questions, you may feel uncomfortable because " +
|
|
|
478
|
- "the questions are about your general opinion about science and research and your career. " +
|
|
|
479
|
- "If you feel uncomfortable with the questions, you can stop and choose not to answer the question. " +
|
|
|
480
|
- "When you download the application, it will occupy space in the memory of your mobile device and " +
|
|
|
481
|
- "also consume your data plan in the transmission of information when you answer the questionnaires. " +
|
|
|
482
|
- "It is estimated that the application will have a size of 40 Mb (As reference the WhatsApp " +
|
|
|
483
|
- "application is 88.9 Mb). Although at the moment we cannot say exactly how much memory or " +
|
|
|
484
|
- "data you will consume, we understand that both will be minimal. The risks of this study " +
|
|
|
485
|
- "are minimal. \n ";
|
|
|
|
|
381
|
+ String consentDataGathering = getString(R.string.consentDataGathering);
|
486
|
Paragraph paragraph3 = new Paragraph(consentDataGathering);
|
382
|
Paragraph paragraph3 = new Paragraph(consentDataGathering);
|
487
|
paragraph3.setAlignment(Element.ALIGN_JUSTIFIED);
|
383
|
paragraph3.setAlignment(Element.ALIGN_JUSTIFIED);
|
488
|
document.add(paragraph3);
|
384
|
document.add(paragraph3);
|
489
|
|
385
|
|
490
|
|
386
|
|
491
|
- Chunk subtitle3 = new Chunk("Privacy", subTitlesFont);
|
|
|
|
|
387
|
+ // Consent Section 4 - Privacy
|
|
|
388
|
+ Chunk subtitle3 = new Chunk(getString(R.string.privacyTitleText), subtitleFont);
|
492
|
Paragraph privacyTitle = new Paragraph(subtitle3);
|
389
|
Paragraph privacyTitle = new Paragraph(subtitle3);
|
493
|
document.add(privacyTitle);
|
390
|
document.add(privacyTitle);
|
494
|
|
391
|
|
495
|
- String consentPrivacy = "Your identity will be protected throughout the study. Your identifiable " +
|
|
|
496
|
- "information will be handled confidentially and when presenting the results of " +
|
|
|
497
|
- "the investigation you will not be identified. The information you issue through " +
|
|
|
498
|
- "the application will be through access credentials (username and password) that " +
|
|
|
499
|
- "only you will know. These access credentials will be encrypted and any subsequent " +
|
|
|
500
|
- "association between you and your data will be made by reference to the encrypted " +
|
|
|
501
|
- "information, not your personal identity. The data collected through the " +
|
|
|
502
|
- "questionnaires will be stored digitally on a secure hard drive in the researcher's " +
|
|
|
503
|
- "office. These data will also be stored virtually in the cloud, with access limited " +
|
|
|
504
|
- "only to researchers. \n\n";
|
|
|
505
|
-
|
|
|
|
|
392
|
+ String consentPrivacy = getString(R.string.consentPrivacy);
|
506
|
Paragraph paragraph4 = new Paragraph(consentPrivacy);
|
393
|
Paragraph paragraph4 = new Paragraph(consentPrivacy);
|
507
|
paragraph4.setAlignment(Element.ALIGN_JUSTIFIED);
|
394
|
paragraph4.setAlignment(Element.ALIGN_JUSTIFIED);
|
508
|
document.add(paragraph4);
|
395
|
document.add(paragraph4);
|
509
|
|
396
|
|
510
|
- Chunk subtitle4 = new Chunk("Use of Data", subTitlesFont);
|
|
|
|
|
397
|
+
|
|
|
398
|
+ // Consent Section 5 - Data Use
|
|
|
399
|
+ Chunk subtitle4 = new Chunk(getString(R.string.dataUseTitleText), subtitleFont);
|
511
|
Paragraph useOfDataTitle = new Paragraph(subtitle4);
|
400
|
Paragraph useOfDataTitle = new Paragraph(subtitle4);
|
512
|
document.add(useOfDataTitle);
|
401
|
document.add(useOfDataTitle);
|
513
|
|
402
|
|
514
|
- String consentUseOfData = "The data obtained will be used to improve academic offerings and research " +
|
|
|
515
|
- "experiences. The results of this study may be part of a scientific publication " +
|
|
|
516
|
- "on science education strategies and will serve as a basis to improve the teaching " +
|
|
|
517
|
- "curriculum. It may be used to develop proposals for obtaining external funds for " +
|
|
|
518
|
- "research. The officials of the Rio Piedras Campus of the University of Puerto Rico " +
|
|
|
519
|
- "and / or federal agencies responsible for ensuring the integrity of the research " +
|
|
|
520
|
- "may require the researcher to prove the data obtained in this study, including " +
|
|
|
521
|
- "this informed consent. \n\n";
|
|
|
522
|
-
|
|
|
|
|
403
|
+ String consentUseOfData = getString(R.string.consentDataUse);
|
523
|
Paragraph paragraph5 = new Paragraph(consentUseOfData);
|
404
|
Paragraph paragraph5 = new Paragraph(consentUseOfData);
|
524
|
paragraph5.setAlignment(Element.ALIGN_JUSTIFIED);
|
405
|
paragraph5.setAlignment(Element.ALIGN_JUSTIFIED);
|
525
|
document.add(paragraph5);
|
406
|
document.add(paragraph5);
|
526
|
|
407
|
|
527
|
- Chunk subtitle5 = new Chunk("General", subTitlesFont);
|
|
|
|
|
408
|
+
|
|
|
409
|
+ // Consent Section 6 - General & Conclusion
|
|
|
410
|
+ Chunk subtitle5 = new Chunk(getString(R.string.generalTitleText), subtitleFont);
|
528
|
Paragraph generalTitle = new Paragraph(subtitle5);
|
411
|
Paragraph generalTitle = new Paragraph(subtitle5);
|
529
|
document.add(generalTitle);
|
412
|
document.add(generalTitle);
|
530
|
|
413
|
|
531
|
- String consentGeneral = "If you decide to participate in this study, understand that your participation " +
|
|
|
532
|
- "is completely voluntary and that you have the right to abstain from participating or even withdraw at " +
|
|
|
533
|
- "any time of the study without incurring in any penalty. In the application you will find the instructions " +
|
|
|
534
|
- "to withdraw from the study and stop receiving notifications if you wish. You also have the right not to " +
|
|
|
535
|
- "answer any question if you wish. Your participation in this study will not affect in any way your academic " +
|
|
|
536
|
- "evaluation in the courses in which you are carrying out this research. Finally, you have the right to " +
|
|
|
537
|
- "receive a copy of this document.\n\n";
|
|
|
538
|
-
|
|
|
|
|
414
|
+ String consentGeneral = getString(R.string.consentGeneral);
|
539
|
Paragraph paragraph6 = new Paragraph(consentGeneral);
|
415
|
Paragraph paragraph6 = new Paragraph(consentGeneral);
|
540
|
paragraph6.setAlignment(Element.ALIGN_JUSTIFIED);
|
416
|
paragraph6.setAlignment(Element.ALIGN_JUSTIFIED);
|
541
|
document.add(paragraph6);
|
417
|
document.add(paragraph6);
|
542
|
|
418
|
|
543
|
- String consentConclusion = "If you have any questions or would like more information about this study, please contact " +
|
|
|
544
|
- "Prof. Ramirez Lugo at 787-764-0000 Ext. 88068, at 787-918-5330 or by email at juan.ramirez3@upr.edu " +
|
|
|
545
|
- "at any moment. If you have any questions about your rights as a participant or claim or complaint related " +
|
|
|
546
|
- "to your participation in this study, you may contact the Compliance Officer of the R’o Piedras Campus of " +
|
|
|
547
|
- "the University of Puerto Rico, at telephone 764-0000, extension 86773 or cipshi. degi@upr.edu.\n\n" +
|
|
|
548
|
- "Your signature on this document means that you have decided to participate voluntarily, that the information " +
|
|
|
549
|
- "presented on this Consent Sheet has been discussed and that you have received a copy of this document. " +
|
|
|
550
|
- "This printed sheet will be stored under lock and key for a period of 5 years after completion of the " +
|
|
|
551
|
- "investigation and will then be shredded and discarded. \n\n\n";
|
|
|
552
|
-
|
|
|
|
|
419
|
+ String consentConclusion = getString(R.string.consentConclusion);
|
553
|
Paragraph paragraph7 = new Paragraph(consentConclusion);
|
420
|
Paragraph paragraph7 = new Paragraph(consentConclusion);
|
554
|
paragraph7.setAlignment(Element.ALIGN_JUSTIFIED);
|
421
|
paragraph7.setAlignment(Element.ALIGN_JUSTIFIED);
|
555
|
document.add(paragraph7);
|
422
|
document.add(paragraph7);
|
556
|
|
423
|
|
557
|
- Chunk participantSignature = new Chunk("Participant's signature:", new Font(Font.FontFamily.HELVETICA, 12, Font.BOLDITALIC, BaseColor.BLACK));
|
|
|
|
|
424
|
+
|
|
|
425
|
+ // Signature Section
|
|
|
426
|
+ Chunk participantSignature = new Chunk("Participant's signature:", signatureSectionFont);
|
558
|
Paragraph paragraph8 = new Paragraph(participantSignature);
|
427
|
Paragraph paragraph8 = new Paragraph(participantSignature);
|
559
|
document.add(paragraph8);
|
428
|
document.add(paragraph8);
|
560
|
|
429
|
|
561
|
Image consentSignatureImage = Image.getInstance(signatureBytes);
|
430
|
Image consentSignatureImage = Image.getInstance(signatureBytes);
|
562
|
- Chunk signatureImage = new Chunk(consentSignatureImage, 145, -24);
|
|
|
|
|
431
|
+ Chunk signatureImage = new Chunk(consentSignatureImage, signatureOffsetX, signatureOffsetY);
|
563
|
Paragraph paragraph11 = new Paragraph(signatureImage);
|
432
|
Paragraph paragraph11 = new Paragraph(signatureImage);
|
564
|
document.add(paragraph11);
|
433
|
document.add(paragraph11);
|
565
|
|
434
|
|
566
|
- Chunk signatureDate = new Chunk("Signed on: " + consentDate, new Font(Font.FontFamily.HELVETICA, 12, Font.BOLDITALIC, BaseColor.BLACK));
|
|
|
|
|
435
|
+ Chunk signatureDate = new Chunk("Signed on: " + consentDate, signatureSectionFont);
|
567
|
Paragraph paragraph9 = new Paragraph(signatureDate);
|
436
|
Paragraph paragraph9 = new Paragraph(signatureDate);
|
568
|
document.add(paragraph9);
|
437
|
document.add(paragraph9);
|
569
|
|
438
|
|
|
|
439
|
+
|
|
|
440
|
+ // Finish and store document
|
570
|
document.close();
|
441
|
document.close();
|
571
|
|
442
|
|
572
|
- File file = new File(Environment.getExternalStorageDirectory().getPath() + "/consent-tania-app.pdf");
|
|
|
|
|
443
|
+
|
|
|
444
|
+ // Read document back, encode to base64 and return
|
|
|
445
|
+ // TODO: find out if we really need to read it back,
|
|
|
446
|
+ // cause AndroidStudio says its value is ignored
|
|
|
447
|
+ File file = new File(filePath);
|
573
|
int size = (int) file.length();
|
448
|
int size = (int) file.length();
|
574
|
byte[] consentBytes = new byte[size];
|
449
|
byte[] consentBytes = new byte[size];
|
575
|
|
450
|
|
576
|
- try {
|
|
|
577
|
- BufferedInputStream buf = new BufferedInputStream(new FileInputStream(file));
|
|
|
578
|
- buf.read(consentBytes, 0, consentBytes.length);
|
|
|
579
|
- buf.close();
|
|
|
580
|
- } catch (FileNotFoundException e) {
|
|
|
581
|
- e.printStackTrace();
|
|
|
582
|
- } catch (IOException e) {
|
|
|
583
|
- e.printStackTrace();
|
|
|
584
|
- }
|
|
|
|
|
451
|
+ BufferedInputStream buffer = new BufferedInputStream(new FileInputStream(file));
|
|
|
452
|
+ buffer.read(consentBytes, 0, consentBytes.length);
|
|
|
453
|
+ buffer.close();
|
585
|
|
454
|
|
586
|
- consentBase64 = android.util.Base64.encodeToString(consentBytes, android.util.Base64.DEFAULT);
|
|
|
587
|
- return consentBase64;
|
|
|
|
|
455
|
+ return Base64.encodeToString(consentBytes, Base64.DEFAULT);
|
588
|
|
456
|
|
589
|
} catch (FileNotFoundException e) {
|
457
|
} catch (FileNotFoundException e) {
|
|
|
458
|
+ Log.e(TAG, "Couldn't find generated consent form!");
|
590
|
e.printStackTrace();
|
459
|
e.printStackTrace();
|
591
|
- } catch (MalformedURLException e) {
|
|
|
592
|
- e.printStackTrace();
|
|
|
|
|
460
|
+ return null;
|
593
|
} catch (IOException e) {
|
461
|
} catch (IOException e) {
|
|
|
462
|
+ Log.e(TAG, "Couldn't read back generated consent form!");
|
594
|
e.printStackTrace();
|
463
|
e.printStackTrace();
|
|
|
464
|
+ return null;
|
595
|
} catch (BadElementException e) {
|
465
|
} catch (BadElementException e) {
|
|
|
466
|
+ Log.e(TAG, "Couldn't create a consent form element!");
|
596
|
e.printStackTrace();
|
467
|
e.printStackTrace();
|
|
|
468
|
+ return null;
|
597
|
} catch (DocumentException e) {
|
469
|
} catch (DocumentException e) {
|
|
|
470
|
+ Log.e(TAG, "Something went wrong while fiddling with the consent form creation!");
|
|
|
471
|
+ e.printStackTrace();
|
|
|
472
|
+ return null;
|
|
|
473
|
+ } catch (Exception e) {
|
|
|
474
|
+ Log.wtf(TAG, "Call to launchConsent() went wrong!");
|
598
|
e.printStackTrace();
|
475
|
e.printStackTrace();
|
|
|
476
|
+ return null;
|
599
|
}
|
477
|
}
|
600
|
|
478
|
|
601
|
- return consentBase64;
|
|
|
602
|
}
|
479
|
}
|
603
|
}
|
480
|
}
|
604
|
|
481
|
|