import { store } from "@/store/store";
export function useCheckMultipleAnswer() {
  const currentQuestion = store.exam.currentQuestion;
  const canToggle =
    store.exam.SHOW_MULTIPLE_CHOICE_WARNING == "true"
      ? !(
          currentQuestion &&
          currentQuestion.questionType == "MULTIPLE_CHOICE" &&
          typeof currentQuestion.studentAnswer === "string" &&
          currentQuestion.studentAnswer?.length == 1
        )
      : true;
  const rejectHandler = (callback: any) => {
    $dialog.warning({
      title: "提示",
      content: "当前多选题所选答案不足2个，是否跳过？",
      positiveText: "跳过此题",
      negativeText: "继续作答",
      onPositiveClick: callback,
    });
  };
  return {
    canToggle,
    rejectHandler,
  };
}
