Skip to content
Snippets Groups Projects
Commit 1902ad19 authored by Malte Christian Kögel's avatar Malte Christian Kögel
Browse files

revert dummy-data, instead recover IV's from previous participant. Also: never...

revert dummy-data, instead recover IV's from previous participant. Also: never keep multiple records of one condition/participant combination --> Overwrite whether in debug mode or not. closes #97
parent 8addbceb
Branches
Tags
No related merge requests found
......@@ -151,15 +151,24 @@ void USFGameInstance::RestoreLastParticipantForDebugStart(USFCondition* InStartC
const FString ParticipantID = USFParticipant::GetLastParticipantID();
Participant = NewObject<USFParticipant>(this,
FName(TEXT("Participant_") + ParticipantID));
StudySetup = USFParticipant::GetLastParticipantSetup();
StartCondition = InStartCondition;
Participant->Initialize(ParticipantSequenceNumber, ParticipantID);
Participant->LoadConditionsFromJson();
Participant->SetIndependentVariablesFromStudySetup(StudySetup);
Participant->Conditions = Participant->GetLastParticipantsConditions();
Participant->LoadLastParticipantsIndependentVariables();
InitFadeHandler(StudySetup->FadeConfig);
Participant->RecoverStudyResultsOfFinishedConditions();
//also delete any data of the condition that is now restarted (StartCondition)
Participant->DeleteStoredDataForConditionFromLongTable(StartCondition);
for (USFDependentVariable* DV : StartCondition->DependentVariables)
{
if (USFMultipleTrialDependentVariable* MTDV = Cast<USFMultipleTrialDependentVariable>(DV))
{
Participant->DeleteStoredTrialDataForCondition(StartCondition, MTDV);
}
}
StartCondition = InStartCondition;
InitFadeHandler(StudySetup->FadeConfig);
StartStudy();
//cannot directly fade in here, since Init might not be done, so we wait a second for safety
......@@ -208,6 +217,7 @@ void USFGameInstance::InitFadeHandler(FFadeConfig FadeConfig)
}
// When starting on the setup map, i.e. not for debugging purposes
void USFGameInstance::PrepareWithStudySetup(ASFStudySetup* Setup)
{
StudySetup = DuplicateObject(Setup, this);
......
......@@ -600,10 +600,7 @@ void USFParticipant::SetIndependentVariablesFromStudySetup(ASFStudySetup* Setup)
IndependentVariablesValues.Empty();
for (auto Var : Setup->IndependentVariables) {
FString Value = "";
if (USFGameInstance::Get()->IsInDebugMode()) {
Value = "DebugRun-NoData";
}
else if (Var->bAskedAtBeginning) {
if (Var->bAskedAtBeginning) {
switch (Var->ValueType) {
case EValType::TEXT:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment