File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed
pages/academy/grading/subcomponents Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -1056,7 +1056,7 @@ export const getGrading = async (
10561056 xpAdjustment : grade . xpAdjustment ,
10571057 comments : grade . comments
10581058 } ,
1059- ai_comments : gradingQuestion . ai_comments ?. response . split ( '|||' ) || [ ]
1059+ ai_comments : gradingQuestion . ai_comments ?. response ? .split ( '|||' ) || [ ]
10601060 } as GradingQuestion ;
10611061
10621062 if ( gradingQuestion . grade . grader !== null ) {
@@ -1559,8 +1559,8 @@ export const removeAssessmentConfig = async (
15591559 */
15601560export const postGenerateComments = async (
15611561 tokens : Tokens ,
1562- submission_id : integer ,
1563- question_id : integer
1562+ submission_id : number ,
1563+ question_id : number
15641564) : Promise < { comments : string [ ] } | null > => {
15651565 const resp = await request (
15661566 `${ courseId ( ) } /admin/generate-comments/${ submission_id } /${ question_id } ` ,
@@ -1578,8 +1578,8 @@ export const postGenerateComments = async (
15781578
15791579export const saveFinalComment = async (
15801580 tokens : Tokens ,
1581- submission_id : integer ,
1582- question_id : integer ,
1581+ submission_id : number ,
1582+ question_id : number ,
15831583 comment : string
15841584) : Promise < Response | null > => {
15851585 const resp = await request (
Original file line number Diff line number Diff line change @@ -18,16 +18,17 @@ const GradingCommentSelector: React.FC<Props> = props => {
1818 < div >
1919 { ' ' }
2020 { props . comments . length > 0 ? (
21- props . comments . map ( el => {
21+ props . comments . map ( ( el , index ) => {
2222 return (
23- < div
23+ < button
24+ key = { index }
2425 className = "grading-comment-selector-item"
2526 onClick = { ( ) => {
2627 props . onSelect ( el ) ;
2728 } }
2829 >
2930 { el }
30- </ div >
31+ </ button >
3132 ) ;
3233 } )
3334 ) : (
Original file line number Diff line number Diff line change @@ -167,10 +167,10 @@ const GradingEditor: React.FC<Props> = props => {
167167 */
168168 const validateXpBeforeSave =
169169 ( handleSaving : GradingSaveFunction ) : ( ( ) => void ) =>
170- ( ) => {
170+ async ( ) => {
171171 const newXpAdjustmentInput = convertParamToInt ( xpAdjustmentInput || undefined ) || undefined ;
172172 const xp = props . initialXp + ( newXpAdjustmentInput || 0 ) ;
173- postSaveFinalComment ( editorValue ) ;
173+ await postSaveFinalComment ( editorValue ) ;
174174 if ( xp < 0 || xp > props . maxXp ) {
175175 showWarningMessage (
176176 `XP ${ xp . toString ( ) } is out of bounds. Maximum xp is ${ props . maxXp . toString ( ) } .`
Original file line number Diff line number Diff line change @@ -358,8 +358,8 @@ $code-color-notification: #f9f0d7;
358358 }
359359
360360 .grading-comment-selector-item {
361- margin : 4 px ;
362- padding : 4 px ;
361+ margin : 3 px ;
362+ padding : 7 px ;
363363 background-color : $cadet-color-2 ;
364364 border : 1px solid $cadet-color-3 ;
365365 cursor : pointer ;
You can’t perform that action at this time.
0 commit comments