feat:鲁迅添加引导
This commit is contained in:
1 parent
e8dc5d4b95
commit
3129e01257
26 files changed
+951
-86
No files matched your search
@@ -22,7 +22,7 @@ const DragQuizPanel = ({
|
||||
className="fixed inset-0 flex items-center justify-center bg-black/40"
|
||||
style={{ zIndex }}
|
||||
>
|
||||
<div className="relative w-[1728px] h-[972px] flex flex-col items-center pt-12 pb-14 gap-10">
|
||||
<div className="relative w-[1728px] h-[972px] flex flex-col items-center pt-12 pb-14">
|
||||
{/* 题干卡片 */}
|
||||
<div className="w-[1600px] rounded-[32px] bg-black/90 px-20 py-12 shadow-[0_20px_60px_rgba(240,190,117,0.8)] border-4 border-[#d4c5a9]">
|
||||
<div className="text-[32px] leading-relaxed text-white">
|
||||
|
||||
@@ -36,6 +36,7 @@ const SingleChoiceQuizPanel = ({
|
||||
correctAnswer,
|
||||
errorMessage,
|
||||
onSubmit,
|
||||
onWrongSelect,
|
||||
onError,
|
||||
disabled = false,
|
||||
}: SingleChoiceQuizPanelProps) => {
|
||||
@@ -65,7 +66,9 @@ const SingleChoiceQuizPanel = ({
|
||||
} else {
|
||||
// 答题失败:清空状态,执行 onError,允许重新选择
|
||||
setSelectedValue("");
|
||||
const errorMsg = errorMessage || "很抱歉,你选错了!请你再思考一下吧!";
|
||||
const customError = onWrongSelect?.(value);
|
||||
const errorMsg =
|
||||
customError || errorMessage || "很抱歉,你选错了!请你再思考一下吧!";
|
||||
setError(errorMsg);
|
||||
onError?.(errorMsg);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ export interface SingleChoiceQuizPanelProps {
|
||||
errorMessage?: string;
|
||||
/** 提交回调,返回用户选择和是否正确 */
|
||||
onSubmit?: (value: string, isCorrect: boolean) => void;
|
||||
/** 答错时回调,可返回自定义解析文案覆盖默认 errorMessage */
|
||||
onWrongSelect?: (value: string) => string | void;
|
||||
/** 错误回调(可选) */
|
||||
onError?: (error: string) => void;
|
||||
/** 是否禁用 */
|
||||
|
||||
Reference in new issue
Block a user