|
| 1 | +# README |
| 2 | + |
| 3 | +### 顶级字段 |
| 4 | + |
| 5 | +| 字段名 | 类型 | 说明 | 举例 | |
| 6 | +| ------------- | ---------- | ---------------- | ------------------------------------- | |
| 7 | +| `name` | `string` | 比赛名称 | `"contest"` | |
| 8 | +| `version` | `string` | LemonLime 版本 | `"Lemonlime Version 0.3.6.1:7545e02"` | |
| 9 | +| `task_names` | `string[]` | 题目名称数组 | `["plus", "minus"]` | |
| 10 | +| `i18n` | `object` | i18n 字典 | 见下节 | |
| 11 | +| `contestants` | `object[]` | 选手成绩数据数组 | 见下节 | |
| 12 | + |
| 13 | +### i18n |
| 14 | + |
| 15 | +| 字段名 | 举例 | |
| 16 | +| ------------- | --------------------------------------------------------- | |
| 17 | +| `rank_list` | `"排名表"` | |
| 18 | +| `hint` | `"点击名字或单题分数跳转到详细信息。使用 LemonLime 评测"` | |
| 19 | +| `rank` | `"排名"` | |
| 20 | +| `name` | `"名称"` | |
| 21 | +| `total` | `"总分"` | |
| 22 | +| `contestant` | `"选手"` | |
| 23 | +| `task` | `"试题"` | |
| 24 | +| `source_file` | `"源程序:"` | |
| 25 | +| `no_source` | `"未找到选手程序"` | |
| 26 | +| `testcase` | `"测试点"` | |
| 27 | +| `input` | `"输入文件"` | |
| 28 | +| `result` | `"测试结果"` | |
| 29 | +| `time` | `"运行用时"` | |
| 30 | +| `memory` | `"内存消耗"` | |
| 31 | +| `score` | `"得分"` | |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +### contestants 数组内对象 |
| 36 | + |
| 37 | +| 字段名 | 类型 | 说明 | 举例 | |
| 38 | +| -------------- | ---------- | -------------------- | --------------- | |
| 39 | +| `name` | `string` | 选手姓名 | `"Alice"` | |
| 40 | +| `total_score` | `number` | 选手总分 | `200` | |
| 41 | +| `total_bg` | `string` | 总分单元格背景 (HSL) | `"0, 70%, 90%"` | |
| 42 | +| `total_border` | `string` | 总分单元格边框 (HSL) | `"0, 70%, 50%"` | |
| 43 | +| `tasks` | `object[]` | 题目结果数组 | 见下节 | |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +### tasks 数组内对象 |
| 48 | + |
| 49 | +| 字段名 | 类型 | 说明 | 举例 | |
| 50 | +| --------- | ---------- | ------------------ | ----------------- | |
| 51 | +| `score` | `number` | 该题单项得分 | `100` | |
| 52 | +| `bg` | `string` | 该题得分背景 (HSL) | `"120, 30%, 60%"` | |
| 53 | +| `file` | `string` | 选手程序文件名(可选,若无该字段则表示找不到选手程序) | `"plus.cpp"` | |
| 54 | +| `details` | `object[]` | 测试点详情数组 | 见下节 | |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +### details 数组内对象 |
| 59 | + |
| 60 | +| 字段名 | 类型 | 说明 | 举例 | |
| 61 | +| ------------ | -------- | ---------------------------------------------------- | ------------------------------ | |
| 62 | +| `label` | `string` | 测试点编号或子任务信息,允许使用 `<br>` | `"#2<br/>子任务依赖情况:Pure"` | |
| 63 | +| `row_span` | `number` | 合并单元格行数(0 表示该行被合并,1 表示该行不合并) | `1` | |
| 64 | +| `input` | `string` | 该测试点输入文件名 | `"plus2.in"` | |
| 65 | +| `result` | `string` | 评测状态结果文字 | `"评测通过"` | |
| 66 | +| `time` | `string` | 运行耗时字符串 | `"0.005 s"` | |
| 67 | +| `memory` | `string` | 内存占用字符串 | `"5.34 MB"` | |
| 68 | +| `score` | `number` | 该项得分 | `20` | |
| 69 | +| `full_score` | `number` | 该项满分 | `20` | |
| 70 | +| `bg` | `string` | 状态背景 (RGB) | `"rgb(192, 255, 192)"` | |
| 71 | +| `info` | `string` | 测评信息(可选) | `在第四行,读取到 123456,但期望 789123` | |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +### 示例 JSON |
| 76 | + |
| 77 | +以下 JSON 可用于调试模板渲染: |
| 78 | + |
| 79 | +```json |
| 80 | +{ |
| 81 | + "name": "example contest", |
| 82 | + "version": "Lemonlime Version 0.3.6.1:7545e02", |
| 83 | + "i18n": { |
| 84 | + "rank_list": "排名表", |
| 85 | + "hint": "点击名字或单题分数跳转到详细信息。使用 LemonLime 评测", |
| 86 | + "rank": "排名", |
| 87 | + "name": "名称", |
| 88 | + "total": "总分", |
| 89 | + "contestant": "选手", |
| 90 | + "task": "试题", |
| 91 | + "source_file": "源程序:", |
| 92 | + "no_source": "未找到选手程序", |
| 93 | + "testcase": "测试点", |
| 94 | + "input": "输入文件", |
| 95 | + "result": "测试结果", |
| 96 | + "time": "运行用时", |
| 97 | + "memory": "内存消耗", |
| 98 | + "score": "得分" |
| 99 | + }, |
| 100 | + "task_names": ["plus", "minus"], |
| 101 | + "contestants": [ |
| 102 | + { |
| 103 | + "name": "Alice", |
| 104 | + "rank": 1, |
| 105 | + "total_score": 150, |
| 106 | + "total_bg": "120, 30%, 90%", |
| 107 | + "total_border": "120, 30%, 50%", |
| 108 | + "tasks": [ |
| 109 | + { |
| 110 | + "score": 100, |
| 111 | + "bg": "120, 30%, 70%", |
| 112 | + "file": "plus.cpp", |
| 113 | + "details": [ |
| 114 | + { "label": "#1", "row_span": 1, "input": "plus1.in", "result": "评测通过", "time": "0.001 s", "memory": "1.2 MB", "score": 50, "full_score": 50, "bg": "rgb(192, 255, 192)" }, |
| 115 | + { "label": "#2", "row_span": 1, "input": "plus2.in", "result": "评测通过", "time": "0.002 s", "memory": "1.2 MB", "score": 50, "full_score": 50, "bg": "rgb(192, 255, 192)" } |
| 116 | + ] |
| 117 | + }, |
| 118 | + { |
| 119 | + "score": 50, |
| 120 | + "bg": "120,28.9006%,82.3499%", |
| 121 | + "file": "minus.cpp", |
| 122 | + "details": [ |
| 123 | + { "label": "#1", "row_span": 1, "input": "minus1.in", "result": "评测通过", "time": "0.001 s", "memory": "1.2 MB", "score": 50, "full_score": 50, "bg": "rgb(192, 255, 192)" }, |
| 124 | + { "label": "#2<br>子任务依赖情况:Pure", "row_span": 2, "input": "minus2.in", "result": "答案错误", "time": "0.001 s", "memory": "2.0 MB", "score": 0, "full_score": 50, "bg": "rgb(255, 192, 192)", "info": "在第四行,读取到 123456,但期望 789123" }, |
| 125 | + { "label": "", "row_span": 0, "input": "minus3.in", "result": "运行错误", "time": "0.001 s", "memory": "2.0 MB", "score": 0, "full_score": 50, "bg": "rgb(255, 192, 192)" } |
| 126 | + ] |
| 127 | + } |
| 128 | + ] |
| 129 | + }, |
| 130 | + { |
| 131 | + "name": "Bob", |
| 132 | + "rank": 2, |
| 133 | + "total_score": 0, |
| 134 | + "total_bg": "0, 0%, 90%", |
| 135 | + "total_border": "0, 0%, 70%", |
| 136 | + "tasks": [ |
| 137 | + { "score": 0, "bg": "0, 0%, 90%" }, |
| 138 | + { "score": 0, "bg": "0, 0%, 90%" } |
| 139 | + ] |
| 140 | + } |
| 141 | + ] |
| 142 | +} |
| 143 | +``` |
0 commit comments