reordering rubric

This commit is contained in:
2023-09-01 09:52:32 -06:00
parent ebb9cd4d2e
commit 5aaf474565
4 changed files with 56 additions and 20 deletions

View File

@@ -173,7 +173,9 @@
Lock At Due Date Lock At Due Date
</label> </label>
</div> </div>
<RubricEditor /> <div class="container">
<RubricEditor />
</div>
<SubmissionTypeSelector /> <SubmissionTypeSelector />
} }
<ConfirmationModal Label="Delete" Class="btn btn-danger" OnConfirmAsync="HandleDelete" /> <ConfirmationModal Label="Delete" Class="btn btn-danger" OnConfirmAsync="HandleDelete" />

View File

@@ -104,10 +104,30 @@
} }
} }
} }
private int requiredPoints => rubric.Where(r => !r.IsExtraCredit).Select(r => r.Points).Sum();
private int extraCreditPoints => rubric.Where(r => r.IsExtraCredit).Select(r => r.Points).Sum();
} }
<br> <br>
<h5>Rubric</h5> <div class="row">
<div class="col offset-3">
<h4 class="text-center">Rubric</h4>
</div>
<div class=" col-3 text-end my-1">
<button
@onclick:preventDefault="true"
@onclick="addItem"
type="button"
class="btn btn-outline-primary"
>
+ rubric item
</button>
</div>
</div>
<ul class="list-group"> <ul class="list-group">
@foreach (var rubricItem in rubric) @foreach (var rubricItem in rubric)
{ {
@@ -120,21 +140,34 @@
} }
</ul> </ul>
<div class="text-end my-1">
<button <div class="row">
@onclick:preventDefault="true" <div class="col">
@onclick="removeItem" <div>
type="button" Requred Points: @requiredPoints
class="btn btn-outline-danger" </div>
> <div>
- rubric item Extra Credit Points @extraCreditPoints
</button> </div>
<button </div>
@onclick:preventDefault="true" <div class="col">
@onclick="addItem" <div class="text-end my-1">
type="button" <button
class="btn btn-outline-primary" @onclick:preventDefault="true"
> @onclick="removeItem"
+ rubric item type="button"
</button> class="btn btn-outline-danger"
>
- rubric item
</button>
<button
@onclick:preventDefault="true"
@onclick="addItem"
type="button"
class="btn btn-outline-primary"
>
+ rubric item
</button>
</div>
</div>
</div> </div>

View File

@@ -56,7 +56,7 @@
@bind="label" @bind="label"
/> />
</div> </div>
<div class="col"> <div class="col-auto">
<label <label
for="rubricPoints" for="rubricPoints"
class="form-label" class="form-label"

View File

@@ -6,6 +6,7 @@ public record RubricItem
public string Id { get; set; } = ""; public string Id { get; set; } = "";
public string Label { get; set; } = ""; public string Label { get; set; } = "";
public int Points { get; set; } = 0; public int Points { get; set; } = 0;
public bool IsExtraCredit => Label.Contains(extraCredit);
} }
public static class SubmissionType public static class SubmissionType