Skip to content

Commit

Permalink
FIX shell autograde ide created
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Oct 19, 2023
1 parent ddc29db commit a885415
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/anubis/ide/initialize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
from datetime import datetime

from kubernetes import config as k8s_config

Expand All @@ -23,6 +24,7 @@
from anubis.k8s.theia.create import create_k8s_resources_for_ide
from anubis.utils.exceptions import send_alert_email_on_error


@send_alert_email_on_error
def initialize_theia_session(theia_session_id: str):
"""
Expand Down Expand Up @@ -151,6 +153,7 @@ def initialize_ide(
credentials=credentials,
docker=docker,
autograde=autograde,
created=datetime.now(),
)
db.session.add(session)

Expand Down
4 changes: 4 additions & 0 deletions api/anubis/lms/shell_autograde.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from datetime import datetime
import re

from anubis.constants import SHELL_AUTOGRADE_SUBMISSION_STATE_MESSAGE, SHELL_AUTOGRADE_SUBMISSION_NOT_DONE_MESSAGE
Expand Down Expand Up @@ -356,6 +357,9 @@ def create_shell_autograde_ide_submission(theia_session: TheiaSession) -> Submis
# on the due date of the assignment.
accepted = True
if not assignment.accept_late:
if theia_session.created is None:
theia_session.created = datetime.now()

# Figure out if the current submission is late
late = theia_session.created < get_assignment_due_date(
theia_session.owner_id,
Expand Down

0 comments on commit a885415

Please sign in to comment.