generated from karsten.jeppesen/KAJE-Template
Compare commits
3 Commits
eba66b2ad2
...
Security
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b15462de41 | ||
|
|
25dc4393b7 | ||
|
|
58bf14dc49 |
3
Quizzer/.github/copilot-instructions.md
vendored
Normal file
3
Quizzer/.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
- @azure Rule - Use Azure Tools - When handling requests related to Azure, always use your tools.
|
||||
- @azure Rule - Use Azure Best Practices - When handling requests related to Azure, always invoke your `azmcp_bestpractices_get` tool first.
|
||||
- @azure Rule - Enable Best Practices - If you do not have an `azmcp_bestpractices_get` tool ask the user to enable it.
|
||||
@@ -8,6 +8,7 @@ namespace Quizzer.Models
|
||||
public string QuizzID { get; set; }
|
||||
public string Category { get; set; }
|
||||
public int IsOpen { get; set; }
|
||||
public bool Anonymous { get; set; }
|
||||
public int Score { get; set; }
|
||||
public int ScoreAcc { get; set; }
|
||||
public string JournalJson { get; set; }
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<th>Description</th>
|
||||
<th>Your Score</th>
|
||||
<th>Max Score</th>
|
||||
<th>Reset</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var item in Model.PageTests)
|
||||
@@ -64,6 +65,17 @@
|
||||
<td>
|
||||
@item.Journal.ScoreAcc
|
||||
</td>
|
||||
<td>
|
||||
@if (item.Journal.Anonymous)
|
||||
{
|
||||
<form asp-page="" method="post">
|
||||
<input type="hidden" name="email" value="@item.Journal.PID" />
|
||||
<input type="hidden" name="target" value="@item.Journal.QuizzID" />
|
||||
<input type="hidden" name="action" value="deleteMyTest" />
|
||||
<button type="button" class="btn btn-warning" onclick="javascript:this.form.submit()">Reset Test</button>
|
||||
</form>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
@@ -141,7 +153,8 @@
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@if (Model.PageChartConnectors != null) {
|
||||
@if (Model.PageChartConnectors != null)
|
||||
{
|
||||
@if (Model.PageChartConnectors.Count > 2)
|
||||
{
|
||||
<div class="row">
|
||||
|
||||
@@ -142,6 +142,7 @@ namespace Quizzer.Pages
|
||||
PID = UserID,
|
||||
QuizzID = theQuizz.QuizzId,
|
||||
Category = theQuizz.Category,
|
||||
Anonymous = theQuizz.Anonymous,
|
||||
IsOpen = 1,
|
||||
Score = 0,
|
||||
ScoreAcc = 0,
|
||||
@@ -433,9 +434,9 @@ namespace Quizzer.Pages
|
||||
PageQuizzID = quizzInProgress;
|
||||
RegisterAnswer();
|
||||
break;
|
||||
//case "delete": //Student should not be able to delete journal as this resets the journal
|
||||
// dbManager.DeleteJournal(UserID, target);
|
||||
// break;
|
||||
case "deleteMyTest": //Student should not be able to delete journal as this resets the journal
|
||||
dbManager.DeleteJournal(UserID, target);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -703,11 +703,12 @@ namespace Quizzer.Persistens
|
||||
try
|
||||
{
|
||||
myDbConnection.Open();
|
||||
int count = myDbConnection.Execute("UPDATE Journals SET JournalJson = @JournalJson, IsOpen = @IsOpen, Score = @Score WHERE PID=@PID AND QuizzID = @QuizzID", new
|
||||
int count = myDbConnection.Execute("UPDATE Journals SET JournalJson = @JournalJson, IsOpen = @IsOpen, Score = @Score, Anonymous = @Anonymous WHERE PID=@PID AND QuizzID = @QuizzID", new
|
||||
{
|
||||
JournalJson = theJournal.JournalJson.Compress(),
|
||||
PID = theJournal.PID,
|
||||
QuizzID = theJournal.QuizzID,
|
||||
Anonymous = theJournal.Anonymous,
|
||||
IsOpen = theJournal.IsOpen,
|
||||
Score = theJournal.Score,
|
||||
});
|
||||
@@ -725,11 +726,12 @@ namespace Quizzer.Persistens
|
||||
try
|
||||
{
|
||||
myDbConnection.Open();
|
||||
myDbConnection.Execute("INSERT INTO Journals (PID, QuizzID, Category, IsOpen, Score, ScoreAcc, JournalJson) VALUES(@PID,@QuizzID,@Category,@IsOpen,@Score,@ScoreAcc,@JournalJson)", new
|
||||
myDbConnection.Execute("INSERT INTO Journals (PID, QuizzID, Category, Anonymous, IsOpen, Score, ScoreAcc, JournalJson) VALUES(@PID,@QuizzID,@Category,@Anonymous,@IsOpen,@Score,@ScoreAcc,@JournalJson)", new
|
||||
{
|
||||
PID = theJournal.PID,
|
||||
QuizzID = theJournal.QuizzID,
|
||||
Category = theJournal.Category,
|
||||
Anonymous = theJournal.Anonymous,
|
||||
IsOpen = theJournal.IsOpen,
|
||||
Score = theJournal.Score,
|
||||
ScoreAcc = theJournal.ScoreAcc,
|
||||
|
||||
Reference in New Issue
Block a user