Skip to content

Commit f65e1e4

Browse files
authored
Update yuanqi.php
1 parent cd5e870 commit f65e1e4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

trunk/web/aiapi/yuanqi.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99

1010
$sid=intval($_GET['sid']);
11-
$user_id=pdo_query("select user_id from solution where solution_id=?",$sid)[0][0];
11+
$solution=pdo_query("select user_id,problem_id from solution where solution_id=?",$sid)[0];
12+
$user_id=$solution[0];
13+
$problem_id=$solution[1];
14+
$problem=pdo_query("select concat(description,'输入:',input,'输出:',output,'样例输入:',sample_input,'样例输出:',sample_output,'提示:',hint) from problem where problem_id=?",$problem_id)[0][0];
15+
1216
if(!(isset($_SESSION[$OJ_NAME."_source_browser"])|| $user_id==$_SESSION[$OJ_NAME."_user_id"] )){
1317
echo "非法参数";
1418
//exit();
@@ -69,7 +73,7 @@
6973
"content" => [
7074
[
7175
"type" => "text",
72-
"text" => "你是一个编程高手,能帮我用简单清晰的中文,解释我看不懂的报错信息。如果对比中用户的输出为空,可能是没有考虑到多组输入的情况,应该使用循环处理。".$code_suggestion."\n源代码是:".$source."\n报错信息是:".$ceinfo
76+
"text" => "你是一个编程高手,能帮我用简单清晰的中文,解释我看不懂的报错信息。如果对比中用户的输出为空,可能是没有考虑到多组输入的情况,应该使用循环处理。".$code_suggestion."\n题目是: $problem \n源代码是:".$source."\n报错信息是:".$ceinfo
7377
]
7478
]
7579
]

0 commit comments

Comments
 (0)