Files
api-copp/web/views/take_test_view.py
2026-04-06 12:15:09 +05:00

46 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import flet as ft
import designer as ds
from views.content_users.take_test_page import TakeTestPage
class TakeTestView(ft.View):
def __init__(self, page: ft.Page):
url_key = page.session.store.get("url_key") or ""
back_btn = ft.IconButton(
icon=ft.Icons.ARROW_BACK,
icon_color=ds.clolors.ferst,
on_click=lambda _: page.go(f"/user/{url_key}"),
)
self._content = TakeTestPage(page)
super().__init__(
route=f"/take_test/{url_key}",
bgcolor=ds.clolors.background,
padding=ft.padding.symmetric(horizontal=ds.s(12), vertical=ds.s(8)),
horizontal_alignment=ft.CrossAxisAlignment.START,
vertical_alignment=ft.MainAxisAlignment.START,
controls=[
ft.Column(
expand=True,
controls=[
ft.Row(
controls=[
back_btn,
ds.CastomText(
text="Все тесты",
size=22,
weight=ft.FontWeight.BOLD,
),
]
),
self._content,
],
)
],
)
async def load(self):
await self._content.load()