'Q001', 'content' => '已知二次函数 $f(x) = ax^2 + bx + c$,求 $f(2)$ 的值。', 'difficulty' => 0.3, ], [ 'code' => 'Q002', 'content' => '计算定积分:$$\int_0^1 x^2 dx$$', 'difficulty' => 0.6, ], [ 'code' => 'Q003', 'content' => '证明三角恒等式:$\sin^2(x) + \cos^2(x) = 1$', 'difficulty' => 0.85, ], [ 'code' => 'Q004', 'content' => '求极限:$$\lim_{x \to 0} \frac{\sin(x)}{x}$$', 'difficulty' => 0.7, ], [ 'code' => 'Q005', 'content' => '解方程:$ax^2 + bx + c = 0$', 'difficulty' => 0.4, ], ]; #[Computed] public function questions(): array { $filtered = array_filter($this->sampleQuestions, function($question) { if (empty($this->search)) { return true; } return str_contains(strtolower($question['content']), strtolower($this->search)); }); return array_values($filtered); } public function render() { return view('livewire.math-render-test'); } }