mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
ripped out lock at due date flag
This commit is contained in:
@@ -7,7 +7,9 @@ public class AssignmentMarkdownTests
|
|||||||
{
|
{
|
||||||
var assignment = new LocalAssignment()
|
var assignment = new LocalAssignment()
|
||||||
{
|
{
|
||||||
|
Name="test assignment",
|
||||||
|
Description ="here is the description",
|
||||||
|
// LockAtDueDate = false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
if (assignmentContext.Assignment != null)
|
if (assignmentContext.Assignment != null)
|
||||||
{
|
{
|
||||||
name = assignmentContext.Assignment.Name;
|
name = assignmentContext.Assignment.Name;
|
||||||
lockAtDueDate = assignmentContext.Assignment.LockAtDueDate;
|
|
||||||
}
|
}
|
||||||
this.InvokeAsync(this.StateHasChanged);
|
this.InvokeAsync(this.StateHasChanged);
|
||||||
}
|
}
|
||||||
@@ -32,11 +31,8 @@
|
|||||||
{
|
{
|
||||||
assignmentContext.Assignment = null;
|
assignmentContext.Assignment = null;
|
||||||
name = "";
|
name = "";
|
||||||
lockAtDueDate = false;
|
|
||||||
}
|
}
|
||||||
private string name { get; set; } = String.Empty;
|
private string name { get; set; } = String.Empty;
|
||||||
private bool lockAtDueDate { get; set; }
|
|
||||||
|
|
||||||
private bool addingAssignmentToCanvas = false;
|
private bool addingAssignmentToCanvas = false;
|
||||||
private bool deletingAssignmentFromCanvas = false;
|
private bool deletingAssignmentFromCanvas = false;
|
||||||
|
|
||||||
@@ -47,7 +43,6 @@
|
|||||||
var newAssignment = assignmentContext.Assignment with
|
var newAssignment = assignmentContext.Assignment with
|
||||||
{
|
{
|
||||||
Name = name,
|
Name = name,
|
||||||
LockAtDueDate = lockAtDueDate,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assignmentContext.SaveAssignment(newAssignment);
|
assignmentContext.SaveAssignment(newAssignment);
|
||||||
@@ -88,6 +83,7 @@
|
|||||||
ulong courseId = planner.LocalCourse.Settings.CanvasId ?? throw new Exception("cannot delete if no course id");
|
ulong courseId = planner.LocalCourse.Settings.CanvasId ?? throw new Exception("cannot delete if no course id");
|
||||||
await canvas.Assignments.Delete(courseId, assignmentInCanvas.Id, assignment.Name);
|
await canvas.Assignments.Delete(courseId, assignmentInCanvas.Id, assignment.Name);
|
||||||
}
|
}
|
||||||
|
Navigation.NavigateTo("/course/" + planner.LocalCourse?.Settings.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,23 +96,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleLockAtDueDateChange(ChangeEventArgs e)
|
|
||||||
{
|
|
||||||
if (assignmentContext.Assignment != null)
|
|
||||||
{
|
|
||||||
var lockAtDueDate = (bool)(e.Value ?? false);
|
|
||||||
var lockAtDate = lockAtDueDate
|
|
||||||
? assignmentContext.Assignment.DueAt
|
|
||||||
: assignmentContext.Assignment.LockAt;
|
|
||||||
var newAssignment = assignmentContext.Assignment with
|
|
||||||
{
|
|
||||||
LockAtDueDate = lockAtDueDate,
|
|
||||||
LockAt = lockAtDate,
|
|
||||||
};
|
|
||||||
assignmentContext.SaveAssignment(newAssignment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setAssignmentGroup(LocalAssignmentGroup? group)
|
private void setAssignmentGroup(LocalAssignmentGroup? group)
|
||||||
{
|
{
|
||||||
if (assignmentContext.Assignment == null)
|
if (assignmentContext.Assignment == null)
|
||||||
@@ -181,8 +160,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="d-flex flex-column h-100">
|
<div class="d-flex flex-column h-100">
|
||||||
<div>
|
<div>
|
||||||
@assignmentContext.Assignment?.Name
|
@assignmentContext.Assignment?.Name
|
||||||
@@ -208,13 +185,6 @@
|
|||||||
<AssignmentDescriptionEditor />
|
<AssignmentDescriptionEditor />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-check m-1">
|
|
||||||
<input class="form-check-input" id="lockAtDueDate" type="checkbox" @bind="lockAtDueDate"
|
|
||||||
@oninput="handleLockAtDueDateChange" />
|
|
||||||
<label class="form-check-label" for="lockAtDueDate">
|
|
||||||
Lock At Due Date
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<RubricMarkdownEditor />
|
<RubricMarkdownEditor />
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
{
|
{
|
||||||
Name = Name,
|
Name = Name,
|
||||||
Description = "",
|
Description = "",
|
||||||
LockAtDueDate = true,
|
@* LockAtDueDate = true, *@
|
||||||
Rubric = new RubricItem[] { },
|
Rubric = new RubricItem[] { },
|
||||||
LockAt = null,
|
LockAt = DateTime.Now,
|
||||||
DueAt = DateTime.Now,
|
DueAt = DateTime.Now,
|
||||||
SubmissionTypes = new string[] { SubmissionType.ONLINE_TEXT_ENTRY },
|
SubmissionTypes = new string[] { SubmissionType.ONLINE_TEXT_ENTRY },
|
||||||
LocalAssignmentGroupName = selectedAssignmentGroup?.Name,
|
LocalAssignmentGroupName = selectedAssignmentGroup?.Name,
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public static class CoursePlannerExtensions
|
|||||||
return assignment with
|
return assignment with
|
||||||
{
|
{
|
||||||
DueAt = dueAt,
|
DueAt = dueAt,
|
||||||
LockAt = assignment.LockAtDueDate ? dueAt : lockAt
|
LockAt = lockAt
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,9 +140,7 @@ public static partial class AssignmentSyncronizationExtensions
|
|||||||
second: canvasAssignment.LockAt.Value.Second
|
second: canvasAssignment.LockAt.Value.Second
|
||||||
)
|
)
|
||||||
: new DateTime();
|
: new DateTime();
|
||||||
var localComparisonLockDate = localAssignment.LockAtDueDate
|
var localComparisonLockDate = canvasAssignment.LockAt != null
|
||||||
? localComparisonDueDate
|
|
||||||
: canvasAssignment.LockAt != null
|
|
||||||
? new DateTime(
|
? new DateTime(
|
||||||
year: localAssignment.LockAt?.Year ?? 0,
|
year: localAssignment.LockAt?.Year ?? 0,
|
||||||
month: localAssignment.LockAt?.Month ?? 0,
|
month: localAssignment.LockAt?.Month ?? 0,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public record LocalAssignment
|
|||||||
// public ulong? CanvasId { get; init; } = null;
|
// public ulong? CanvasId { get; init; } = null;
|
||||||
public string Name { get; init; } = "";
|
public string Name { get; init; } = "";
|
||||||
public string Description { get; init; } = "";
|
public string Description { get; init; } = "";
|
||||||
public bool LockAtDueDate { get; init; }
|
// public bool LockAtDueDate { get; init; }
|
||||||
public IEnumerable<RubricItem> Rubric { get; init; } = Array.Empty<RubricItem>();
|
public IEnumerable<RubricItem> Rubric { get; init; } = Array.Empty<RubricItem>();
|
||||||
public DateTime? LockAt { get; init; }
|
public DateTime? LockAt { get; init; }
|
||||||
public DateTime DueAt { get; init; }
|
public DateTime DueAt { get; init; }
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class CanvasAssignmentService
|
|||||||
submission_types = localAssignment.SubmissionTypes.Select(t => t.ToString()),
|
submission_types = localAssignment.SubmissionTypes.Select(t => t.ToString()),
|
||||||
description = htmlDescription,
|
description = htmlDescription,
|
||||||
due_at = localAssignment.DueAt,
|
due_at = localAssignment.DueAt,
|
||||||
lock_at = localAssignment.LockAtDueDate ? localAssignment.DueAt : localAssignment.LockAt,
|
lock_at = localAssignment.LockAt,
|
||||||
points_possible = localAssignment.PointsPossible,
|
points_possible = localAssignment.PointsPossible,
|
||||||
assignment_group_id = canvasAssignmentGroupId,
|
assignment_group_id = canvasAssignmentGroupId,
|
||||||
};
|
};
|
||||||
@@ -84,7 +84,7 @@ public class CanvasAssignmentService
|
|||||||
submission_types = localAssignment.SubmissionTypes.Select(t => t.ToString()),
|
submission_types = localAssignment.SubmissionTypes.Select(t => t.ToString()),
|
||||||
description = localAssignment.GetDescriptionHtml(),
|
description = localAssignment.GetDescriptionHtml(),
|
||||||
due_at = localAssignment.DueAt,
|
due_at = localAssignment.DueAt,
|
||||||
lock_at = localAssignment.LockAtDueDate ? localAssignment.DueAt : localAssignment.LockAt,
|
lock_at = localAssignment.LockAt,
|
||||||
points_possible = localAssignment.PointsPossible,
|
points_possible = localAssignment.PointsPossible,
|
||||||
assignment_group_id = canvasAssignmentGroupId,
|
assignment_group_id = canvasAssignmentGroupId,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user