Added function which ckecs if a form category is a question

This commit is contained in:
Tiago Scholten 2026-10-14 20:25:13 +02:00
parent c0e592e973
commit 0c1683c74b

View File

@ -1,5 +1,5 @@
from enum import StrEnum
from typing import Literal
from typing import Literal, get_args
'''
This category is used to differentiate types of form elements
@ -17,3 +17,6 @@ FormTextCategory = Literal[
FormElementCategory.text_piece,
FormElementCategory.title_text
]
def is_question_category(category: FormElementCategory) -> bool:
return category in get_args(FormQuestionCategory)