diff --git a/app/components/question_component.tsx b/app/components/question_component.tsx
index 82454fb..bdc457a 100644
--- a/app/components/question_component.tsx
+++ b/app/components/question_component.tsx
@@ -33,9 +33,20 @@ const QuestionView = ({ question, setState, state }: { question: Question, setSt
return (
-
- {question && question.text}
-
+ {/* {question && question.text} */}
+
+
+ {question.text}
+
+
{
+ let i = array.length - 1;
+
+ while ( i >= 0 ) {
+ const random_i = Math.floor( Math.random() * i );
+
+ [array[ i ], array[ random_i ]] = [array[ random_i ], array[ i ]];
+ i--;
+ }
+}
const Page = ({ params }: { params: { category: string }}) => {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
@@ -35,6 +45,7 @@ const Page = ({ params }: { params: { category: string }}) => {
result = result.filter( q => q.category === params.category)
.map(it=>({...it, answered: AnswerType.Unset}));
//result = result.filter
+ shuffle( result );
setQuestions( result );
console.log( `q12 uestions: ${ JSON.stringify( questions ) }`, result );
}
@@ -44,6 +55,7 @@ const Page = ({ params }: { params: { category: string }}) => {
questions?.forEach(q => {
ans[ q.id ] = AnswerType.Unset;
});
+
/*
setState( (prevState: SessionState) => ({
@@ -83,7 +95,13 @@ const Page = ({ params }: { params: { category: string }}) => {
- {questions[ index ] ? (
) : }
+ {(()=>{
+ if ( !questions[ 0 ] )
+ return <>>;
+ return (index < 10 && questions[ index ]) ? : ;
+ })()}
+
+ {/* {questions[ 0 ] ? ((index < 10 && questions[ index ]) ? : ) : null} */}