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