@@ -6,9 +6,8 @@ import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
66import { Tooltip } from "@mui/material" ;
77import Typography from "@mui/material/Typography" ;
88import Box from "@mui/material/Box" ;
9- import { Link } from '@mui/material' ;
10- import { List , ListItem } from '@mui/material' ;
11-
9+ import { Link } from "@mui/material" ;
10+ import { List , ListItem } from "@mui/material" ;
1211
1312function LinearProgressWithLabel ( props ) {
1413 return (
@@ -53,14 +52,14 @@ const ProblemJumpLink = ({ lineNumber, editorRef, label }) => {
5352 variant = "body2"
5453 onClick = { handleJump }
5554 sx = { {
56- textAlign : ' left' ,
57- verticalAlign : ' baseline' ,
58- textDecoration : ' none' ,
59- ' &:hover' : {
60- textDecoration : ' underline' ,
55+ textAlign : " left" ,
56+ verticalAlign : " baseline" ,
57+ textDecoration : " none" ,
58+ " &:hover" : {
59+ textDecoration : " underline" ,
6160 } ,
62- cursor : ' pointer' ,
63- color : ' primary.main' ,
61+ cursor : " pointer" ,
62+ color : " primary.main" ,
6463 fontWeight : 500 ,
6564 } }
6665 >
@@ -69,7 +68,6 @@ const ProblemJumpLink = ({ lineNumber, editorRef, label }) => {
6968 ) ;
7069} ;
7170
72-
7371function AssignmentProblems ( {
7472 history,
7573 allProblemDisplayNames,
@@ -115,59 +113,70 @@ function AssignmentProblems({
115113 return ( numSolved / allProblemDisplayNames . length ) * 100 ;
116114 }
117115
118-
119116 // TODO span styling and improve accessibility?
120117 const problems = allProblemDisplayNames . map ( ( problemDisplayName ) => {
121118 const lines = problemLines [ problemDisplayName ] ;
122119
123120 if ( problemLines [ problemDisplayName ] . length === 0 ) {
124121 return (
125- < Box key = { problemDisplayName } sx = { { display : 'flex' , alignItems : 'center' , my : 0.5 } } >
126- { getIcon ( problemDisplayName ) }
127- < Typography variant = "body2" sx = { { ml : 1 , color : 'text.disabled' } } >
128- { problemDisplayName } (Not found)
129- </ Typography >
130- </ Box >
131- ) ;
122+ < Box
123+ key = { problemDisplayName }
124+ sx = { { display : "flex" , alignItems : "center" , my : 0.5 } }
125+ >
126+ { getIcon ( problemDisplayName ) }
127+ < Typography variant = "body2" sx = { { ml : 1 , color : "text.disabled" } } >
128+ { problemDisplayName } (Not found)
129+ </ Typography >
130+ </ Box >
131+ ) ;
132132 } else if ( problemLines [ problemDisplayName ] . length === 1 ) {
133133 return (
134- < Box key = { problemDisplayName } sx = { { display : 'flex' , alignItems : 'center' , my : 0.5 } } >
135- { getIcon ( problemDisplayName ) }
136- < Box sx = { { ml : 1 } } >
137- < ProblemJumpLink
138- lineNumber = { lines [ 0 ] }
139- editorRef = { editorRef }
140- label = { problemDisplayName }
141- />
134+ < Box
135+ key = { problemDisplayName }
136+ sx = { { display : "flex" , alignItems : "center" , my : 0.5 } }
137+ >
138+ { getIcon ( problemDisplayName ) }
139+ < Box sx = { { ml : 1 } } >
140+ < ProblemJumpLink
141+ lineNumber = { lines [ 0 ] }
142+ editorRef = { editorRef }
143+ label = { problemDisplayName }
144+ />
145+ </ Box >
142146 </ Box >
143- </ Box >
144- ) ;
147+ ) ;
145148 } else {
146149 return (
147- < Box key = { problemDisplayName } sx = { { my : 1 } } >
148- < Box sx = { { display : 'flex' , alignItems : 'center' } } >
149- { getIcon ( problemDisplayName ) }
150- < Typography variant = "body2" sx = { { ml : 1 } } >
151- { problemDisplayName }
152- </ Typography >
153- </ Box >
154- < Box sx = { { pl : 4 , display : 'flex' , flexDirection : 'column' , flexWrap : 'wrap' } } >
155-
156- < List sx = { { listStyleType : 'disc' , pl : '1rem' } } >
157- { lines . map ( ( lineNumber ) => (
158- < ListItem disablePadding sx = { { display : 'list-item' } } >
159- < ProblemJumpLink
160- key = { `${ problemDisplayName } -${ lineNumber } ` }
161- lineNumber = { lineNumber }
162- editorRef = { editorRef }
163- label = { `Line ${ lineNumber } ` }
164- />
165- </ ListItem >
166- ) ) }
167- </ List >
168- </ Box >
169- </ Box >
170- ) ;
150+ < Box key = { problemDisplayName } sx = { { my : 1 } } >
151+ < Box sx = { { display : "flex" , alignItems : "center" } } >
152+ { getIcon ( problemDisplayName ) }
153+ < Typography variant = "body2" sx = { { ml : 1 } } >
154+ { problemDisplayName }
155+ </ Typography >
156+ </ Box >
157+ < Box
158+ sx = { {
159+ pl : 4 ,
160+ display : "flex" ,
161+ flexDirection : "column" ,
162+ flexWrap : "wrap" ,
163+ } }
164+ >
165+ < List sx = { { listStyleType : "disc" , pl : "1rem" } } >
166+ { lines . map ( ( lineNumber ) => (
167+ < ListItem disablePadding sx = { { display : "list-item" } } >
168+ < ProblemJumpLink
169+ key = { `${ problemDisplayName } -${ lineNumber } ` }
170+ lineNumber = { lineNumber }
171+ editorRef = { editorRef }
172+ label = { `Line ${ lineNumber } ` }
173+ />
174+ </ ListItem >
175+ ) ) }
176+ </ List >
177+ </ Box >
178+ </ Box >
179+ ) ;
171180 }
172181 } ) ;
173182
0 commit comments