| Total Complexity | 4 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from .illustrations.illustration import Illustration # type: ignore |
||
| 2 | |||
| 3 | |||
| 4 | class QuizElement: |
||
| 5 | def __init__( |
||
| 6 | self, |
||
| 7 | text: str, |
||
| 8 | illustration: Illustration | None = None, |
||
| 9 | ) -> None: |
||
| 10 | assert isinstance(text, str) |
||
| 11 | self.text = text |
||
| 12 | |||
| 13 | if illustration: |
||
| 14 | assert isinstance(illustration, Illustration) |
||
| 15 | self.illustration = illustration |
||
| 16 | |||
| 17 | def __str__(self) -> str: |
||
| 18 | text = self.text |
||
| 19 | if self.illustration: |
||
| 20 | text += str(self.illustration) |
||
| 21 | return text |
||
| 22 |