|
11 | 11 | task_type_dir = tasks_dir / task_type
|
12 | 12 | if task_type_dir.exists() and task_type_dir.is_dir():
|
13 | 13 | for task_name in (d.name for d in task_type_dir.iterdir() if d.is_dir()):
|
14 |
| - directories[task_name][task_type] = True |
| 14 | + if task_name.endswith("_disabled"): |
| 15 | + task_name = task_name[:-len("_disabled")] |
| 16 | + directories[task_name][task_type] = "disabled" |
| 17 | + else: |
| 18 | + directories[task_name][task_type] = "done" |
15 | 19 |
|
16 | 20 | print(directories)
|
17 | 21 |
|
18 |
| -columns = ''.join(['<th>' + task_type + '</th>' for task_type in task_types]) |
| 22 | +columns = ''.join(['<th colspan=4 style="text-align: center;">' + task_type + '</th>' for task_type in task_types]) |
19 | 23 | html_content = f"""
|
20 | 24 | <!DOCTYPE html>
|
21 | 25 | <html>
|
|
25 | 29 | </head>
|
26 | 30 | <body>
|
27 | 31 | <h1>Scoreboard</h1>
|
| 32 | + <p>S - Solution, P - Performance, O - Overdue, C - Cheating</p> |
28 | 33 | <table>
|
29 | 34 | <tr>
|
30 |
| - <th>Tasks</th> |
| 35 | + <th colspan=4>Tasks</th> |
31 | 36 | {columns}
|
| 37 | + <th>Total</th> |
| 38 | + </tr> |
| 39 | + <tr> |
| 40 | + <th colspan=4></th> |
| 41 | + {''.join(['<th>S</th><th>P</th><th>O</th><th>C</th>' for _ in range(len(task_types))])} |
| 42 | + <th></th> |
32 | 43 | </tr>
|
33 | 44 | """
|
34 | 45 |
|
35 | 46 | for dir in directories:
|
36 |
| - html_content += f"<tr><td>{dir}</td>" |
| 47 | + html_content += f"<tr><td colspan=4>{dir}</td>" |
| 48 | + total_count = 0 |
37 | 49 | for task_type in task_types:
|
38 |
| - if directories[dir].get(task_type): |
39 |
| - html_content += "<td>✔</td>" |
| 50 | + if directories[dir].get(task_type) == "done": |
| 51 | + html_content += '<td style="text-align: center;">1</td>' |
| 52 | + total_count += 1 |
| 53 | + elif directories[dir].get(task_type) == "disabled": |
| 54 | + html_content += '<td style="text-align: center;background-color: lightblue;">1</td>' |
| 55 | + total_count += 1 |
40 | 56 | else:
|
41 |
| - html_content += "<td>✘</td>" |
| 57 | + html_content += "<td>0</td>" |
| 58 | + html_content += '<td style="text-align: center;">0</td>' |
| 59 | + html_content += '<td style="text-align: center;">0</td>' |
| 60 | + html_content += '<td style="text-align: center;">0</td>' |
| 61 | + html_content += f'<td style="text-align: center;">{total_count}</td>' |
42 | 62 | html_content += "</tr>"
|
43 | 63 |
|
44 | 64 | html_content += """
|
|
0 commit comments