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