Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions .setup/bin/sample_courses/models/gradeable.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,29 +164,36 @@ def __init__(self, gradeable) -> None:
if "grading_rotating" in gradeable:
self.grading_rotating = gradeable["grading_rotating"]

self.ta_view_date = dateutils.parse_datetime(gradeable["g_ta_view_start_date"])
# these dates corresponds with the manually set dates
time_start = "1900-01-01"
time_end = "9998-01-01"
self.ta_view_date = dateutils.parse_datetime(
gradeable["g_ta_view_start_date"] if "g_ta_view_start_date" in gradeable else time_start
)
self.grade_start_date = dateutils.parse_datetime(
gradeable["g_grade_start_date"]
gradeable["g_grade_start_date"] if "g_grade_start_date" in gradeable else time_end
)
self.grade_due_date = dateutils.parse_datetime(
gradeable["g_grade_due_date"] if "g_grade_due_date" in gradeable else time_end
)
self.grade_due_date = dateutils.parse_datetime(gradeable["g_grade_due_date"])
self.grade_released_date = dateutils.parse_datetime(
gradeable["g_grade_released_date"]
gradeable["g_grade_released_date"] if "g_grade_released_date" in gradeable else time_end
)
if self.type == 0:
self.submission_open_date = dateutils.parse_datetime(
gradeable["eg_submission_open_date"]
gradeable["eg_submission_open_date"] if "eg_submission_open_date" in gradeable else time_start
)
self.submission_due_date = dateutils.parse_datetime(
gradeable["eg_submission_due_date"]
gradeable["eg_submission_due_date"] if "eg_submission_due_date" in gradeable else time_end
)
self.team_lock_date = dateutils.parse_datetime(
gradeable["eg_submission_due_date"]
gradeable["eg_team_lock_date"] if "eg_team_lock_date" in gradeable else self.submission_due_date
)
self.grade_inquiry_start_date = dateutils.parse_datetime(
gradeable["eg_grade_inquiry_start_date"]
gradeable["eg_grade_inquiry_start_date"] if "eg_grade_inquiry_start_date" in gradeable else time_end
)
self.grade_inquiry_due_date = dateutils.parse_datetime(
gradeable["eg_grade_inquiry_due_date"]
gradeable["eg_grade_inquiry_due_date"] if "eg_grade_inquiry_due_date" in gradeable else time_end
)
self.student_view = True
self.student_view_after_grades = False
Expand Down Expand Up @@ -222,10 +229,6 @@ def __init__(self, gradeable) -> None:
self.depends_on = gradeable["eg_depends_on"]
if "eg_depends_on_points" in gradeable:
self.depends_on_points = gradeable["eg_depends_on_points"]
if "eg_team_lock_date" in gradeable:
self.team_lock_date = dateutils.parse_datetime(
gradeable["eg_team_lock_date"]
)
if "eg_annotated_pdf" in gradeable:
self.annotated_pdf = gradeable["eg_annotated_pdf"] is True
self.annotation_path = os.path.join(
Expand Down Expand Up @@ -254,17 +257,17 @@ def __init__(self, gradeable) -> None:
self.config_path = tutorial_path
else:
self.config_path = None
assert self.ta_view_date < self.submission_open_date
assert self.ta_view_date <= self.submission_open_date
assert self.has_due_date is False or (
self.submission_open_date < self.submission_due_date
self.submission_open_date <= self.submission_due_date
)
assert self.has_due_date is False or (
self.submission_due_date < self.grade_start_date
self.submission_due_date <= self.grade_start_date
)
assert self.has_release_date is False or (
self.grade_released_date <= self.grade_inquiry_start_date
)
assert self.grade_inquiry_start_date < self.grade_inquiry_due_date
assert self.grade_inquiry_start_date <= self.grade_inquiry_due_date
if self.gradeable_config is not None:
if self.sample_path is not None:
if os.path.isfile(
Expand Down Expand Up @@ -294,8 +297,8 @@ def __init__(self, gradeable) -> None:
)
# Ensure we're not sensitive to directory traversal order
self.annotations.sort()
assert self.ta_view_date < self.grade_start_date
assert self.grade_start_date < self.grade_due_date
assert self.ta_view_date <= self.grade_start_date
assert self.grade_start_date <= self.grade_due_date
assert (
self.has_release_date is False
or self.grade_due_date <= self.grade_released_date
Expand Down
25 changes: 14 additions & 11 deletions .setup/data/courses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@
# g_grader_assignment_method: [optional] integer between 0-2 inclusive, where 0 is grade by rotating section, 1 is grade by
# by registration section, and 2 is all access grading. Defaults to 1: grade by registration section.
#
# g_ta_view_start_date: when are TAs allowed to view this gradeable on the navigation page (before grading has started).
# g_ta_view_start_date: [optional] when are TAs allowed to view this gradeable on the navigation page (before grading has started).
# This should be before grading start date and submission open date (if electronic gradeable). Only instructors
# can view gradeables before this date has happened (then TAs are allowed).
# can view gradeables before this date has happened (then TAs are allowed). Defaults to beginning of time.
#
# g_grade_start_date: when should grading start for the gradeable
# g_grade_start_date: [optional] when should grading start for the gradeable. Defaults to end of time.
#
# g_grade_released_date: when are the grades are going to be available to the student via interface and rainbow
# grades. This should happen after the grading start date.
# g_grade_due_date [optional] when grading should end for the gradeable. Defaults to end of time
#
# g_grade_released_date: [optional] when are the grades are going to be available to the student via interface and rainbow
# grades. This should happen after the grading start date. Defaults to end of time.
#
# g_syllabus_bucket: [optional] what bucket should the gradeable be a part of for rainbox grades. Defaults to None.
#
Expand All @@ -76,16 +78,16 @@
#
# eg_config_path: Path to gradeable config. Do not use with gradeable_config.
#
# eg_submission_open_date: Timestamp on when does the gradeable open to students for submission. Should be before
# grading start date and submission due date, but after the TA view date.
# eg_submission_open_date: [optional] Timestamp on when does the gradeable open to students for submission. Should be before
# grading start date and submission due date, but after the TA view date. Defaults to beginning of time.
#
# eg_submission_due_date: Timestamp when is the due date for the gradeable. Should be after submission open date.
# eg_submission_due_date: [optional] Timestamp when is the due date for the gradeable. Should be after submission open date. Defaults to end of time.
#
# eg_team_assignment: Boolean for if electronic gradeable is a team assignment. Defaults to False
#
# eg_max_team_size: Integer for maximum team size (instructors can manually create larger teams). Defaults to 1
#
# eg_team_lock_date: Timestamp on when teams lock (students can no longer leave their team or send invitations). Defaults to due date
# eg_team_lock_date: [optional] Timestamp on when teams lock (students can no longer leave their team or send invitations). Defaults to due date
#
# eg_is_repository: [optional] Boolean for if this gradeable using version control (TRUE) or not (FALSE).
# Defaults to FALSE.
Expand Down Expand Up @@ -115,9 +117,10 @@
# if this isn't provided but eg_lichen_sample_path is, random submissions will be made from the directory provided
#
# To make how the order of the time fields work more explicit:
# g_ta_view_start_date < eg_submission_open_date < eg_submission_due_date < g_grade_start_date < g_grade_released_date
# g_ta_view_start_date <= eg_submission_open_date <= eg_submission_due_date <= g_grade_start_date <= g_grade_released_date
#
# components: this is a list of dictionaries for each component to be added for the gradeable. Each entry uses:
# components: [optional] this is a list of dictionaries for each component to be added for the gradeable. Defaults to []
# Each entry uses:
#
# gc_title: string for component title.
#
Expand Down
Loading