@@ -100,8 +100,8 @@ const Quiz = () => {
100100 return < Layout >
101101 < Box sx = { { width : '100%' , maxWidth : 920 , mx : 'auto' , p : { xs : 2 , md : 4 } , borderRadius : 2 , backgroundColor : "background.paper" } } component = "form" method = "POST" action = "" >
102102 { ! errorMessage ? < Box >
103- { showQuestions ? < > < Box mb = { 3 } >
104- < Typography variant = "h4" mb = { 1 } > { quiz . title } </ Typography >
103+ { showQuestions ? < > < Box sx = { { mb : 3 } } >
104+ < Typography variant = "h4" sx = { { mb : 1 } } > { quiz . title } </ Typography >
105105 </ Box >
106106 < Box >
107107 < Typography sx = { { mb : 3 , color : 'text.secondary' } } >
@@ -111,7 +111,7 @@ const Quiz = () => {
111111
112112 { quiz . questions . map ( ( question , index ) => (
113113 < Box key = { index } sx = { { mb : 2 , py : 2 , borderBottom : '1px solid' , borderColor : 'divider' } } >
114- < Box mb = { 1 } > < Typography sx = { { fontWeight : 'bold' , lineHeight : 1.5 } } > { question . text } </ Typography > </ Box >
114+ < Box sx = { { mb : 1 } } > < Typography sx = { { fontWeight : 'bold' , lineHeight : 1.5 } } > { question . text } </ Typography > </ Box >
115115 { question . answers . map ( ( answer , cIndex ) => (
116116 < FormControlLabel control = { < Checkbox onChange = { ( e ) => { if ( ! e . target . checked ) {
117117 const newSelectedAnswers = [ ...selectedAnswers ] ;
@@ -127,13 +127,13 @@ const Quiz = () => {
127127 ) ) }
128128 </ Box >
129129 ) ) }
130- < Box mt = { 3.5 } textAlign = " center" >
130+ < Box sx = { { mt : 3.5 , textAlign : ' center' } } >
131131 < Button variant = "contained" onClick = { showSubmitDialog } sx = { { px : 3 , fontSize : '1.1rem' } } > { localeMessages [ 'submit' ] } </ Button >
132132 </ Box >
133- </ Box > </ > : < Box textAlign = " center" >
133+ </ Box > </ > : < Box sx = { { textAlign : ' center' } } >
134134 { isPassed !== null && ( isPassed ? < > { ! quizData && < CelebrationIcon sx = { { mb : 2 , color : 'primary.main' , fontSize : '3rem' } } /> } < Alert severity = { score == 100 ? "success" : "info" } sx = { { justifyContent : 'center' , alignItems : 'center' } } > < Typography variant = 'h6' > { message } { localeMessages [ 'your_score' ] } : { score } %</ Typography > </ Alert > </ > :
135135 < > < Alert severity = "error" sx = { { justifyContent : 'center' , alignItems : 'center' } } > < Typography variant = "h6" > { message } { localeMessages [ 'your_score' ] } : { score } %</ Typography > </ Alert >
136- { ! isInvalidated && < Box mt = { 3 } textAlign = " center" > < Button onClick = { ( ) => window . location . reload ( ) } variant = "contained" > { localeMessages [ 'try_again' ] } </ Button > </ Box > }
136+ { ! isInvalidated && < Box sx = { { mt : 3 , textAlign : ' center' } } > < Button onClick = { ( ) => window . location . reload ( ) } variant = "contained" > { localeMessages [ 'try_again' ] } </ Button > </ Box > }
137137 </ > ) }
138138 { quizData && (
139139 < Box sx = { { mt : 3 , textAlign : direction === 'rtl' ? 'right' : 'left' , border : '1px solid' , borderColor : 'divider' , borderRadius : 2 , p : { xs : 2 , md : 3 } , backgroundColor : 'background.default' } } >
@@ -182,11 +182,11 @@ const Quiz = () => {
182182 </ Box > }
183183 </ Box > : < Alert severity = "error" > < Typography variant = "h6" > { localeMessages [ 'error' ] } : { errorMessage } { ref && `(Ref: ${ ref } )` } </ Typography > </ Alert > }
184184 < Dialog open = { dialogOpen } onClose = { ( ) => setDialogOpen ( false ) } fullWidth maxWidth = "sm" >
185- < Box p = { 4 } >
186- < Typography variant = "h6" mb = { 2 } > { localeMessages [ 'ready_to_submit' ] } </ Typography >
185+ < Box sx = { { p : 4 } } >
186+ < Typography variant = "h6" sx = { { mb : 2 } } > { localeMessages [ 'ready_to_submit' ] } </ Typography >
187187 { warning ? < Alert severity = "warning" sx = { { mb : 2 } } > < Typography > { warning } </ Typography > </ Alert > :
188188 < Typography > { localeMessages [ 'submit_quiz_note' ] } </ Typography > }
189- < Box mt = { 4 } textAlign = " right" >
189+ < Box sx = { { mt : 4 , textAlign : ' right' } } >
190190 < Button variant = "text" onClick = { ( ) => setDialogOpen ( false ) } sx = { { mr : 2 } } > { localeMessages [ 'cancel' ] } </ Button >
191191 < Button variant = "contained" onClick = { submitQuiz } > { localeMessages [ 'submit' ] } </ Button >
192192 </ Box >
0 commit comments