Compare commits
5
Commits
e31c006e80
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7ca85a772 | ||
|
|
05b674ecbf | ||
|
|
aaa84eefa8 | ||
|
|
9aebb0c68e | ||
|
|
190b169b0f |
@@ -1,6 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "OK" > jenkins.result
|
echo "OK" > jenkins.result
|
||||||
|
|
||||||
|
# Check dotnet10 installed
|
||||||
|
! which dotnet || sudo apt-get install -y dotnet10
|
||||||
|
if ! which dotnet; then
|
||||||
|
echo "DOTNET NOT FOUND"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
# Find all .csproj files and loop through them
|
# Find all .csproj files and loop through them
|
||||||
find . -type f -name "*.csproj" | while read -r csproj; do
|
find . -type f -name "*.csproj" | while read -r csproj; do
|
||||||
echo "Building $csproj..."
|
echo "Building $csproj..."
|
||||||
|
|||||||
Vendored
+13
-4
@@ -56,6 +56,7 @@ pipeline {
|
|||||||
stage('Change to unix files') {
|
stage('Change to unix files') {
|
||||||
steps {
|
steps {
|
||||||
echo "Change to unix files"
|
echo "Change to unix files"
|
||||||
|
sh "! which dos2unix || sudo apt-get install -y dos2unix"
|
||||||
sh "/bin/dos2unix .workflow/* .workflow/*"
|
sh "/bin/dos2unix .workflow/* .workflow/*"
|
||||||
sh "/bin/chmod +x .workflow/* .workflow/*"
|
sh "/bin/chmod +x .workflow/* .workflow/*"
|
||||||
}
|
}
|
||||||
@@ -96,7 +97,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Scan with Ollama') {
|
stage('Scan with Ollama') {
|
||||||
when { expression { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
sh ".workflow/scan_with_ollama.sh \"$TEXT_FILES_FILE\" \"$SCAN_JSON_FILE\" \"$OLLAMA_MODEL\" \"$MAX_FILE_BYTES\" \"$REQUEST_TIMEOUT_SEC\""
|
sh ".workflow/scan_with_ollama.sh \"$TEXT_FILES_FILE\" \"$SCAN_JSON_FILE\" \"$OLLAMA_MODEL\" \"$MAX_FILE_BYTES\" \"$REQUEST_TIMEOUT_SEC\""
|
||||||
archiveArtifacts artifacts: "$SCAN_JSON_FILE", allowEmptyArchive: true
|
archiveArtifacts artifacts: "$SCAN_JSON_FILE", allowEmptyArchive: true
|
||||||
@@ -104,7 +107,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Markdown Report') {
|
stage('Build Markdown Report') {
|
||||||
when { expression { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
sh ".workflow/build_markdown_report.sh \"$SCAN_JSON_FILE\" \"$REPORT_FILE\""
|
sh ".workflow/build_markdown_report.sh \"$SCAN_JSON_FILE\" \"$REPORT_FILE\""
|
||||||
archiveArtifacts artifacts: "$REPORT_FILE", allowEmptyArchive: true
|
archiveArtifacts artifacts: "$REPORT_FILE", allowEmptyArchive: true
|
||||||
@@ -112,14 +117,18 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Report to Gitea (Issue)') {
|
stage('Report to Gitea (Issue)') {
|
||||||
when { expression { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
sh ".workflow/create_gitea_issue.sh \"$REPORT_FILE\""
|
sh ".workflow/create_gitea_issue.sh \"$REPORT_FILE\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Quality Gate') {
|
stage('Quality Gate') {
|
||||||
when { expression { branch 'Security' && fileExists('text_files.txt') && sh(script: "test -s text_files.txt", returnStatus: true) == 0 } }
|
when {
|
||||||
|
branch 'Security'
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
sh ".workflow/evaluate_threshold.sh \"$SCAN_JSON_FILE\" \"$FAIL_ON_MEDIUM_OR_HIGH\""
|
sh ".workflow/evaluate_threshold.sh \"$SCAN_JSON_FILE\" \"$FAIL_ON_MEDIUM_OR_HIGH\""
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-10
@@ -1,15 +1,21 @@
|
|||||||
Jenkinsfile with AI provisions
|
Jenkinsfile with AI provisions
|
||||||
|
|
||||||
The Build Agent should provide the following environment (in alphabetical order):
|
The Build Agent should provide the following environment (in alphabetical order):
|
||||||
- GITEA_AGENT in clear text
|
- GITEA_AGENT in clear text cicd-builder
|
||||||
- GITEA_API_URL in clear text
|
- GITEA_API_URL in clear text https://gitea.a.ucnit.eu/api/v1
|
||||||
- GITEA_API_KEY in clear text
|
- GITEA_API_KEY in clear text
|
||||||
- GIT_USER in clear text
|
- GIT_USER in clear text
|
||||||
- MAX_FILE_BYTES in clear text
|
- MAX_FILE_BYTES in clear text
|
||||||
- OLLAMA_API_KEY through credentials:secret text
|
- OLLAMA_API_KEY through credentials:secret text
|
||||||
- OLLAMA_API_URI in clear text
|
- OLLAMA_API_URI in clear text https://agent:12tf56so@ollama-api.a.ucnit.eu/v1
|
||||||
- OLLAMA_MODEL in clear text
|
- OLLAMA_MODEL in clear text
|
||||||
- REQUEST_TIMEOUT_SEC through credentials:secret text
|
- REQUEST_TIMEOUT_SEC through credentials:secret text
|
||||||
- FILE_EXTS in clear text (cshtml,cs,js,json)
|
- FILE_EXTS in clear text (cshtml,cs,js,json)
|
||||||
|
|
||||||
|
And the following settings
|
||||||
|
- Remote root directory ~/jenkins
|
||||||
|
- Labels builder
|
||||||
|
- Launch method Launch agents via ssh
|
||||||
|
- Host Key Verification Strategy Not verifying
|
||||||
|
\ No newline at end of file
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ if [[ -z "$HAS_FINDINGS" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
GITEA_AGENT="CICD-SYSTEM" # temporarily set this
|
||||||
|
|
||||||
: "${GITEA_API_URL:?Missing GITEA_API_URL}"
|
: "${GITEA_API_URL:?Missing GITEA_API_URL}"
|
||||||
: "${GITEA_API_KEY:?Missing GITEA_API_KEY}"
|
: "${GITEA_API_KEY:?Missing GITEA_API_KEY}"
|
||||||
: "${GITEA_AGENT:?Missing GITEA_AGENT}"
|
: "${GITEA_AGENT:?Missing GITEA_AGENT}"
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ if [[ ! -s "$FILES_LIST" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TMP_DIR="$(mktemp -d)"
|
TMP_DIR=".workflow/scan"
|
||||||
trap 'rm -rf "$TMP_DIR"' EXIT
|
[ -d $TMP_DIR ] && rm -rf $TMP_DIR
|
||||||
|
mkdir -p $TMP_DIR
|
||||||
|
|
||||||
SYS_PROMPT=$'You are a precise secure code scanning assistant. Analyze the provided file content and return findings as STRICT JSON only with this schema:\n{\n "findings": [\n {\n "severity": "LOW|MEDIUM|HIGH|CRITICAL",\n "rule_id": "string-identifier",\n "line": number|null,\n "description": "short human-readable description",\n "recommendation": "concise fix guidance",\n "references": ["optional references URLs or identifiers"]\n }\n ]\n}\nRules:\n- Output ONLY JSON. No markdown, no code fences, no commentary.\n- If no issues, output {\"findings\":[]}.\n- Prefer concrete, reproducible findings over theoretical. Highlight secrets, insecure configs, vulnerable patterns, risky dependencies (if visible), command injection, path traversal, deserialization, SSRF, XSS, SQLi, hardcoded credentials, bad crypto, weak TLS, etc.\n- Provide line numbers when confidently known; otherwise null.\n'
|
SYS_PROMPT=$'You are a precise secure code scanning assistant. Analyze the provided file content and return findings as STRICT JSON only with this schema:\n{\n "findings": [\n {\n "severity": "LOW|MEDIUM|HIGH|CRITICAL",\n "rule_id": "string-identifier",\n "line": number|null,\n "description": "short human-readable description",\n "recommendation": "concise fix guidance",\n "references": ["optional references URLs or identifiers"]\n }\n ]\n}\nRules:\n- Output ONLY JSON. No markdown, no code fences, no commentary.\n- If no issues, output {\"findings\":[]}.\n- Prefer concrete, reproducible findings over theoretical. Highlight secrets, insecure configs, vulnerable patterns, risky dependencies (if visible), command injection, path traversal, deserialization, SSRF, XSS, SQLi, hardcoded credentials, bad crypto, weak TLS, etc.\n- Provide line numbers when confidently known; otherwise null.\n'
|
||||||
|
|
||||||
@@ -82,6 +83,10 @@ $code + "
|
|||||||
echo "[INFO] [$idx] Scanning $file (${bytes} bytes) with model=$OLLAMA_MODEL ..."
|
echo "[INFO] [$idx] Scanning $file (${bytes} bytes) with model=$OLLAMA_MODEL ..."
|
||||||
resp_json="$TMP_DIR/resp_$idx.json"
|
resp_json="$TMP_DIR/resp_$idx.json"
|
||||||
set +e
|
set +e
|
||||||
|
# HERE BE DRAGONS
|
||||||
|
echo "[DEBUG] endpoint=[${OLLAMA_API_URI%/}/chat/completions]"
|
||||||
|
echo "[DEBUG] Authorization: Bearer ${OLLAMA_API_KEY}"
|
||||||
|
|
||||||
http_code=$(curl -sS -w "%{http_code}" -o "$resp_json" \
|
http_code=$(curl -sS -w "%{http_code}" -o "$resp_json" \
|
||||||
--max-time "$REQUEST_TIMEOUT_SEC" --connect-timeout 10 \
|
--max-time "$REQUEST_TIMEOUT_SEC" --connect-timeout 10 \
|
||||||
-H "Authorization: Bearer ${OLLAMA_API_KEY}" \
|
-H "Authorization: Bearer ${OLLAMA_API_KEY}" \
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
@page
|
||||||
|
@model Quizzer.Pages.ReportModel
|
||||||
|
@Html.AntiForgeryToken()
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Quizzer";
|
||||||
|
Layout = "_Layout-teacher";
|
||||||
|
}
|
||||||
|
<div class="container-fluid">
|
||||||
|
@if (Model.PageStatistics != null)
|
||||||
|
{ // Select a quiz to show the report for
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-12" style="background-color: lightgreen">
|
||||||
|
<h1><center>Report</center></h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-12">
|
||||||
|
<table class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Class</th>
|
||||||
|
<th>Quizz</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
@foreach (var item in Model.quizzList)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<form class="form-horizontal" method="post">
|
||||||
|
<input type="hidden" name="action" value="selectQuizz" />
|
||||||
|
<input type="hidden" name="changeTo" value="@item.QuizzId" />
|
||||||
|
<button type="button" class="btn btn-outline-primary" onclick="javascript:this.form.submit()">Select</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
<td>@item.Class</td>
|
||||||
|
<td>@item.CategoryText</td>
|
||||||
|
<td>
|
||||||
|
<form asp-page="" method="post">
|
||||||
|
<input type="hidden" name="action" value="delete" />
|
||||||
|
<input type="hidden" name="changeTo" value="@item.QuizzId" />
|
||||||
|
<button type="submit" class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Show the report for the selected quiz
|
||||||
|
@if (Model.PageStatistics.Questions.Count > 0 && Model.PageStatistics.MCList.Count > 0)
|
||||||
|
{
|
||||||
|
<div class="row">
|
||||||
|
<h3>Statistics for @Model.SelectedClass (@Model.SelectedCat)</h3><br>
|
||||||
|
@for (int Qindex = 0; Qindex < Model.PageStatistics.Questions.Count; Qindex++)
|
||||||
|
{
|
||||||
|
<table class="table table-sm">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 10%">Count</th>
|
||||||
|
<th>@Model.PageStatistics.Questions[Qindex].QuestionText</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
@for (int Aindex = 0; Aindex < @Model.PageStatistics.Questions[Qindex].AList.Count; Aindex++)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td class="align-text-top">@Model.PageStatistics.MCList[Qindex].Counter[Aindex]</td>
|
||||||
|
@if (@Model.PageStatistics.Questions[Qindex].AList[Aindex].Aok)
|
||||||
|
{
|
||||||
|
<td style="background-color:lightgreen">@Model.PageStatistics.Questions[Qindex].AList[Aindex].Atxt</td>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<td>@Model.PageStatistics.Questions[Qindex].AList[Aindex].Atxt</td>
|
||||||
|
}
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</table>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="row">
|
||||||
|
<h3>No statistics available</h3>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Quizzer.Extensions;
|
||||||
|
using Quizzer.Models;
|
||||||
|
using Quizzer.OpenIDConnect;
|
||||||
|
using Quizzer.Persistens;
|
||||||
|
|
||||||
|
namespace Quizzer.Pages
|
||||||
|
{
|
||||||
|
public class ReportModel : PageModel
|
||||||
|
{
|
||||||
|
[BindProperty]
|
||||||
|
public OpenIDUCNData ucnData { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
|
public string UserID { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
|
public List<QuizzDN> quizzList { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
|
public StatisticsMCDN PageStatistics { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
|
public string SelectedClass { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
|
public string SelectedCat { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
|
public string myFullName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private bool isDebug;
|
||||||
|
private string KCUserID { get; set; }
|
||||||
|
|
||||||
|
private DbOps dbManager = new();
|
||||||
|
private OpenIDConnectUtils OpenIDUtils = new();
|
||||||
|
|
||||||
|
|
||||||
|
public string reportCookie { get; set; }
|
||||||
|
|
||||||
|
private const string cookieName = "ReportCookie";
|
||||||
|
|
||||||
|
private void GetMyCookie()
|
||||||
|
{
|
||||||
|
string jsonString = HttpContext.Request.Cookies[cookieName];
|
||||||
|
if (jsonString != null)
|
||||||
|
{
|
||||||
|
reportCookie = JsonConvert.DeserializeObject<string>(jsonString);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Here if no cookie found
|
||||||
|
reportCookie = "";
|
||||||
|
// Save the new cookie
|
||||||
|
SetMyCookie();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetMyCookie()
|
||||||
|
{
|
||||||
|
string jsonResult = JsonConvert.SerializeObject(reportCookie);
|
||||||
|
Response.Cookies.Append(cookieName, jsonResult, new Microsoft.AspNetCore.Http.CookieOptions
|
||||||
|
{
|
||||||
|
Secure = true,
|
||||||
|
HttpOnly = true,
|
||||||
|
SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveMyCookie()
|
||||||
|
{
|
||||||
|
Response.Cookies.Delete(cookieName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
public void Common()
|
||||||
|
{
|
||||||
|
isDebug = MyConfiguration.Get()["DEBUG"] == "Y";
|
||||||
|
string? ucnDataJson = OpenIDUtils.GetJwtClaim(HttpContext, "ucn");
|
||||||
|
|
||||||
|
KCUserID = OpenIDUtils.GetJwtClaim(HttpContext, "sub");
|
||||||
|
ucnData = JsonConvert.DeserializeObject<OpenIDUCNData>(ucnDataJson);
|
||||||
|
UserID = OpenIDUtils.GetJwtClaim(HttpContext, "email").HashSHA256();
|
||||||
|
myFullName = OpenIDUtils.GetJwtClaim(HttpContext, "name");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public IActionResult OnGet()
|
||||||
|
{
|
||||||
|
Common();
|
||||||
|
if (ucnData.theRole != "teacher" && ucnData.theRole != "developer") return Redirect("/");
|
||||||
|
GetMyCookie();
|
||||||
|
quizzList = dbManager.GetQuizzesTeacher(UserID);
|
||||||
|
if (reportCookie != "")
|
||||||
|
{
|
||||||
|
// traverse all statistics
|
||||||
|
PageStatistics = dbManager.GetStatisticsMCDN(reportCookie);
|
||||||
|
// Show the report for the selected quiz while making sure a reload will reset for a new selection
|
||||||
|
Quizz selectedQuiz = dbManager.GetQuizz(reportCookie);
|
||||||
|
SelectedClass = selectedQuiz.Class;
|
||||||
|
Cat selectedCat = dbManager.GetCat(selectedQuiz.Category);
|
||||||
|
SelectedCat = selectedCat.Txt;
|
||||||
|
RemoveMyCookie();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PageStatistics = null;
|
||||||
|
}
|
||||||
|
return Page();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IActionResult OnPost(string action = "na", string changeTo = "na")
|
||||||
|
{
|
||||||
|
Common();
|
||||||
|
GetMyCookie();
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case "selectQuizz":
|
||||||
|
reportCookie = changeTo;
|
||||||
|
break;
|
||||||
|
case "na":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SetMyCookie();
|
||||||
|
return Redirect("/Report");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-page="/Statistics">Statistics</a>
|
<a class="nav-link text-dark" asp-area="" asp-page="/Statistics">Statistics</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="" asp-page="/Report">Report</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-page="/Coverage">Coverage</a>
|
<a class="nav-link text-dark" asp-area="" asp-page="/Coverage">Coverage</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-page="/Statistics">Statistics</a>
|
<a class="nav-link text-dark" asp-area="" asp-page="/Statistics">Statistics</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="" asp-page="/Report">Report</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-page="/Coverage">Coverage</a>
|
<a class="nav-link text-dark" asp-area="" asp-page="/Coverage">Coverage</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -578,13 +578,13 @@ namespace Quizzer.Persistens
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
myDbConnection.Open();
|
myDbConnection.Open();
|
||||||
return myDbConnection.Query<Quizz>("SELECT * FROM Quizzs WHERE Class = @theClass", new { theClass = theClass }).AsList();
|
return myDbConnection.Query<Quizz>("SELECT * FROM Quizzs WHERE Class = @theClass ORDER BY Descr DESC", new { theClass = theClass }).AsList();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
||||||
CreateIfNotExist(myDbConnection);
|
CreateIfNotExist(myDbConnection);
|
||||||
return myDbConnection.Query<Quizz>("SELECT * FROM Quizzs WHERE Class = @theClass", new { theClass = theClass }).AsList();
|
return myDbConnection.Query<Quizz>("SELECT * FROM Quizzs WHERE Class = @theClass ORDER BY Descr DESC", new { theClass = theClass }).AsList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ namespace Quizzer.Persistens
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
myDbConnection.Open();
|
myDbConnection.Open();
|
||||||
List<QuizzDN> theQuizzes = myDbConnection.Query<QuizzDN>("SELECT * FROM Quizzs WHERE Owner = @theOwner", new { theOwner = theTeacher }).AsList();
|
List<QuizzDN> theQuizzes = myDbConnection.Query<QuizzDN>("SELECT * FROM Quizzs WHERE Owner = @theOwner ORDER BY Class ASC, Descr ASC", new { theOwner = theTeacher }).AsList();
|
||||||
foreach (var item in theQuizzes)
|
foreach (var item in theQuizzes)
|
||||||
{
|
{
|
||||||
Cat theCat = GetCat(item.Category);
|
Cat theCat = GetCat(item.Category);
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="bootstrap" Version="5.3.8" />
|
<PackageReference Include="bootstrap" Version="5.3.8" />
|
||||||
<PackageReference Include="Chart.js" Version="3.7.1" />
|
<PackageReference Include="Chart.js" Version="3.7.1" />
|
||||||
<PackageReference Include="Dapper" Version="2.1.72" />
|
<PackageReference Include="Dapper" Version="2.1.89" />
|
||||||
<PackageReference Include="Dapper.Contrib" Version="2.0.78" />
|
<PackageReference Include="Dapper.Contrib" Version="2.0.78" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.14" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.14" />
|
||||||
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.18.0" />
|
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.23.0" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
||||||
<PackageReference Include="MySqlConnector" Version="2.5.0" />
|
<PackageReference Include="MySqlConnector" Version="2.6.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user