Skip to content

Commit

Permalink
Merge pull request #80 from mario-bermonti/don't-require-participant-id
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-bermonti committed Nov 27, 2023
2 parents 7da20fe + db9bd46 commit b8d720b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
2 changes: 0 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class _MyHomePageState extends State<MyHomePage> {
UserConfig config = UserConfig(
stimListPractice: ['01', '234'],
stimListExperimental: ['5678', '01567', '987654'],
participantID: '000',
);
DigitSpanTasksData data = await Get.to(() => DigitSpanForward(
config: config,
Expand All @@ -73,7 +72,6 @@ class _MyHomePageState extends State<MyHomePage> {
UserConfig config = UserConfig(
stimListPractice: ['23', '567'],
stimListExperimental: ['0123', '45678', '901234'],
participantID: '000',
);
DigitSpanTasksData data = await Get.to(() => DigitSpanBackwards(
config: config,
Expand Down
11 changes: 4 additions & 7 deletions lib/src/digit_span_task/components/config/user_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ class UserConfig extends GetxController {
/// are randomized (e.g., "123" may be turned into "213").
late final List<String> stimListExperimental;

/// Unique id to identify the participant's data
final String participantID;

UserConfig(
{required stimListPractice,
required stimListExperimental,
required this.participantID}) {
UserConfig({
required stimListPractice,
required stimListExperimental,
}) {
this.stimListPractice = randomizeDigitsInSets(stimListPractice);
this.stimListExperimental = randomizeDigitsInSets(stimListExperimental);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/src/digit_span_task/components/data/data_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ class DataManager extends GetxController {
DataModel practiceData = DataModel();
DataModel experimentalData = DataModel();

/// Add data [participantID], [stim], [resp] from a single trial to
/// Add data [stim], [resp] from a single trial to
/// the manager. Uses [isPractice] to get the data for the current phase.
void addTrialData({
required String participantID,
required String stim,
required String resp,
required bool isPractice,
}) {
TrialData trialData = TrialData(
participantID: participantID,
stim: stim,
response: resp,
);
Expand Down
4 changes: 1 addition & 3 deletions lib/src/digit_span_task/components/data/trial_data.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/// Model for the data of a single trial
class TrialData {
final String participantID;
final String stim;
final String response;

TrialData({
required this.participantID,
required this.stim,
required this.response,
});

@override
String toString() {
return "Participant $participantID, stim: $stim, resp: $response";
return "stim: $stim, resp: $response";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class ResponseController extends GetxController {
String response = textController.text.trim();

_data.addTrialData(
participantID: _config.userConfig.participantID,
stim: _stim.stim.currentStim,
resp: response,
isPractice: _config.isPractice,
Expand Down

0 comments on commit b8d720b

Please sign in to comment.