|
|
@ -51,7 +51,7 @@ const getLatinSquareOrder = function(participantNumber) { |
|
|
|
const latinSquareElement = latinSquare[latinSquareIndex]; |
|
|
|
const originalOrder = [1, 2, 3, 4, 5, 6]; |
|
|
|
var latinSquareRedirectOrder = []; |
|
|
|
latinSquareRedirectOrder.push(("study-page-" + latinSquareElement[0])); |
|
|
|
latinSquareRedirectOrder.push(("in-between-" + latinSquareElement[0])); |
|
|
|
|
|
|
|
for(var originalOrderElement of originalOrder) { |
|
|
|
const indexElement = findIndexOfOrderElement(originalOrderElement, latinSquareElement); |
|
|
@ -63,7 +63,7 @@ const getLatinSquareOrder = function(participantNumber) { |
|
|
|
const nextOrderElement = latinSquareElement[(indexElement + 1)]; |
|
|
|
const nextOrderElementIndex = findIndexOfOrderElement(nextOrderElement, latinSquareElement); |
|
|
|
const nextRedirctElement = latinSquareElement[nextOrderElementIndex]; |
|
|
|
latinSquareRedirectOrder.push(("study-page-" + nextRedirctElement )); |
|
|
|
latinSquareRedirectOrder.push(("in-between-" + nextRedirctElement )); |
|
|
|
} |
|
|
|
|
|
|
|
return latinSquareRedirectOrder; |
|
|
@ -95,16 +95,17 @@ function App() { |
|
|
|
<RouteTracker /> |
|
|
|
<Routes> |
|
|
|
<Route path="/" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc={latinSquareOrder[0]}/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-1" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-1"/></React.Suspense>} /> |
|
|
|
<Route path="/study-page-1" element={<React.Suspense fallback={<>...</>}><TestPage redirectLoc={latinSquareOrder[1]}/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-1" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-2"/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-2" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-2"/></React.Suspense>} /> |
|
|
|
<Route path="/study-page-2" element={<React.Suspense fallback={<>...</>}><TestPage redirectLoc={latinSquareOrder[2]}/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-2" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-3"/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-3" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-3"/></React.Suspense>} /> |
|
|
|
<Route path="/study-page-3" element={<React.Suspense fallback={<>...</>}><TestPage redirectLoc={latinSquareOrder[3]}/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-3" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-4"/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-4" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-4"/></React.Suspense>} /> |
|
|
|
<Route path="/study-page-4" element={<React.Suspense fallback={<>...</>}><TestPage redirectLoc={latinSquareOrder[4]}/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-4" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-5"/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-5" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-5"/></React.Suspense>} /> |
|
|
|
<Route path="/study-page-5" element={<React.Suspense fallback={<>...</>}><TestPage redirectLoc={latinSquareOrder[5]}/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-5" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-6"/></React.Suspense>} /> |
|
|
|
<Route path="/in-between-6" element={<React.Suspense fallback={<>...</>}><TestInfoPage redirectLoc="study-page-6"/></React.Suspense>} /> |
|
|
|
<Route path="/study-page-6" element={<React.Suspense fallback={<>...</>}><TestPage2 redirectLoc={latinSquareOrder[6]}/></React.Suspense>} /> |
|
|
|
<Route path="/end" element={<React.Suspense fallback={<>...</>}><TestEndPage /></React.Suspense>} /> |
|
|
|
<Route path="*" element={<React.Suspense fallback={<>...</>}><NoPageFound /></React.Suspense>} /> |
|
|
|