Merge branch 'dev'
This commit is contained in:
commit
dae45927c1
@ -3,7 +3,12 @@ import { deleteTimeoutedQuestions } from "@utils/deleteTimeoutedQuestions";
|
||||
import { lazy, Suspense, useCallback } from "react";
|
||||
import { DraggableList } from "../DraggableList";
|
||||
import { SwitchBranchingPanel } from "./SwitchBranchingPanel";
|
||||
|
||||
import { useQuestions } from "@/stores/questions/hooks";
|
||||
import { uploadQuestionImage } from "@/stores/questions/actions";
|
||||
import { useCurrentQuiz } from "@/stores/quizes/hooks";
|
||||
import { updateQuestion } from "@root/questions/actions";
|
||||
let params = (new URL(document.location)).searchParams;
|
||||
console.log(params.get("data"));
|
||||
const BranchingMap = lazy(() =>
|
||||
import("./BranchingMap").then((module) => ({ default: module.BranchingMap })),
|
||||
);
|
||||
@ -28,6 +33,8 @@ export const QuestionSwitchWindowTool = ({
|
||||
}
|
||||
setOpenBranchingPage(!openBranchingPage);
|
||||
}, [openBranchingPage, setOpenBranchingPage]);
|
||||
const { isLoading, questions } = useQuestions();
|
||||
const quiz = useCurrentQuiz();
|
||||
|
||||
return (
|
||||
<Box
|
||||
@ -37,6 +44,43 @@ export const QuestionSwitchWindowTool = ({
|
||||
marginBottom: isMobile ? "25px" : "30px",
|
||||
}}
|
||||
>
|
||||
{params.get("data") === "a" &&
|
||||
<button
|
||||
onClick={() => {
|
||||
questions.forEach((e) => {
|
||||
updateQuestion(e.id, (question) => {
|
||||
question.content.editedUrlImagesList=undefined;
|
||||
});
|
||||
})
|
||||
|
||||
}}
|
||||
/>
|
||||
// <input type="file" multiple
|
||||
// onChange={(e) => {
|
||||
// console.log(e)
|
||||
// Array.from(e.target.files).forEach((element, i) => {
|
||||
// setTimeout(() => {
|
||||
// console.log(i)
|
||||
// console.log(Number(element.name.replace(/[^0-9,\s]/g, "")))
|
||||
// const q = questions.find((q) => q.page + 1 === Number(element.name.replace(/[^0-9,\s]/g, "")))
|
||||
// if (q !== undefined) {
|
||||
// console.log(q)
|
||||
// console.log("-----------------")
|
||||
// uploadQuestionImage(
|
||||
// q.id,
|
||||
// quiz.qid,
|
||||
// e.target.files[i],
|
||||
// (question, url) => {
|
||||
// question.content.back = url;
|
||||
// question.content.originalBack = url;
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
// }, 1000);
|
||||
// });
|
||||
// }}
|
||||
// />
|
||||
}
|
||||
<Box sx={{ width: isTablet ? "100%" : "796px" }}>
|
||||
{openBranchingPage ? (
|
||||
<Suspense
|
||||
|
||||
@ -31,6 +31,9 @@ export const DraggableList = ({
|
||||
createUntypedQuestion(Number(quiz.backendId));
|
||||
}
|
||||
}, [quiz, filteredQuestions]);
|
||||
console.log(quiz)
|
||||
console.log(questions)
|
||||
// if () {}uploadQuestionImage
|
||||
|
||||
return (
|
||||
<DragDropContext onDragEnd={onDragEnd}>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user