File tree 2 files changed +25
-2
lines changed
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> = ({
37
37
} ;
38
38
39
39
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
+
40
55
const { question, options } = questionSet ;
41
56
42
57
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> = ({
123
123
124
124
if ( isLoading ) return < LoadingIndicator /> ;
125
125
126
- //Error Handling for loading issues
127
126
if ( ! questionSet ) {
128
127
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
+ ) ;
130
138
}
131
139
132
140
const { question, options, images } = questionSet ! ;
You can’t perform that action at this time.
0 commit comments