merge
This commit is contained in:
parent
c6af29a6ab
commit
f84c0be738
@ -1 +1,3 @@
|
||||
1.0.2 Страничка результатов способна показать историю и правильность ответов для балловго квиза
|
||||
1.0.1 Отображение для баллового квиза на страничке результатов списка
|
||||
1.0.0 Добавлены фичи "мультиответ", "перенос строки в своём ответе", "свой ответ", "плейсхолдер своего ответа"
|
||||
|
@ -16,9 +16,6 @@ export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => {
|
||||
const { questions, settings } = useQuizSettings();
|
||||
const questionsAmount = questions.filter(({ type }) => type !== "result").length;
|
||||
|
||||
console.log("questions");
|
||||
console.log(questions);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
|
@ -7,38 +7,27 @@ import { AnyTypedQuizQuestion, QuizQuestionVariant } from "@/index";
|
||||
|
||||
export const PointSystemResultList = () => {
|
||||
const theme = useTheme();
|
||||
console.log("PointSystemResultList");
|
||||
console.log(theme.palette);
|
||||
|
||||
const { questions } = useQuizSettings();
|
||||
const answers = useQuizViewStore((state) => state.answers);
|
||||
|
||||
const questionsWothoutResult = questions.filter<QuizQuestionVariant>(
|
||||
(q: AnyTypedQuizQuestion): q is QuizQuestionVariant => q.type === "variant"
|
||||
);
|
||||
console.log("questions");
|
||||
console.log(questionsWothoutResult);
|
||||
console.log("answers");
|
||||
console.log(answers);
|
||||
|
||||
return questionsWothoutResult.map((currentQuestion) => {
|
||||
let answerIndex = 0;
|
||||
let currentVariants = currentQuestion.content.variants;
|
||||
|
||||
const currentAnswer = answers.find((a) => a.questionId === currentQuestion.id);
|
||||
console.log("цикл");
|
||||
|
||||
const answeredVariant = currentVariants.find((v, i) => {
|
||||
console.log(v.id);
|
||||
console.log(currentAnswer?.answer);
|
||||
console.log("-------------------------------------------");
|
||||
if (v.id === currentAnswer?.answer) {
|
||||
answerIndex = i;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
console.log("answeredVariant");
|
||||
console.log(answeredVariant);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
|
@ -187,32 +187,34 @@ export const ResultForm = ({ resultQuestion }: ResultFormProps) => {
|
||||
{resultQuestion.content.text}
|
||||
</Typography>
|
||||
)}
|
||||
<TextAccordion
|
||||
headerText={
|
||||
<Typography
|
||||
sx={{
|
||||
color: theme.palette.primary.main,
|
||||
"&:hover": {
|
||||
color: theme.palette.primary.dark,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Посмотреть ответы
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
mt: "60px",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
{settings.cfg?.score && (
|
||||
<TextAccordion
|
||||
headerText={
|
||||
<Typography
|
||||
sx={{
|
||||
color: theme.palette.primary.main,
|
||||
"&:hover": {
|
||||
color: theme.palette.primary.dark,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Посмотреть ответы
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
mt: "25px",
|
||||
mt: "60px",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<PointSystemResultList />
|
||||
</Box>
|
||||
</TextAccordion>
|
||||
<Box
|
||||
sx={{
|
||||
mt: "25px",
|
||||
}}
|
||||
>
|
||||
<PointSystemResultList />
|
||||
</Box>
|
||||
</TextAccordion>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
{show_badge && (
|
||||
|
@ -88,9 +88,6 @@ export function sendQuestionAnswer(
|
||||
let answerString = ``;
|
||||
selectedVariants.forEach((e) => {
|
||||
if (!e.isOwn || (e.isOwn && question.content.own)) {
|
||||
console.log(e.answer);
|
||||
console.log(e.answer);
|
||||
console.log(ownAnswer);
|
||||
const body = {
|
||||
Image: e.extendedText,
|
||||
Description: e.isOwn ? ownAnswer : e.answer,
|
||||
|
Loading…
Reference in New Issue
Block a user