Commit 49b38f3a authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Fix group result display (in sqlite old only)

parent 3e2aad46
Pipeline #347 failed with stages
in 5 minutes and 22 seconds
......@@ -525,14 +525,14 @@ impl MedalConnection for Connection {
let mut gradeinfo_iter = gradeinfo.iter();
if let Some(t /*Ok((grade, mut group, mut userinfo))*/) = gradeinfo_iter.next() {
let (grade, group, userinfo) = t;
let (grade, mut group, mut userinfo) = t.clone();
let mut grades: Vec<Grade> = vec![Default::default(); n_tasks];
let mut users: Vec<(UserInfo, Vec<Grade>)> = Vec::new();
let mut groups: Vec<(Group, Vec<(UserInfo, Vec<Grade>)>)> = Vec::new();
let index = grade.taskgroup;
grades[taskindex[&index]] = *grade;
grades[taskindex[&index]] = grade;
// TODO: does
// https://stackoverflow.com/questions/29859892/mutating-an-item-inside-of-nested-loops
......@@ -542,12 +542,15 @@ impl MedalConnection for Connection {
let (g, gr, ui) = ggu;
if gr.id != group.id {
users.push((userinfo.clone(), grades));
userinfo = ui.clone();
grades = vec![Default::default(); n_tasks];
groups.push((group.clone(), users));
group = gr.clone();
users = Vec::new();
} else if ui.id != userinfo.id {
users.push((userinfo.clone(), grades));
userinfo = ui.clone();
grades = vec![Default::default(); n_tasks];
}
let index = g.taskgroup;
......
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