@@ -84,7 +84,7 @@ export default function id() {
8484 } ) ;
8585
8686 setLoading ( false ) ;
87- } catch ( err ) {
87+ } catch ( err ) {
8888 console . log ( err ) ;
8989 }
9090 }
@@ -106,15 +106,15 @@ export default function id() {
106106 async function getJson ( ) {
107107 try {
108108 let jwt = getCookie ( ) ;
109- if ( ! jwt ) {
109+ if ( ! jwt ) {
110110 console . log ( "User is not authenticated" ) ;
111111 return ;
112112 }
113113 const uid = user . uid ;
114114 let url = `${ process . env . NEXT_PUBLIC_TERM_URL } get/json?jwtToken=${ jwt } &assignmentID=${ assignment . id } &uid=${ uid } ` ;
115115 let requestOptions = { method : 'GET' } ;
116116 let response = await fetch ( url , requestOptions ) ;
117- if ( ! response . ok ) {
117+ if ( ! response . ok ) {
118118 console . log ( 'Error fetching kana log' ) ;
119119 return ;
120120 }
@@ -131,27 +131,27 @@ export default function id() {
131131 result = await reader . read ( ) ;
132132 }
133133
134- if ( ! data ) {
134+ if ( ! data ) {
135135 console . log ( 'Error parsing kana log' ) ;
136136 return ;
137137 }
138138
139139 let events = data . events ;
140140
141- for ( let i = 0 ; i < events . length ; i ++ ) {
141+ for ( let i = 0 ; i < events . length ; i ++ ) {
142142 events [ i ] . seconds = convert ( events [ i ] . timestamp ) ;
143143 }
144144
145145 setKanaError ( true ) ;
146146
147147 setKanaLog ( events ) ; // []
148- } catch ( err ) {
148+ } catch ( err ) {
149149 console . log ( err ) ;
150150 }
151151 }
152152
153153 useEffect ( ( ) => {
154- if ( ! loading ) {
154+ if ( ! loading ) {
155155 getJson ( ) ;
156156 console . log ( "penguins" )
157157 console . log ( router . query . key )
@@ -302,21 +302,14 @@ export default function id() {
302302 < StandardNav />
303303 < div className = " min-h-screen " >
304304 < div className = "mx-auto mt-4" >
305- < a
306- href = "/groups/122ctfguide"
307- className = "hidden text-neutral-200 hover:text-neutral-500"
308- >
309- < i className = "fas fa-long-arrow-alt-left" > </ i > Return Home
310- </ a >
311-
312305 < div className = "w-full bg-gradient-to-r from-blue-800 via-blue-900 to-blue-800 px-4 py-4 " >
313306 < div className = "mx-auto px-2" >
314307 < div className = "flex" >
315308 < div >
316309 < h1 className = "text-3xl font-semibold text-white" >
317310 {
318311 submission && assignment ? < span > { submission . user . firstName } { submission . user . lastName } 's Submission</ span >
319- : < span > ... Submission</ span >
312+ : < span > ... Submission</ span >
320313 }
321314 </ h1 >
322315
@@ -333,11 +326,16 @@ export default function id() {
333326 ) }
334327
335328 </ div >
336-
329+ < a
330+ href = "/groups/{classroom.id}/home"
331+ className = " text-neutral-200 hover:text-neutral-500 ml-auto "
332+ >
333+ < i className = "fas fa-long-arrow-alt-left text-white" > </ i > < span className = 'text-white' > Return Home</ span >
334+ </ a >
337335 < div className = "ml-auto" >
338336 < div className = "rounded-md bg-white px-3 py-1 text-center gap-y-0" >
339337 < h1 className = "text-4xl font-bold text-blue-600 text-center mb-0 pb-0 " >
340- { submission ? submission . grade : '00' } %
338+ { submission ? submission . grade : '00' } %
341339 </ h1 >
342340 </ div >
343341 </ div >
@@ -410,7 +408,7 @@ export default function id() {
410408 >
411409 < div className = "absolute -start-1.5 mt-1.5 h-3 w-3 rounded-full border border-neutral-800 bg-blue-500 " > </ div >
412410 < time className = "mb-1 text-sm font-normal leading-none text-neutral-400 " >
413- { item . timestamp }
411+ { item . timestamp }
414412 </ time >
415413 < h3 className = "text-md font-semibold text-blue-400 " >
416414 { item . header }
@@ -442,61 +440,61 @@ export default function id() {
442440
443441
444442 < Transition . Root show = { open } as = { Fragment } >
445- < Dialog as = "div" className = "relative z-10" onClose = { setOpen } >
446- < Transition . Child
447- as = { Fragment }
448- enter = "ease-out duration-300"
449- enterFrom = "opacity-0"
450- enterTo = "opacity-100"
451- leave = "ease-in duration-200"
452- leaveFrom = "opacity-100"
453- leaveTo = "opacity-0"
454- >
455- < div className = "fixed inset-0 bg-black bg-opacity-75 transition-opacity" />
456- </ Transition . Child >
457-
458- < div className = "fixed inset-0 z-10 w-screen overflow-y-auto" >
459- < div className = "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0" >
460- < Transition . Child
461- as = { Fragment }
462- enter = "ease-out duration-300"
463- enterFrom = "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
464- enteredo = "opacity-100 translate-y-0 sm:scale-100"
465- leave = "ease-in duration-200"
466- leaveFrom = "opacity-100 translate-y-0 sm:scale-100"
467- leaveTo = "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
468- >
469- < Dialog . Panel className = "max-w-6xl relative transform overflow-hidden rounded-lg bg-neutral-900 px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:my-8 sm:p-6" >
470- < div >
471- < div className = "mt-3 sm:mt-5" >
472- < Dialog . Title as = "h3" className = " font-semibold leading-6 text-xl text-white" >
473- Penalty Explanation
474- </ Dialog . Title >
475- < div className = "mt-2 mb-5" >
476- < p className = "text-md text-white" >
477- When configuring this assignment, you requested that attempting to guess locations was prohibited.
478- Typically, the student wouldn't have been penalized for changing to a directory that doesn't exist. But, because they attempted to cd into a folder that they knew wasn't there after running < span className = 'bg-black px-4' > ls</ span > , it can be assumed that they were attempting to guess the location. As a result I gave a 5 point penalty.
479- </ p >
480-
481-
482- < h1 className = 'text-md font-semibold text-white mt-4' > Was my penalty appropriate?</ h1 >
483- < button className = 'mt-3 text-white bg-green-700 px-4 py-1 rounded-lg' > Yes</ button >
484- < button className = 'ml-2 text-white bg-red-700 px-4 py-1 rounded-lg' > No</ button >
485-
486- < h1 className = 'text-md font-semibold text-white mt-4' > Do you have any feedback? The AI will try to improve its grading strategy.</ h1 >
487- < textarea className = 'bg-neutral-800 text-white w-full rounded-lg px-4 py-2 mt-2 border-none' placeholder = 'Enter feedback here...' > </ textarea >
488- < button className = 'mt-3 text-white bg-blue-700 px-4 py-1 rounded-lg' > Submit Feedback</ button >
443+ < Dialog as = "div" className = "relative z-10" onClose = { setOpen } >
444+ < Transition . Child
445+ as = { Fragment }
446+ enter = "ease-out duration-300"
447+ enterFrom = "opacity-0"
448+ enterTo = "opacity-100"
449+ leave = "ease-in duration-200"
450+ leaveFrom = "opacity-100"
451+ leaveTo = "opacity-0"
452+ >
453+ < div className = "fixed inset-0 bg-black bg-opacity-75 transition-opacity" />
454+ </ Transition . Child >
455+
456+ < div className = "fixed inset-0 z-10 w-screen overflow-y-auto" >
457+ < div className = "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0" >
458+ < Transition . Child
459+ as = { Fragment }
460+ enter = "ease-out duration-300"
461+ enterFrom = "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
462+ enteredo = "opacity-100 translate-y-0 sm:scale-100"
463+ leave = "ease-in duration-200"
464+ leaveFrom = "opacity-100 translate-y-0 sm:scale-100"
465+ leaveTo = "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
466+ >
467+ < Dialog . Panel className = "max-w-6xl relative transform overflow-hidden rounded-lg bg-neutral-900 px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:my-8 sm:p-6" >
468+ < div >
469+ < div className = "mt-3 sm:mt-5" >
470+ < Dialog . Title as = "h3" className = " font-semibold leading-6 text-xl text-white" >
471+ Penalty Explanation
472+ </ Dialog . Title >
473+ < div className = "mt-2 mb-5" >
474+ < p className = "text-md text-white" >
475+ When configuring this assignment, you requested that attempting to guess locations was prohibited.
476+ Typically, the student wouldn't have been penalized for changing to a directory that doesn't exist. But, because they attempted to cd into a folder that they knew wasn't there after running < span className = 'bg-black px-4' > ls</ span > , it can be assumed that they were attempting to guess the location. As a result I gave a 5 point penalty.
477+ </ p >
478+
479+
480+ < h1 className = 'text-md font-semibold text-white mt-4' > Was my penalty appropriate?</ h1 >
481+ < button className = 'mt-3 text-white bg-green-700 px-4 py-1 rounded-lg' > Yes</ button >
482+ < button className = 'ml-2 text-white bg-red-700 px-4 py-1 rounded-lg' > No</ button >
483+
484+ < h1 className = 'text-md font-semibold text-white mt-4' > Do you have any feedback? The AI will try to improve its grading strategy.</ h1 >
485+ < textarea className = 'bg-neutral-800 text-white w-full rounded-lg px-4 py-2 mt-2 border-none' placeholder = 'Enter feedback here...' > </ textarea >
486+ < button className = 'mt-3 text-white bg-blue-700 px-4 py-1 rounded-lg' > Submit Feedback</ button >
487+
488+ </ div >
489+ </ div >
490+ </ div >
489491
492+ </ Dialog . Panel >
493+ </ Transition . Child >
494+ </ div >
490495 </ div >
491- </ div >
492- </ div >
493-
494- </ Dialog . Panel >
495- </ Transition . Child >
496- </ div >
497- </ div >
498- </ Dialog >
499- </ Transition . Root >
496+ </ Dialog >
497+ </ Transition . Root >
500498 </ div >
501499 </ div >
502500 </ div >
0 commit comments