@ -83,7 +83,11 @@ app.post('/contest/:id/edit', async (req, res) => {
ranklist = contest.ranklist;
}
ranklist.ranking_params = JSON.parse(req.body.ranking_params);
try {
} catch (e) {
ranklist.ranking_params = {};
await ranklist.save();
contest.ranklist_id = ranklist.id;
@ -48,7 +48,7 @@
</div>
<div class="field">
<label>排行参数</label>
<label>排行参数(格式:<code>{ "题目 ID": 分值倍数 }</code>)</label>
<input type="text" name="ranking_params" value="<%= contest.ranklist ? JSON.stringify(contest.ranklist.ranking_params) : '' %>">