Skip to content

Commit 1ac9cc5

Browse files
committed
Generalised FillableForm
1 parent daca9f7 commit 1ac9cc5

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

Assets/UXF/Scripts/UI/ExperimentStartupController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void Start()
6262
}
6363
else
6464
{
65-
ppInfoForm.Generate(participantDataPoints);
65+
ppInfoForm.Generate(participantDataPoints, true);
6666

6767
List<string> sessionList = new List<string>();
6868
for (int i = 1; i <= maxNumSessions; i++)

Assets/UXF/Scripts/UI/Form/FillableFormController.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ public void Clear()
2828
}
2929
}
3030

31-
public void Generate(List<FormElementEntry> formElements)
31+
public void Generate(List<FormElementEntry> formElements, bool insertPpidElement)
3232
{
33-
ppidElement = new FormElementEntry();
34-
ppidElement.displayName = "Participant ID";
35-
ppidElement.internalName = "ppid";
36-
ppidElement.dataType = FormDataType.String;
37-
formElements.Insert(0, ppidElement);
33+
if (insertPpidElement)
34+
{
35+
ppidElement = new FormElementEntry();
36+
ppidElement.displayName = "Participant ID";
37+
ppidElement.internalName = "ppid";
38+
ppidElement.dataType = FormDataType.String;
39+
formElements.Insert(0, ppidElement);
40+
41+
}
3842

3943
this.formElements = formElements;
4044
while (contentParent.transform.childCount != 0)
@@ -63,9 +67,12 @@ public void Generate(List<FormElementEntry> formElements)
6367
}
6468
}
6569

66-
// set ppid field to current time
67-
TextFormController ppidText = (TextFormController)ppidElement.controller;
68-
ppidText.SetToTimeNow();
70+
if (insertPpidElement)
71+
{
72+
// set ppid field to current time
73+
TextFormController ppidText = (TextFormController)ppidElement.controller;
74+
ppidText.SetToTimeNow();
75+
}
6976

7077
}
7178

0 commit comments

Comments
 (0)