Compare commits
3
Commits
fedc0c544a
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afc63067d6 | ||
|
|
3e107950fe | ||
|
|
e0649f503f |
No files matched your search
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "8.0.8",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,21 @@
|
||||
|
||||
@if (CurrentSession.LoadGame != null)
|
||||
{
|
||||
<h1>Vorherigen Lauf fortsetzen</h1>
|
||||
<h1>Vorheriges Quiz</h1>
|
||||
<div>@CurrentSession.LoadGame.Title</div>
|
||||
<button class="btn btn-primary" type="button" @onclick="() => StartQuiz(CurrentSession.LoadGame)">Fortsetzen</button>
|
||||
|
||||
@if (CurrentSession.LoadGame.Questions?.Count == 0 && CurrentSession.LoadGame.QuestionAnswers != null)
|
||||
{
|
||||
<button class="btn btn-primary" type="button" @onclick="() => StartQuiz(CurrentSession.LoadGame)">
|
||||
Ergebnisse ansehen</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-primary" type="button" @onclick="() => StartQuiz(CurrentSession.LoadGame)">
|
||||
Fortsetzen
|
||||
</button>
|
||||
}
|
||||
|
||||
<button class="btn btn-outline-danger" type="button" @onclick="DeleteGameState">Löschen</button>
|
||||
}
|
||||
|
||||
@@ -34,13 +46,13 @@
|
||||
<Body>
|
||||
@if (SelectedQuiz != null && NewGame != null)
|
||||
{
|
||||
@* <div class="mb-3">
|
||||
<label for="btngrpMode" class="form-label">Modus</label>
|
||||
<div class="btn-group form-control" id="btngrpMode">
|
||||
<a href="#" @onclick="() => NewGame.Mode = GameState.QuizMode.Practice" class="btn @(NewGame.Mode == GameState.QuizMode.Practice ? "btn-primary active" : "btn-outline-primary")">Üben</a>
|
||||
<a href="#" @onclick="() => NewGame.Mode = GameState.QuizMode.Tournament" class="btn @(NewGame.Mode == GameState.QuizMode.Tournament ? "btn-primary active" : "btn-outline-primary")">Rangliste</a>
|
||||
</div>
|
||||
</div> *@
|
||||
@* <div class="mb-3">
|
||||
<label for="btngrpMode" class="form-label">Modus</label>
|
||||
<div class="btn-group form-control" id="btngrpMode">
|
||||
<a href="#" @onclick="() => NewGame.Mode = GameState.QuizMode.Practice" class="btn @(NewGame.Mode == GameState.QuizMode.Practice ? "btn-primary active" : "btn-outline-primary")">Üben</a>
|
||||
<a href="#" @onclick="() => NewGame.Mode = GameState.QuizMode.Tournament" class="btn @(NewGame.Mode == GameState.QuizMode.Tournament ? "btn-primary active" : "btn-outline-primary")">Rangliste</a>
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="cboQuestionGroup" class="form-label">Fragenkatalog</label>
|
||||
@@ -57,10 +69,10 @@
|
||||
<input type="range" min="1" max="@QuestionCountMax" @bind="@QuestionCountValue" class="form-range" id="rngQuestionCount">
|
||||
</div>
|
||||
|
||||
@* <div class="mb-3">
|
||||
<label for="txtName" class="form-label">Name</label>
|
||||
<input @bind="NewGame.Username" class="form-control" type="text" placeholder="(optional)" id="txtName" />
|
||||
</div> *@
|
||||
@* <div class="mb-3">
|
||||
<label for="txtName" class="form-label">Name</label>
|
||||
<input @bind="NewGame.Username" class="form-control" type="text" placeholder="(optional)" id="txtName" />
|
||||
</div> *@
|
||||
}
|
||||
</Body>
|
||||
<Footer>
|
||||
|
||||
@@ -58,18 +58,18 @@ else
|
||||
<table class="table">
|
||||
<tbody>
|
||||
|
||||
<tr class="table-primary">
|
||||
<td>Fragen Gesamt</td>
|
||||
<td>@(CurrentSession.LoadGame.QuestionAnswers.Count)</td>
|
||||
</tr>
|
||||
<tr class="table-success">
|
||||
<td>Korrekt beantwortet</td>
|
||||
<td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => qa.IsCorrect).Count())</td>
|
||||
</tr>
|
||||
<tr class="table-danger">
|
||||
<td>Falsch beantwortet</td>
|
||||
<td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => !qa.IsCorrect).Count())</td>
|
||||
</tr>
|
||||
<tr class="table-primary">
|
||||
<td>Fragen Gesamt</td>
|
||||
<td>@(CurrentSession.LoadGame.QuestionAnswers.Count)</td>
|
||||
</tr>
|
||||
<tr class="table-success">
|
||||
<td>Korrekt beantwortet</td>
|
||||
<td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => qa.IsCorrect).Count())</td>
|
||||
</tr>
|
||||
<tr class="table-danger">
|
||||
<td>Falsch beantwortet</td>
|
||||
<td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => !qa.IsCorrect).Count())</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -126,11 +126,13 @@ else
|
||||
if (CurrentSession.LoadGame.QuestionAnswers == null) CurrentSession.LoadGame.QuestionAnswers = new();
|
||||
if (CurrentSession.LoadGame.CurrentQuestion != null)
|
||||
{
|
||||
CurrentSession.LoadGame.QuestionAnswers.Add(new(CurrentSession.LoadGame.CurrentQuestion)
|
||||
{
|
||||
GivenAnswers = SelectedAnswers,
|
||||
});
|
||||
CurrentSession.LoadGame.QuestionAnswers.Add(new(CurrentSession.LoadGame.CurrentQuestion));
|
||||
foreach (Answer aw in SelectedAnswers)
|
||||
{
|
||||
CurrentSession.LoadGame.QuestionAnswers[^1].GivenAnswers.Add(aw);
|
||||
}
|
||||
}
|
||||
|
||||
SelectedAnswers.Clear();
|
||||
CurrentSession.LoadGame.NextQuestion();
|
||||
await CurrentSession.SaveAsync();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,15 +1,20 @@
|
||||
ARG DOTNET_RUNTIME=mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
ARG DOTNET_SDK=mcr.microsoft.com/dotnet/sdk:8.0
|
||||
|
||||
# Unter https://aka.ms/customizecontainer erfahren Sie, wie Sie Ihren Debugcontainer anpassen und wie Visual Studio dieses Dockerfile verwendet, um Ihre Images für ein schnelleres Debuggen zu erstellen.
|
||||
|
||||
# Diese Stufe wird verwendet, wenn sie von VS im Schnellmodus ausgeführt wird (Standardeinstellung für Debugkonfiguration).
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
FROM ${DOTNET_RUNTIME} AS base
|
||||
USER app
|
||||
WORKDIR /app
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
|
||||
# Diese Stufe wird zum Erstellen des Dienstprojekts verwendet.
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
FROM ${DOTNET_SDK} AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["FWLAZ_Web.csproj", "."]
|
||||
@@ -23,15 +28,12 @@ FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./FWLAZ_Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# Set Write Permissions to database
|
||||
# FROM docker.io/library/alpine:3.20
|
||||
# RUN chmod 755 /Data/quiz.db
|
||||
|
||||
|
||||
# Diese Stufe wird in der Produktion oder bei Ausführung von VS im regulären Modus verwendet (Standard, wenn die Debugkonfiguration nicht verwendet wird).
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
VOLUME /app/Data
|
||||
USER root
|
||||
ENTRYPOINT ["dotnet", "FWLAZ_Web.dll"]
|
||||
|
||||
# Invalid
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"QuizDB": "Data Source=Data/quiz.db"
|
||||
},
|
||||
"AppSettings": {
|
||||
"RegistrationEnabled": true
|
||||
"RegistrationEnabled": false
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
Reference in new issue
Block a user