File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,21 @@ const ExamQuizForm: FC<Props> = ({
3737 } ;
3838
3939 if ( isLoading ) return < LoadingIndicator /> ;
40+
41+ if ( ! questionSet ) {
42+ handleNextQuestion ( 1 ) ;
43+ return (
44+ < div className = "flex flex-col items-center justify-center h-full" >
45+ < p className = "text-red-500 text-lg font-semibold" >
46+ Oops! Something went wrong while loading the questions.
47+ </ p >
48+ < p className = "text-white text-md mt-2" >
49+ Please try refreshing the page or check your internet connection.
50+ </ p >
51+ </ div >
52+ ) ;
53+ }
54+
4055 const { question, options } = questionSet ;
4156
4257 const noOfAnswers = options . filter ( ( el ) => el . isAnswer ) . length ;
Original file line number Diff line number Diff line change @@ -123,10 +123,18 @@ const QuizForm: FC<Props> = ({
123123
124124 if ( isLoading ) return < LoadingIndicator /> ;
125125
126- //Error Handling for loading issues
127126 if ( ! questionSet ) {
128127 handleNextQuestion ( 1 ) ;
129- return < p > Loading questions failed.</ p > ;
128+ return (
129+ < div className = "flex flex-col items-center justify-center h-full" >
130+ < p className = "text-red-500 text-lg font-semibold" >
131+ Oops! Something went wrong while loading the questions.
132+ </ p >
133+ < p className = "text-white text-md mt-2" >
134+ Please try refreshing the page or check your internet connection.
135+ </ p >
136+ </ div >
137+ ) ;
130138 }
131139
132140 const { question, options, images } = questionSet ! ;
You can’t perform that action at this time.
0 commit comments