mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init assignment subpages and misc python and ts improvements
This commit is contained in:
parent
e9caa2ceb4
commit
dab80069d4
19 changed files with 109 additions and 49 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import importlib
|
||||
from logging.config import fileConfig
|
||||
import os
|
||||
import alembic_postgresql_enum
|
||||
import alembic_postgresql_enum # noqa: F401
|
||||
from sqlalchemy import engine_from_config
|
||||
from sqlalchemy import pool
|
||||
from sqlmodel import SQLModel
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ Create Date: ${create_date}
|
|||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
import sqlalchemy as sa # noqa: F401
|
||||
import sqlmodel # noqa: F401
|
||||
${imports if imports else ""}
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ Create Date: 2024-07-11 20:46:26.582170
|
|||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
import sqlalchemy as sa # noqa: F401
|
||||
import sqlmodel # noqa: F401
|
||||
from alembic_postgresql_enum import TableReference # type: ignore
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from typing import Sequence, Union
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
import sqlmodel # noqa: F401
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ Create Date: 2024-07-11 19:33:37.993767
|
|||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
from grpc import server
|
||||
from grpc import server # noqa: F401
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
import sqlmodel # noqa: F401
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from typing import Optional, Dict
|
||||
from sqlalchemy import JSON, Column, ForeignKey, null
|
||||
from sqlalchemy import JSON, Column, ForeignKey
|
||||
from sqlmodel import Field, SQLModel
|
||||
from enum import Enum
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ from src.db.courses.assignments import (
|
|||
AssignmentCreate,
|
||||
AssignmentRead,
|
||||
AssignmentTaskCreate,
|
||||
AssignmentTaskSubmissionCreate,
|
||||
AssignmentTaskSubmissionUpdate,
|
||||
AssignmentTaskUpdate,
|
||||
AssignmentUpdate,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ from typing import Literal
|
|||
from uuid import uuid4
|
||||
from fastapi import HTTPException, Request, UploadFile
|
||||
from sqlmodel import Session, select
|
||||
from sympy import Sum
|
||||
|
||||
from src.db.courses.activities import Activity
|
||||
from src.db.courses.assignments import (
|
||||
|
|
@ -1172,7 +1171,7 @@ async def read_user_assignment_submissions(
|
|||
|
||||
# Find assignments tasks for an assignment
|
||||
statement = select(AssignmentUserSubmission).where(
|
||||
assignment.assignment_uuid == assignment_uuid,
|
||||
AssignmentUserSubmission.assignment_id == assignment.id,
|
||||
AssignmentUserSubmission.user_id == user_id,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
from uuid import uuid4
|
||||
from src.services.utils.upload_content import upload_content
|
||||
|
||||
|
||||
|
|
@ -12,7 +11,7 @@ async def upload_submission_file(
|
|||
assignment_task_uuid,
|
||||
):
|
||||
contents = file.file.read()
|
||||
file_format = file.filename.split(".")[-1]
|
||||
file.filename.split(".")[-1]
|
||||
|
||||
await upload_content(
|
||||
f"courses/{course_uuid}/activities/{activity_uuid}/assignments/{assignment_uuid}/tasks/{assignment_task_uuid}/subs",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
from uuid import uuid4
|
||||
from src.services.utils.upload_content import upload_content
|
||||
|
||||
|
||||
|
|
@ -12,7 +11,7 @@ async def upload_reference_file(
|
|||
assignment_task_uuid,
|
||||
):
|
||||
contents = file.file.read()
|
||||
file_format = file.filename.split(".")[-1]
|
||||
file.filename.split(".")[-1]
|
||||
|
||||
await upload_content(
|
||||
f"courses/{course_uuid}/activities/{activity_uuid}/assignments/{assignment_uuid}/tasks/{assignment_task_uuid}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue