diff --git a/internal/domain/question_type_builder.go b/internal/domain/question_type_builder.go index 13d1594..fd95582 100644 --- a/internal/domain/question_type_builder.go +++ b/internal/domain/question_type_builder.go @@ -221,7 +221,11 @@ func ResolveRuntimeQuestionTypeFromDefinition(key string, responseKinds []string return "TRUE_FALSE" } + hasNonAuxiliary := false for _, kind := range normalizeKindList(responseKinds) { + if _, aux := responseKindsAuxiliary[kind]; !aux { + hasNonAuxiliary = true + } switch kind { case string(ResponseAudioResponse): return "AUDIO" @@ -237,6 +241,11 @@ func ResolveRuntimeQuestionTypeFromDefinition(key string, responseKinds []string } } + // Builder-native response kinds should still be persistable/executable as DYNAMIC. + if hasNonAuxiliary { + return "DYNAMIC" + } + return "" } diff --git a/internal/domain/question_type_builder_test.go b/internal/domain/question_type_builder_test.go index 1d3e45d..c105433 100644 --- a/internal/domain/question_type_builder_test.go +++ b/internal/domain/question_type_builder_test.go @@ -86,6 +86,13 @@ func TestResolveRuntimeQuestionTypeFromDefinition_skipsAuxiliaryKinds(t *testing } } +func TestResolveRuntimeQuestionTypeFromDefinition_builderNativeKinds(t *testing.T) { + got := ResolveRuntimeQuestionTypeFromDefinition("dynamic_builder", []string{"OPTION", "ANSWER_TIMER"}) + if got != "DYNAMIC" { + t.Fatalf("expected DYNAMIC, got %q", got) + } +} + func TestValidatePersistableQuestionTypeDefinition_unmappable(t *testing.T) { err := ValidatePersistableQuestionTypeDefinition("custom", []string{"ANSWER_TIMER"}) if err == nil || !strings.Contains(err.Error(), "unable to map definition") {