Skip to content

Commit

Permalink
MAJOR FIX: Routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharaf-Mansour committed May 18, 2024
1 parent 23f0bfb commit 2a235d9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
@{
NavigationManager.NavigateTo("/");
NavigationManager.NavigateTo("");
}
</LayoutView>
</NotFound>
Expand Down
2 changes: 1 addition & 1 deletion Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
else
ExamService.SortAnswers();
ExamService.AssignNumbers();
NavigationManager.NavigateTo("/q/1");
NavigationManager.NavigateTo("Q/1");
}
}
2 changes: 1 addition & 1 deletion Pages/Questions.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</label>
</td>
<td>
<button class="btnsubmit" @onclick='()=>NavigationManager.NavigateTo("/Review")'>End</button>
<button class="btnsubmit" @onclick='()=>NavigationManager.NavigateTo("Review")'>End</button>
</td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion Pages/Questions.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ protected override void OnInitialized()
{

if (QNumber < 1 || QNumber > ExamService.RetrieveQeustionsCount())
NavigationManager.NavigateTo("/", true);
NavigationManager.NavigateTo("", true);
}
private void RadioSelection(Answer Answer)
{
Expand Down
2 changes: 1 addition & 1 deletion Pages/Report.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/Download"

<button class="btnsubmit" @onclick='()=>((IJSInProcessRuntime)JSRuntime).InvokeVoid("window.print", null)'>Print</button>
<button class="btnsubmit" @onclick='()=>NavigationManager.NavigateTo("/Score")'>back</button>
<button class="btnsubmit" @onclick='()=>NavigationManager.NavigateTo("Score")'>back</button>
@foreach (var question in ExamService.Exam.Questions)
{
<div>
Expand Down
4 changes: 2 additions & 2 deletions Pages/Review.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span class="spntbl">Not answered @ExamService.RetrieveNotAnsweredCount()<span style="color: #ddd;">|</span></span>
<span class="spntbl">Marked @ExamService.RetrieveFlagCount() <span style="color: #ddd;">|</span></span>
<span class="spntbl">Count @ExamService.RetrieveQeustionsCount() &nbsp;</span>
<button class="btnend" @onclick='()=>NavigationManager.NavigateTo($"/Score")'>End</button>
<button class="btnend" @onclick='()=>NavigationManager.NavigateTo($"Score")'>End</button>
</p>
<div class="table-box">
<table cellspacing='0' class="tbl">
Expand All @@ -24,7 +24,7 @@
<td class="tddata" style="width:10%">@question.Num</td>
<td class="tddata @(question.IsFlagged ? "mark" : "") " style="width:32%"></td>
<td class="tddata @(question.Answers.Any(x => x.IsSelected) == false? "answer" : "" )" style="width:42%"></td>
<td class="tddata"><button class="btndone" @onclick='()=>NavigationManager.NavigateTo($"/q/{question.Num}")'>@question.Num</button></td>
<td class="tddata"><button class="btndone" @onclick='()=>NavigationManager.NavigateTo($"Q/{question.Num}")'>@question.Num</button></td>
</tr>
}
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions Pages/Score.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<h1>You scored @ExamService.RetrieveScore() out of @ExamService.RetrieveQeustionsCount()</h1>
<progress class="progress" id="file" value="@ExamService.RetrieveGrade()" max="100" data-label="@ExamService.RetrieveGrade()"> </progress>
</div>
<button class="btnsubmit" @onclick='()=>NavigationManager.NavigateTo("/")'>
<button class="btnsubmit" @onclick='()=>NavigationManager.NavigateTo("")'>
Retake Exam
</button>
<button class="btnsubmit" @onclick='()=> NavigationManager.NavigateTo("/Download")'>
<button class="btnsubmit" @onclick='()=> NavigationManager.NavigateTo("Download")'>
Download EXAM
</button>
<div class="table-box">
Expand Down

0 comments on commit 2a235d9

Please sign in to comment.