Files
Multiplechoicetrainer/MultipleChoiceTrainer/Views/Questions/List.cshtml
2020-06-10 13:23:29 +02:00

38 lines
1021 B
Plaintext

@model IEnumerable<MultipleChoiceTrainer.Models.DataModels.Question>
@{
ViewData["Title"] = "Fragen";
}
<table class="table table-hover">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Text)
</th>
<th>
@Html.DisplayNameFor(model => model.Choices)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Text)
</td>
<td>
@foreach (var choice in item.Choices)
{
<i class="@if (choice.IsTrue) { <text>fas fa-check text-success</text> } else { <text>fas fa-times text-danger</text> }"></i> @choice.Text<br />
}
</td>
<td>
<a asp-action="Edit" asp-route-id="@item.Id"><i class="fas fa-edit"></i> Bearbeiten</a>
</td>
</tr>
}
</tbody>
</table>