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 QuizzID { get; set; }
|
||||||
public string Category { get; set; }
|
public string Category { get; set; }
|
||||||
public int IsOpen { get; set; }
|
public int IsOpen { get; set; }
|
||||||
|
public bool Anonymous { get; set; }
|
||||||
public int Score { get; set; }
|
public int Score { get; set; }
|
||||||
public int ScoreAcc { get; set; }
|
public int ScoreAcc { get; set; }
|
||||||
public string JournalJson { get; set; }
|
public string JournalJson { get; set; }
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
<th>Your Score</th>
|
<th>Your Score</th>
|
||||||
<th>Max Score</th>
|
<th>Max Score</th>
|
||||||
|
<th>Reset</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@foreach (var item in Model.PageTests)
|
@foreach (var item in Model.PageTests)
|
||||||
@@ -64,6 +65,17 @@
|
|||||||
<td>
|
<td>
|
||||||
@item.Journal.ScoreAcc
|
@item.Journal.ScoreAcc
|
||||||
</td>
|
</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>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
@@ -141,7 +153,8 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@if (Model.PageChartConnectors != null) {
|
@if (Model.PageChartConnectors != null)
|
||||||
|
{
|
||||||
@if (Model.PageChartConnectors.Count > 2)
|
@if (Model.PageChartConnectors.Count > 2)
|
||||||
{
|
{
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ namespace Quizzer.Pages
|
|||||||
PID = UserID,
|
PID = UserID,
|
||||||
QuizzID = theQuizz.QuizzId,
|
QuizzID = theQuizz.QuizzId,
|
||||||
Category = theQuizz.Category,
|
Category = theQuizz.Category,
|
||||||
|
Anonymous = theQuizz.Anonymous,
|
||||||
IsOpen = 1,
|
IsOpen = 1,
|
||||||
Score = 0,
|
Score = 0,
|
||||||
ScoreAcc = 0,
|
ScoreAcc = 0,
|
||||||
@@ -433,9 +434,9 @@ namespace Quizzer.Pages
|
|||||||
PageQuizzID = quizzInProgress;
|
PageQuizzID = quizzInProgress;
|
||||||
RegisterAnswer();
|
RegisterAnswer();
|
||||||
break;
|
break;
|
||||||
//case "delete": //Student should not be able to delete journal as this resets the journal
|
case "deleteMyTest": //Student should not be able to delete journal as this resets the journal
|
||||||
// dbManager.DeleteJournal(UserID, target);
|
dbManager.DeleteJournal(UserID, target);
|
||||||
// break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -703,11 +703,12 @@ namespace Quizzer.Persistens
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
myDbConnection.Open();
|
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(),
|
JournalJson = theJournal.JournalJson.Compress(),
|
||||||
PID = theJournal.PID,
|
PID = theJournal.PID,
|
||||||
QuizzID = theJournal.QuizzID,
|
QuizzID = theJournal.QuizzID,
|
||||||
|
Anonymous = theJournal.Anonymous,
|
||||||
IsOpen = theJournal.IsOpen,
|
IsOpen = theJournal.IsOpen,
|
||||||
Score = theJournal.Score,
|
Score = theJournal.Score,
|
||||||
});
|
});
|
||||||
@@ -725,11 +726,12 @@ namespace Quizzer.Persistens
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
myDbConnection.Open();
|
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,
|
PID = theJournal.PID,
|
||||||
QuizzID = theJournal.QuizzID,
|
QuizzID = theJournal.QuizzID,
|
||||||
Category = theJournal.Category,
|
Category = theJournal.Category,
|
||||||
|
Anonymous = theJournal.Anonymous,
|
||||||
IsOpen = theJournal.IsOpen,
|
IsOpen = theJournal.IsOpen,
|
||||||
Score = theJournal.Score,
|
Score = theJournal.Score,
|
||||||
ScoreAcc = theJournal.ScoreAcc,
|
ScoreAcc = theJournal.ScoreAcc,
|
||||||
|
|||||||
Reference in New Issue
Block a user