Skip to content

Commit

Permalink
Merge pull request #90 from ls1intum/fix/example-solution-null
Browse files Browse the repository at this point in the history
Allow nullable example solution in text exercises
  • Loading branch information
FelixTJDietrich authored Aug 30, 2023
2 parents f39b5ac + f8e45f3 commit 4a147e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion athena/athena/models/db_text_exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class DBTextExercise(DBExercise, Base):
__tablename__ = "text_exercises"

example_solution: str = Column(String, nullable=False) # type: ignore
example_solution: str = Column(String) # type: ignore

submissions = relationship("DBTextSubmission", back_populates="exercise")
feedbacks = relationship("DBTextFeedback", back_populates="exercise")
3 changes: 2 additions & 1 deletion athena/athena/schemas/text_exercise.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Optional
from pydantic import Field

from .exercise_type import ExerciseType
Expand All @@ -9,4 +10,4 @@ class TextExercise(Exercise):

type: ExerciseType = Field(ExerciseType.text, const=True)

example_solution: str = Field("", description="An example solution to the exercise.")
example_solution: Optional[str] = Field(None, description="An example solution to the exercise.")

0 comments on commit 4a147e4

Please sign in to comment.