|
|
@ -80,7 +80,7 @@ export function QuestionsList(props: QuestionsListProps) { |
|
|
|
setIsLoading(false); |
|
|
|
setIsLoading(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function resetProgress(type: QuestionProgressType | 'all' = 'all') { |
|
|
|
async function resetProgress(type: QuestionProgressType | 'reset' = 'reset') { |
|
|
|
let knownQuestions = userProgress?.know || []; |
|
|
|
let knownQuestions = userProgress?.know || []; |
|
|
|
let didNotKnowQuestions = userProgress?.dontKnow || []; |
|
|
|
let didNotKnowQuestions = userProgress?.dontKnow || []; |
|
|
|
let skipQuestions = userProgress?.skip || []; |
|
|
|
let skipQuestions = userProgress?.skip || []; |
|
|
@ -92,7 +92,7 @@ export function QuestionsList(props: QuestionsListProps) { |
|
|
|
didNotKnowQuestions = []; |
|
|
|
didNotKnowQuestions = []; |
|
|
|
} else if (type === 'skip') { |
|
|
|
} else if (type === 'skip') { |
|
|
|
skipQuestions = []; |
|
|
|
skipQuestions = []; |
|
|
|
} else if (type === 'all') { |
|
|
|
} else if (type === 'reset') { |
|
|
|
knownQuestions = []; |
|
|
|
knownQuestions = []; |
|
|
|
didNotKnowQuestions = []; |
|
|
|
didNotKnowQuestions = []; |
|
|
|
skipQuestions = []; |
|
|
|
skipQuestions = []; |
|
|
@ -105,7 +105,7 @@ export function QuestionsList(props: QuestionsListProps) { |
|
|
|
import.meta.env.PUBLIC_API_URL |
|
|
|
import.meta.env.PUBLIC_API_URL |
|
|
|
}/v1-reset-question-progress/${groupId}`,
|
|
|
|
}/v1-reset-question-progress/${groupId}`,
|
|
|
|
{ |
|
|
|
{ |
|
|
|
type, |
|
|
|
status: type, |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -207,7 +207,7 @@ export function QuestionsList(props: QuestionsListProps) { |
|
|
|
isLoading={isLoading} |
|
|
|
isLoading={isLoading} |
|
|
|
showLoginAlert={!isLoggedIn() && hasProgress} |
|
|
|
showLoginAlert={!isLoggedIn() && hasProgress} |
|
|
|
onResetClick={() => { |
|
|
|
onResetClick={() => { |
|
|
|
resetProgress('all').finally(() => null); |
|
|
|
resetProgress('reset').finally(() => null); |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
@ -231,7 +231,7 @@ export function QuestionsList(props: QuestionsListProps) { |
|
|
|
knowCount={knowCount} |
|
|
|
knowCount={knowCount} |
|
|
|
didNotKnowCount={dontKnowCount} |
|
|
|
didNotKnowCount={dontKnowCount} |
|
|
|
skippedCount={skipCount} |
|
|
|
skippedCount={skipCount} |
|
|
|
onReset={(type: QuestionProgressType | 'all') => { |
|
|
|
onReset={(type: QuestionProgressType | 'reset') => { |
|
|
|
resetProgress(type).finally(() => null); |
|
|
|
resetProgress(type).finally(() => null); |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
@ -241,8 +241,8 @@ export function QuestionsList(props: QuestionsListProps) { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
className={`flex flex-col gap-3 sm:flex-row ${ |
|
|
|
className={`flex flex-col gap-3 transition-opacity duration-300 sm:flex-row ${ |
|
|
|
hasFinished ? 'invisible' : 'visible' |
|
|
|
hasFinished ? 'opacity-0' : 'opacity-100' |
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
> |
|
|
|
> |
|
|
|
<button |
|
|
|
<button |
|
|
|