diff --git a/web/app/controllers/user_info.php b/web/app/controllers/user_info.php index 55487fb..9fd4162 100644 --- a/web/app/controllers/user_info.php +++ b/web/app/controllers/user_info.php @@ -85,6 +85,7 @@ + 查看 的所有赛后总结
diff --git a/web/app/controllers/user_self_reviews.php b/web/app/controllers/user_self_reviews.php new file mode 100644 index 0000000..b08cd18 --- /dev/null +++ b/web/app/controllers/user_self_reviews.php @@ -0,0 +1,92 @@ + + + + +

+ 的所有赛后总结 +

+ + 10, + 'table_classes' => array('table', 'table-bordered', 'table-text-center', 'table-vertical-middle'), + ); + + $header_row = ''; + $header_row .= ''; + $header_row .= ''.UOJLocale::get('contests::contest name').''; + $header_row .= ''.UOJLocale::get('problems::problem').''; + $header_row .= ''.UOJLocale::get('contests::problem self review').''; + $header_row .= ''.UOJLocale::get('contests::contest self review').''; + $header_row .= ''; + + $print_row = function($row) { + global $username; + + $contest_id = $row['contest_id']; + $contest = queryContest($contest_id); + $contest_problems = queryContestProblems($contest_id); + $n_contest_problems = count($contest_problems); + + $result = ''; + $dom_sanitize_config = DOM_SANITIZE_CONFIG; + + for ($i = 0; $i < $n_contest_problems; $i++) { + $problem_id = $contest_problems[$i]['problem_id']; + $problem = queryProblemBrief($problem_id); + $problem_self_review = DB::selectFirst("select content from contests_reviews where contest_id = $contest_id and problem_id = $problem_id and poster = '$username'"); + + $result .= ''; + + if ($i == 0) { + $result .= '' . $contest['name'] . ''; + } + + $problem_review_id = "review-$contest_id-$i"; + $result .= '' . chr(ord('A') + $i) . '. ' . $problem['title'] . ''; + $result .= '
'; + $esc_problem_self_review = rawurlencode($problem_self_review != null ? $problem_self_review['content'] : ''); + $result .= ''; + + if ($i == 0) { + $contest_review_id = "review-$contest_id-overall"; + $contest_self_review = DB::selectFirst("select content from contests_reviews where contest_id = $contest_id and problem_id = -1 and poster = '$username'"); + $esc_contest_self_review = rawurlencode($contest_self_review != null ? $contest_self_review['content'] : ''); + $result .= '
'; + $result .= ''; + } + + $result .= ''; + } + + echo $result; + }; + + echoLongTable($col_names, $from, $cond, $tail, $header_row, $print_row, $config); +?> + + diff --git a/web/app/libs/uoj-html-lib.php b/web/app/libs/uoj-html-lib.php index 623c8f8..3011708 100644 --- a/web/app/libs/uoj-html-lib.php +++ b/web/app/libs/uoj-html-lib.php @@ -1,6 +1,6 @@ 'Final testing', 'contest ended' => 'Contest Ended', 'contest registrants' => 'Registrants', + 'problem self review' => 'Problem self review', + 'contest self review' => 'Contest self review', 'contest self reviews' => 'Contest self reviews' ]; diff --git a/web/app/locale/contests/zh-cn.php b/web/app/locale/contests/zh-cn.php index 4cde224..b0cc8dc 100644 --- a/web/app/locale/contests/zh-cn.php +++ b/web/app/locale/contests/zh-cn.php @@ -27,5 +27,7 @@ return [ 'contest final testing' => '正在测评', 'contest ended' => '比赛已结束', 'contest registrants' => '报名选手列表', + 'problem self review' => '题目总结', + 'contest self review' => '比赛总结', 'contest self reviews' => '赛后总结' ]; diff --git a/web/app/route.php b/web/app/route.php index f2efc20..ea0756d 100644 --- a/web/app/route.php +++ b/web/app/route.php @@ -67,6 +67,7 @@ Route::group([ Route::any('/forgot-password', '/forgot_pw.php'); Route::any('/reset-password', '/reset_pw.php'); Route::any('/user/profile/{username}', '/user_info.php'); + Route::any('/user/self_reviews/{username}', '/user_self_reviews.php'); Route::any('/user/modify-profile', '/change_user_info.php'); Route::any('/user/msg', '/user_msg.php'); Route::any('/user/system-msg', '/user_system_msg.php');