exam add backgrond color

This commit is contained in:
xiaomlove
2024-08-23 04:52:53 +08:00
parent 9b83793c93
commit b8c044d546
8 changed files with 47 additions and 7 deletions

View File

@@ -7,12 +7,12 @@ use App\Repositories\ExamRepository;
class Exam
{
public function render($uid)
public function getCurrent($uid): array
{
$examRep = new ExamRepository();
$userExam = $examRep->getUserExamProgress($uid, ExamUser::STATUS_NORMAL);
if (empty($userExam)) {
return '';
return ['exam' => null, 'html' => ''];
}
/** @var \App\Models\Exam $exam */
$exam = $userExam->exam;
@@ -34,6 +34,7 @@ class Exam
if ($exam->description) {
$row[] = "\n" . $exam->description;
}
return nl2br(implode("\n", $row));
$html = nl2br(implode("\n", $row));
return compact('exam', 'html');
}
}