mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
|
|
@inject CoursePlanner planner
|
|
|
|
@code
|
|
{
|
|
[Parameter, EditorRequired]
|
|
public RubricItem RubricItem { get; set; } = default!;
|
|
|
|
[Parameter, EditorRequired]
|
|
public Action<RubricItem> OnUpdate { get; set; } = default!;
|
|
private void editItem(string label, int points)
|
|
{
|
|
var newRubricItem = RubricItem with
|
|
{
|
|
Label = label,
|
|
Points = points
|
|
};
|
|
OnUpdate(newRubricItem);
|
|
|
|
}
|
|
}
|
|
|
|
<li
|
|
class="list-group-item"
|
|
>
|
|
<div class="row">
|
|
<div class="col">
|
|
<label for="rubricLabel">Label</label>
|
|
<input
|
|
class="form-control"
|
|
id="rubricLabel"
|
|
name="rubricLabel"
|
|
@oninput="@(e => editItem(e.Value?.ToString() ?? "", RubricItem.Points))"
|
|
value="@RubricItem.Label"
|
|
/>
|
|
</div>
|
|
<div class="col">
|
|
<label for="rubricPoints">Points</label>
|
|
<input
|
|
class="form-control"
|
|
id="rubricPoints"
|
|
name="rubricPoints"
|
|
@oninput="@(e => editItem(
|
|
RubricItem.Label,
|
|
int.Parse(e.Value?.ToString() != "" ? e.Value?.ToString() ?? "0" : "0"))
|
|
)"
|
|
value="@RubricItem.Points"
|
|
type="number"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</li> |