diff --git a/requirements.txt b/requirements.txt index 3a7ed497d..4a54851bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ numpy==2.2.3 XlsxWriter==3.2.5 PyYAML==6.0.2 pre-commit==4.2.0 +Jinja2==3.1.6 diff --git a/scoreboard/main.py b/scoreboard/main.py index 82e368da6..67a95913c 100644 --- a/scoreboard/main.py +++ b/scoreboard/main.py @@ -3,6 +3,7 @@ import argparse import yaml import csv +from jinja2 import Environment, FileSystemLoader task_types = ['all', 'mpi', 'omp', 'seq', 'stl', 'tbb'] @@ -33,40 +34,7 @@ plagiarism_cfg = yaml.safe_load(file) assert plagiarism_cfg, "Plagiarism configuration is empty" -columns = ''.join(['
- (S)olution - The correctness and completeness of the implemented solution.
- (A)cceleration - The process of speeding up software to improve performance.
- Speedup = T(seq) / T(parallel)
- (E)fficiency - Optimizing software speed-up by improving CPU utilization and resource management.
- Efficiency = Speedup / NumProcs * 100%
- (D)eadline - The timeliness of the submission in relation to the given deadline.
- (P)lagiarism - The originality of the work, ensuring no copied content from external sources.
-
| Tasks | - {columns} -Total | -||||||||
|---|---|---|---|---|---|---|---|---|---|
| {letter} | ' - for _ in range(len(task_types)) - for letter in ('S', 'A', 'E', 'D', 'P') - ])} -|||||||||
| {dir} | " + row_types = [] total_count = 0 for task_type in task_types: max_sol_points = int(cfg["scoreboard"]["task"][task_type]["solution"]["max"]) - task_count = 0 - if directories[dir].get(task_type) == "done": - html_content += f'{max_sol_points} | ' - task_count += max_sol_points - elif directories[dir].get(task_type) == "disabled": - html_content += f'{max_sol_points} | ' - task_count += max_sol_points - else: - html_content += '0 | ' - html_content += '' - if dir in perf_stats.keys(): - html_content += perf_stats[dir][task_type] - else: - html_content += '?' - html_content += ' | ' - html_content += '0 | ' - html_content += '0 | ' - is_cheated = \ - dir in plagiarism_cfg["plagiarism"][task_type] or \ - dir[:-len("_disabled")] in plagiarism_cfg["plagiarism"][task_type] + status = directories[dir].get(task_type) + sol_points = max_sol_points if status in ("done", "disabled") else 0 + solution_style = "" + if status == "done": + solution_style = "background-color: lightgreen;" + elif status == "disabled": + solution_style = "background-color: #6495ED;" + + task_points = sol_points + is_cheated = ( + dir in plagiarism_cfg["plagiarism"][task_type] + or dir.rstrip("_disabled") in plagiarism_cfg["plagiarism"][task_type] + ) + plagiarism_points = 0 if is_cheated: plag_coeff = float(cfg["scoreboard"]["plagiarism"]["coefficient"]) - plagiarism_points = -plag_coeff * task_count - task_count += plagiarism_points - html_content += f'{plagiarism_points} | ' - else: - html_content += '0 | ' - total_count += task_count - html_content += f'{total_count} | ' - html_content += "
+ (S)olution - The correctness and completeness of the implemented solution.
+ (A)cceleration - The process of speeding up software to improve performance.
+ Speedup = T(seq) / T(parallel)
+ (E)fficiency - Optimizing software speed-up by improving CPU utilization and resource management.
+ Efficiency = Speedup / NumProcs * 100%
+ (D)eadline - The timeliness of the submission in relation to the given deadline.
+ (P)lagiarism - The originality of the work, ensuring no copied content from external sources.
+
| Tasks | + {% for type in task_types %} +{{ type }} | + {% endfor %} +Total | +||||
|---|---|---|---|---|---|---|
| {{ letter }} | + {% endfor %} + {% endfor %} +||||||
| {{ row.task }} | + {% for cell in row.types %} +{{ cell.solution_points }} | +{{ cell.perf }} | +0 | +0 | +{{ cell.plagiarism_points }} | + {% endfor %} +{{ row.total }} | +