Commit 7f4d43fb authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Show group results to contest with members names und links to groups and members

parent 95f039b7
Pipeline #249 failed with stages
in 4 minutes and 27 seconds
......@@ -286,13 +286,13 @@ pub fn show_contest_results<T: MedalConnection>(conn: &T, contest_id: i32, sessi
let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
let (tasknames, resultdata) = conn.get_contest_groups_grades(session.id, contest_id);
let mut results: Vec<(String, Vec<(String, Vec<String>)>)> = Vec::new();
let mut results: Vec<(String, i32, Vec<(String, i32, Vec<String>)>)> = Vec::new();
for (group, groupdata) in resultdata {
let mut groupresults: Vec<(String, Vec<String>)> = Vec::new();
let mut groupresults: Vec<(String, i32, Vec<String>)> = Vec::new();
//TODO: use user
for (_user, userdata) in groupdata {
for (user, userdata) in groupdata {
let mut userresults: Vec<String> = Vec::new();
userresults.push(String::new());
......@@ -309,10 +309,10 @@ pub fn show_contest_results<T: MedalConnection>(conn: &T, contest_id: i32, sessi
userresults[0] = format!("{}", summe);
groupresults.push((format!("Name"), userresults))
groupresults.push((format!("{} {}", user.firstname.unwrap_or_default(), user.lastname.unwrap_or("–".to_string())), user.id, userresults))
}
results.push((format!("{}", group.name), groupresults));
results.push((format!("{}", group.name), group.id.unwrap_or(0), groupresults));
}
let mut data = json_val::Map::new();
......
......@@ -24,11 +24,11 @@
</tr>
{{#each result}}
<tr><td>{{this.0}}</td></tr>
{{#each this.1}}
<tr><td><a href="/group/{{this.1}}">{{this.0}}</a></td></tr>
{{#each this.2}}
<tr><td></td>
<td>{{this.0}}</td>
{{#each this.1}}
<td><a href="/user/{{this.1}}">{{this.0}}</a></td>
{{#each this.2}}
<td>{{this}}</td>
{{/each}}
{{/each}}
......@@ -39,4 +39,4 @@
<em>Für diesen Wettbewerb sind noch keine Ergebnisse ihrer Gruppen verzeichnet.</em>
{{/if}}
<p><a href="..">Zum Wettbewerb</a> | <a href="../..">Zur Wettbewerbsübersicht</a> | <a href="/">Zur Startseite</a></p>
\ No newline at end of file
<p><a href="..">Zum Wettbewerb</a> | <a href="../..">Zur Wettbewerbsübersicht</a> | <a href="/">Zur Startseite</a></p>
......@@ -17,7 +17,7 @@
<p>Sie können auch Gruppen über einen <a href="csv">CSV-Upload</a> anlegen.
<h2>Meine bestehenden Gruppen</h2>
<p><a href="/contest/">Wettbewerbsergebnisse meiner Gruppen</a></p>
<p>Für die Wettbewerbsergebnisse meiner Gruppen bitte zunächst <a href="/contest/">einen Wettbewerb auswählen</a></p>
<p>
{{#if group}}
......
......@@ -61,7 +61,17 @@
</div>
</div>
</div>
<div class="columns alogin">
<div class="column is-8 is-offset-2">
<div class="notification is-info">
<h3 class="title is-5">Gruppenergebnisse</h3>
<a href="/contest/{{ contest.id }}/result/">Ergebnisse meiner Gruppen für diesen Wettbewerb einsehen</a>
</div>
</div>
</div>
{{/if}}
<div class="columns" id="bare_content">
{{/if}}
......
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