Skip to content

Commit

Permalink
Apply new delimiter more consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwrush committed Jan 24, 2025
1 parent 00feb3f commit f3c08e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/qperf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,23 @@ fn build_results(quizzer_names: Vec<String>, attempts: Vec<Vec<u32>>, correct_an
let mut result = String::new();

// Build the header
result.push_str("Quizzer,\t");
result.push_str("Quizzer");
result.push_str(&delim);
let mut question_types_list: Vec<_> = QUESTION_TYPE_INDICES.keys().collect();
question_types_list.sort();
for question_type in &question_types_list {
if !types.contains(question_type) {
continue;
}
result.push_str(&format!("{} Attempted,\t{} Correct,\t{} Bonuses Attempted,\t{} Bonuses Correct,\t", question_type, question_type, question_type, question_type));
result.push_str(&format!("{} Attempted{}{} Correct{}{} Bonuses Attempted{}{} Bonuses Correct{}", question_type, delim, question_type, delim, question_type, delim, question_type, delim));
}
result.push('\n');

// Build the results for each quizzer
for (i, quizzer_name) in quizzer_names.iter().enumerate() {
//QuizMachine outputs often put single quotes around quizzer names. Check for them and remove them if present.
let quizzer_name = quizzer_name.trim_matches('\'');
result.push_str(&format!("{},\t", quizzer_name));
result.push_str(&format!("{}{}", quizzer_name, delim));
for question_type in &question_types_list {
if types.len() > 0 && !types.contains(question_type) {
continue;
Expand Down

0 comments on commit f3c08e4

Please sign in to comment.