Skip to content

Commit 1bad27e

Browse files
committed
writes participant details to session folder
1 parent 6fcf533 commit 1bad27e

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Assets/UXF/Scripts/Session.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,14 @@ public void Begin(string experimentName, string participantId, string baseFolder
371371
ppid = participantId;
372372
number = sessionNumber;
373373
basePath = baseFolder;
374+
375+
if (participantDetails == null)
376+
participantDetails = new Dictionary<string, object>();
374377
this.participantDetails = participantDetails;
375378

376379
if (settings == null)
377380
settings = Settings.empty;
378-
else
379-
this.settings = settings;
381+
this.settings = settings;
380382

381383
// setup folders
382384
InitFolder();
@@ -389,6 +391,11 @@ public void Begin(string experimentName, string participantId, string baseFolder
389391
if (onInitialise != null) onInitialise();
390392
onSessionBegin.Invoke(this);
391393

394+
// copy participant details to session folder
395+
WriteDictToSessionFolder(
396+
new Dictionary<string, object>(participantDetails), // makes a copy
397+
"participant_details");
398+
392399
// copy Settings to session folder
393400
WriteDictToSessionFolder(
394401
new Dictionary<string, object>(settings.baseDict), // makes a copy
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}

0 commit comments

Comments
 (0)