fix(web/problem/manage/data): modal

This commit is contained in:
Baoshuo Ren 2022-10-19 11:57:27 +08:00
parent 318e618499
commit e76c6524d4
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -836,41 +836,44 @@ EOD
<div class="modal fade" id="UploadDataModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="UploadDataModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="myModalLabel">上传数据</h4> <h4 class="modal-title" id="myModalLabel">上传数据</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form action="" method="post" enctype="multipart/form-data" role="form">
<div class="modal-body"> <div class="modal-body">
<form action="" method="post" enctype="multipart/form-data" role="form"> <label class="form-label" for="problem_data_file">上传 zip 文件</label>
<div class="form-group"> <input class="form-control" type="file" name="problem_data_file" id="problem_data_file" accept=".zip">
<label for="exampleInputFile">上传zip文件</label>
<input type="file" name="problem_data_file" id="problem_data_file"> <p class="form-text">
<p class="help-block">说明:请将所有数据放置于压缩包根目录内。若压缩包内仅存在文件夹而不存在文件,则会将这些一级子文件夹下的内容移动到根目录下,然后这些一级子文件夹删除;若这些子文件夹内存在同名文件,则会发生随机替换,仅保留一个副本。</p> 说明:请将所有数据放置于压缩包根目录内。若压缩包内仅存在文件夹而不存在文件,则会将这些一级子文件夹下的内容移动到根目录下,然后这些一级子文件夹删除;若这些子文件夹内存在同名文件,则会发生随机替换,仅保留一个副本。
</div> </p>
<input type="hidden" name="problem_data_file_submit" value="submit">
<!-- hidden input for server-side check -->
<input type="hidden" name="problem_data_file_submit" value="submit">
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-success">上传</button> <button type="submit" class="btn btn-success">上传</button>
</form>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div> </div>
</div> </form>
</div>
</div> </div>
</div> </div>
<div class="modal fade" id="ProblemSettingsFileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="ProblemSettingsFileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="myModalLabel">试题配置</h4> <h4 class="modal-title" id="myModalLabel">试题配置</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<form class="form-horizontal" action="" method="post" role="form">
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal" action="" method="post" role="form"> <div class="form-group row">
<div class="form-group row"> <label for="use_builtin_checker" class="col-sm-5 control-label">比对函数</label>
<label for="use_builtin_checker" class="col-sm-5 control-label">比对函数</label> <div class="col-sm-7">
<div class="col-sm-7">
<?php $checker_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'use_builtin_checker', 'ownchk') : ""; ?> <?php $checker_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'use_builtin_checker', 'ownchk') : ""; ?>
<select class="form-select" id="use_builtin_checker" name="use_builtin_checker"> <select class="form-select" id="use_builtin_checker" name="use_builtin_checker">
<option value="ncmp" <?= $checker_value == "ncmp" ? 'selected' : '' ?>>ncmp: 整数序列</option> <option value="ncmp" <?= $checker_value == "ncmp" ? 'selected' : '' ?>>ncmp: 整数序列</option>
@ -885,79 +888,79 @@ EOD
<option value="bcmp" <?= $checker_value == "bcmp" ? 'selected' : '' ?>>bcmp: 二进制文件</option> <option value="bcmp" <?= $checker_value == "bcmp" ? 'selected' : '' ?>>bcmp: 二进制文件</option>
<option value="ownchk" <?= $checker_value == "ownchk" ? 'selected' : '' ?>>自定义校验器(需上传 chk.cpp</option> <option value="ownchk" <?= $checker_value == "ownchk" ? 'selected' : '' ?>>自定义校验器(需上传 chk.cpp</option>
</select> </select>
</div>
</div> </div>
<div class="form-group row"> </div>
<label for="n_tests" class="col-sm-5 control-label">n_tests</label> <div class="form-group row">
<div class="col-sm-7"> <label for="n_tests" class="col-sm-5 control-label">n_tests</label>
<?php $n_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_tests', '') : ""; ?> <div class="col-sm-7">
<input type="number" class="form-control" id="n_tests" name="n_tests" placeholder="数据点个数(必填)" value="<?= $n_tests_value ?>"> <?php $n_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_tests', '') : ""; ?>
</div> <input type="number" class="form-control" id="n_tests" name="n_tests" placeholder="数据点个数(必填)" value="<?= $n_tests_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="n_ex_tests" class="col-sm-5 control-label">n_ex_tests</label> <div class="form-group row">
<div class="col-sm-7"> <label for="n_ex_tests" class="col-sm-5 control-label">n_ex_tests</label>
<?php $n_ex_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_ex_tests', 0) : ""; ?> <div class="col-sm-7">
<input type="number" class="form-control" id="n_ex_tests" name="n_ex_tests" placeholder="额外数据点个数(默认为 0" value="<?= $n_ex_tests_value ?>"> <?php $n_ex_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_ex_tests', 0) : ""; ?>
</div> <input type="number" class="form-control" id="n_ex_tests" name="n_ex_tests" placeholder="额外数据点个数(默认为 0" value="<?= $n_ex_tests_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="n_sample_tests" class="col-sm-5 control-label">n_sample_tests</label> <div class="form-group row">
<div class="col-sm-7"> <label for="n_sample_tests" class="col-sm-5 control-label">n_sample_tests</label>
<?php $n_sample_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_sample_tests', 0) : ""; ?> <div class="col-sm-7">
<input type="number" class="form-control" id="n_sample_tests" name="n_sample_tests" placeholder="样例测试点个数(默认为 0" value="<?= $n_sample_tests_value ?>"> <?php $n_sample_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_sample_tests', 0) : ""; ?>
</div> <input type="number" class="form-control" id="n_sample_tests" name="n_sample_tests" placeholder="样例测试点个数(默认为 0" value="<?= $n_sample_tests_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="input_pre" class="col-sm-5 control-label">input_pre</label> <div class="form-group row">
<div class="col-sm-7"> <label for="input_pre" class="col-sm-5 control-label">input_pre</label>
<?php $input_pre_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'input_pre', 'input') : ""; ?> <div class="col-sm-7">
<input type="text" class="form-control" id="input_pre" name="input_pre" placeholder="输入文件名称(默认为 input" value="<?= $input_pre_value ?>"> <?php $input_pre_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'input_pre', 'input') : ""; ?>
</div> <input type="text" class="form-control" id="input_pre" name="input_pre" placeholder="输入文件名称(默认为 input" value="<?= $input_pre_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="input_suf" class="col-sm-5 control-label">input_suf</label> <div class="form-group row">
<div class="col-sm-7"> <label for="input_suf" class="col-sm-5 control-label">input_suf</label>
<?php $input_suf_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'input_suf', 'txt') : ""; ?> <div class="col-sm-7">
<input type="text" class="form-control" id="input_suf" name="input_suf" placeholder="输入文件后缀(默认为 txt" value="<?= $input_suf_value ?>"> <?php $input_suf_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'input_suf', 'txt') : ""; ?>
</div> <input type="text" class="form-control" id="input_suf" name="input_suf" placeholder="输入文件后缀(默认为 txt" value="<?= $input_suf_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="output_pre" class="col-sm-5 control-label">output_pre</label> <div class="form-group row">
<div class="col-sm-7"> <label for="output_pre" class="col-sm-5 control-label">output_pre</label>
<?php $output_pre_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'output_pre', 'output') : ""; ?> <div class="col-sm-7">
<input type="text" class="form-control" id="output_pre" name="output_pre" placeholder="输出文件名称(默认为 output" value="<?= $output_pre_value ?>"> <?php $output_pre_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'output_pre', 'output') : ""; ?>
</div> <input type="text" class="form-control" id="output_pre" name="output_pre" placeholder="输出文件名称(默认为 output" value="<?= $output_pre_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="output_suf" class="col-sm-5 control-label">output_suf</label> <div class="form-group row">
<div class="col-sm-7"> <label for="output_suf" class="col-sm-5 control-label">output_suf</label>
<?php $output_suf_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'output_suf', 'txt') : ""; ?> <div class="col-sm-7">
<input type="text" class="form-control" id="output_suf" name="output_suf" placeholder="输出文件后缀(默认为 txt" value="<?= $output_suf_value ?>"> <?php $output_suf_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'output_suf', 'txt') : ""; ?>
</div> <input type="text" class="form-control" id="output_suf" name="output_suf" placeholder="输出文件后缀(默认为 txt" value="<?= $output_suf_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="time_limit" class="col-sm-5 control-label">time_limit</label> <div class="form-group row">
<div class="col-sm-7"> <label for="time_limit" class="col-sm-5 control-label">time_limit</label>
<?php $time_limit_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'time_limit', 1) : ""; ?> <div class="col-sm-7">
<input type="number" class="form-control" id="time_limit" name="time_limit" placeholder="时间限制(不能填写小数,默认为 1s" value="<?= $time_limit_value ?>"> <?php $time_limit_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'time_limit', 1) : ""; ?>
</div> <input type="number" class="form-control" id="time_limit" name="time_limit" placeholder="时间限制(不能填写小数,默认为 1s" value="<?= $time_limit_value ?>">
</div> </div>
<div class="form-group row"> </div>
<label for="memory_limit" class="col-sm-5 control-label">memory_limit</label> <div class="form-group row">
<div class="col-sm-7"> <label for="memory_limit" class="col-sm-5 control-label">memory_limit</label>
<?php $memory_limit_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'memory_limit', 256) : ""; ?> <div class="col-sm-7">
<input type="number" class="form-control" id="memory_limit" name="memory_limit" placeholder="内存限制(默认为 256 MB" value="<?= $memory_limit_value ?>"> <?php $memory_limit_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'memory_limit', 256) : ""; ?>
</div> <input type="number" class="form-control" id="memory_limit" name="memory_limit" placeholder="内存限制(默认为 256 MB" value="<?= $memory_limit_value ?>">
</div> </div>
<input type="hidden" name="problem_settings_file_submit" value="submit"> </div>
<input type="hidden" name="problem_settings_file_submit" value="submit">
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-success">确定</button> <button type="submit" class="btn btn-success">确定</button>
</form>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
</div> </div>
</div> </form>
</div>
</div> </div>
</div> </div>