Commit 1266bf24 authored by Robert Czechowski's avatar Robert Czechowski

Show logincodes in contest results (Fixes #130)

parent 9dc3e879
Pipeline #1165 passed with stages
in 25 minutes and 29 seconds
......@@ -490,10 +490,12 @@ pub fn show_contest_results<T: MedalConnection>(conn: &T, contest_id: i32, sessi
let (tasknames, resultdata) = conn.get_contest_groups_grades(session.id, contest_id);
let mut results: Vec<(String, i32, Vec<(String, String, i32, String, Vec<String>)>)> = Vec::new();
// TODO: Reorder logincode to be before points
// TODO: Wrap in struct, so fields have a name!
let mut results: Vec<(String, i32, Vec<(String, String, i32, String, Vec<String>, String)>)> = Vec::new();
for (group, groupdata) in resultdata {
let mut groupresults: Vec<(String, String, i32, String, Vec<String>)> = Vec::new();
let mut groupresults: Vec<(String, String, i32, String, Vec<String>, String)> = Vec::new();
//TODO: use user
for (user, userdata) in groupdata {
......@@ -517,7 +519,8 @@ pub fn show_contest_results<T: MedalConnection>(conn: &T, contest_id: i32, sessi
user.lastname.unwrap_or_else(|| "–".to_string()),
user.id,
grade_to_string(user.grade),
userresults))
userresults,
user.logincode.unwrap_or_else(|| "".to_string())))
}
results.push((group.name.to_string(), group.id.unwrap_or(0), groupresults));
......
......@@ -13,8 +13,10 @@
<tr>
<td>Gruppe</td>
<td>Teilnehmer</td>
<td>Logincode</td>
<td>Punkte</td>
<tr>
<td></td>
<td></td>
<td></td>
<td>Summe</td>
......@@ -28,6 +30,7 @@
{{#each this.2}}
<tr><td></td>
<td><a href="/user/{{this.1}}">{{this.0}}</a></td>
<td>{{this.5}}</a></td>
{{#each this.4}}
<td>{{this}}</td>
{{/each}}
......
Gruppe,Vorname,Nachname,Jahrgangsstufe,Gesamtpunkte{{#each taskname}},{{this}}{{/each}}
{{#each result}}{{#each this.2}}{{../0}},{{this.0}},{{this.1}},{{this.3}}{{#each this.4}},{{this}}{{/each}}
Gruppe,Vorname,Nachname,Jahrgangsstufe,Logincode,Gesamtpunkte{{#each taskname}},{{this}}{{/each}}
{{#each result}}{{#each this.2}}{{../0}},{{this.0}},{{this.1}},{{this.3}},{{this.5}}{{#each this.4}},{{this}}{{/each}}
{{/each}}{{/each}}
......@@ -22,7 +22,7 @@
<style>
td { padding-left: 15px;}
td:nth-child(3) {
td:nth-child(4) {
font-weight: bold;
}
</style>
......@@ -33,6 +33,7 @@
<tr>
<td>Gruppe</td>
<td>Teilnehmer</td>
<td>Logincode</td>
<td>Gesamtpunkte</td>
{{#each taskname}}
<td>{{this}}</td>
......@@ -41,10 +42,11 @@
{{#each result}}
<tr style="background-color:#e5fae5;"><td style="max-width:200px;"><a href="/group/{{this.1}}">{{this.0}}</a></td><td colspan="12"></td></tr>
<tr style="background-color:#e5fae5;"><td style="max-width:200px;"><a href="/group/{{this.1}}">{{this.0}}</a></td><td colspan="99"></td></tr>
{{#each this.2}}
<tr><td></td>
<td><a href="/user/{{this.2}}">{{this.0}} {{this.1}} ({{this.3}})</a></td>
<td>{{this.5}}</a></td>
{{#each this.4}}
<td>{{this}}</td>
{{/each}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment