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,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