mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-18 09:48:37 +00:00
Added simulated participants to the BeyondFacts Lab (#1208)
This commit is contained in:
1 parent
92d0ff68f4
commit
ef059ffd15
46 files changed
+1871
-71
No files matched your search
@@ -113,12 +113,19 @@ public sealed partial class BeyondFactsLabStore
|
||||
throw new InvalidDataException("This version of AI Studio cannot open the form.", exception);
|
||||
}
|
||||
|
||||
if (form is null || form.SchemaVersion is < 1 or > BflStepFormData.CURRENT_SCHEMA_VERSION || IsNull(form.Values) || form.CardSort is { } cardSort && IsBroken(cardSort))
|
||||
if (form is null || form.SchemaVersion is < 1 or > BflStepFormData.CURRENT_SCHEMA_VERSION || IsNull(form.Values) || form.CardSort is { } cardSort && IsBroken(cardSort) || form.Simulation is { } simulation && IsBroken(simulation))
|
||||
throw new InvalidDataException("This version of AI Studio cannot open the form.");
|
||||
|
||||
return form;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells whether a stored simulation lacks one of its parts, which JSON can make null, or names a mode this version
|
||||
/// does not know.
|
||||
/// </summary>
|
||||
/// <param name="simulation">The simulation.</param>
|
||||
private static bool IsBroken(BflSimulation simulation) => !Enum.IsDefined(simulation.Mode) || IsNull(simulation.People) || simulation.People.Any(IsNull);
|
||||
|
||||
/// <summary>
|
||||
/// Tells whether a stored card sort lacks one of its parts, which JSON can make null.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user