Skip to content

Commit

Permalink
study_details
Browse files Browse the repository at this point in the history
  • Loading branch information
daizeyao committed Mar 21, 2024
1 parent 43a76ef commit 4f71b5f
Show file tree
Hide file tree
Showing 4 changed files with 1,027 additions and 247 deletions.
10 changes: 7 additions & 3 deletions web/OJ/template/hznu/getstudyproblems.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$user = $_POST['user'];
$tag = $_POST['tag'];

$sql = "SELECT p.problem_id, s.result
$sql = "SELECT p.problem_id, s.result, p.score
FROM problem_tag pt
JOIN problem p ON pt.problem_id = p.problem_id
LEFT JOIN solution s ON p.problem_id = s.problem_id AND s.user_id = ?
Expand All @@ -25,10 +25,14 @@
);

while ($row = $result->fetch_assoc()) {
$problem = array(
'id' => $row['problem_id'],
'score' => $row['score']
);
if ($row['result'] == 4) {
$data['solved'][] = $row['problem_id'];
$data['solved'][] = $problem;
} else {
$data['unsolved'][] = $row['problem_id'];
$data['unsolved'][] = $problem;
}
}

Expand Down
Loading

0 comments on commit 4f71b5f

Please sign in to comment.