Merge branch 'fixes' into dev

This commit is contained in:
Nastya 2024-01-06 23:24:32 +03:00
commit e5c8dc2976
7 changed files with 16 additions and 12 deletions

@ -50,6 +50,7 @@ export interface Quiz {
question_cnt: number; question_cnt: number;
/** count passings */ /** count passings */
passed_count: number; passed_count: number;
sessions_count: number;
/** average time of passing */ /** average time of passing */
average_time: number; average_time: number;
/** set true if squiz realize group functionality */ /** set true if squiz realize group functionality */
@ -108,6 +109,7 @@ export interface RawQuiz {
question_cnt: number; question_cnt: number;
/** count passings */ /** count passings */
passed_count: number; passed_count: number;
sessions_count: number;
/** average time of passing */ /** average time of passing */
average_time: number; average_time: number;
/** set true if squiz realize group functionality */ /** set true if squiz realize group functionality */

@ -116,6 +116,7 @@ export const Footer = ({
} }
const isEmpty = checkEmptyData({ resultData: nextQuestion }); const isEmpty = checkEmptyData({ resultData: nextQuestion });
console.log("isEmpty", isEmpty)
if (nextQuestion) { if (nextQuestion) {
if (nextQuestion && quiz?.config.resultInfo.when === "before") { if (nextQuestion && quiz?.config.resultInfo.when === "before") {
if (isEmpty) { if (isEmpty) {

@ -117,11 +117,11 @@ export const Variant = ({ currentQuestion }: VariantProps) => {
)} )}
</Box> </Box>
</Group> </Group>
{currentQuestion.content.back && ( {currentQuestion.content.back && currentQuestion.content.back !== " " && (
<Box sx={{ maxWidth: "400px", width: "100%", height: "300px" }}> <Box sx={{ maxWidth: "400px", width: "100%", height: "300px" }}>
<img <img
src={currentQuestion.content.back} src={currentQuestion.content.back}
style={{ width: "100%", height: "100%", objectFit: "cover" }} style={{ width: "100%", height: "100%", objectFit: "cover", margin: "10px" }}
alt="" alt=""
/> />
</Box> </Box>

@ -138,7 +138,7 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => {
style={{ width: "100%", height: "100%", objectFit: "cover" }} style={{ width: "100%", height: "100%", objectFit: "cover" }}
alt="" alt=""
/> />
) : variant?.extendedText || isMobile ? ( ) : (currentQuestion.content.replText !== " " && currentQuestion.content.replText.length > 0) ? currentQuestion.content.replText : variant?.extendedText || isMobile ? (
"Выберите вариант ответа ниже" "Выберите вариант ответа ниже"
) : ( ) : (
"Выберите вариант ответа слева" "Выберите вариант ответа слева"

@ -75,15 +75,15 @@ export default function MyQuizzesFull({
mb: "60px", mb: "60px",
}} }}
> >
{quizes.map((quiz) => ( {quizes.map((quiz) => {
<QuizCard return <QuizCard
key={quiz.id} key={quiz.id}
quiz={quiz} quiz={quiz}
openCount={0} openCount={quiz.sessions_count}
applicationCount={0} applicationCount={quiz.passed_count}
conversionPercent={0} conversionPercent={quiz.sessions_count ? (quiz.passed_count/quiz.sessions_count * 100).toFixed(1) : 0}
/> />
))} })}
</Box> </Box>
{children} {children}
</SectionWrapper> </SectionWrapper>

@ -98,8 +98,8 @@ export default function QuizCard({
> >
{quiz.name.length === 0 || quiz.name === " " {quiz.name.length === 0 || quiz.name === " "
? quiz.config.type === "form" ? quiz.config.type === "form"
? "Анкета " + questionCount.current ? "Form " + quiz.backendId
: "Квиз " + questionCount.current : "Quiz " + quiz.backendId
: quiz.name} : quiz.name}
</Typography> </Typography>
<Box <Box

@ -107,6 +107,7 @@ export default function EditPage({
const isConditionMet = const isConditionMet =
[1].includes(currentStep) && quizConfig.type !== "form"; [1].includes(currentStep) && quizConfig.type !== "form";
console.log(quiz)
return ( return (
<> <>
<Box <Box