Commit d0d8daf 1 parent 6efd880 commit d0d8daf Copy full SHA for d0d8daf
File tree 1 file changed +17
-7
lines changed
webcomponents/tool/src/main/frontend/packages/sakai-grader/src
1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -673,14 +673,24 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle
673
673
}
674
674
675
675
if ( filtered . length > 0 ) {
676
- const firstSubmissionId = filtered [ 0 ] . id ;
677
- this . _hydrateCluster ( firstSubmissionId ) . then ( submission => {
676
+ const currentSubmission = filtered . find ( s => s . id === this . _submission . id ) ;
678
677
679
- if ( submission ) {
680
- this . _submissions = [ ...filtered ] ;
681
- this . _submission = submission ;
682
- }
683
- } ) ;
678
+ if ( currentSubmission ) {
679
+ this . _hydrateCluster ( this . _submission . id ) . then ( submission => {
680
+ if ( submission ) {
681
+ this . _submissions = [ ...filtered ] ;
682
+ this . _submission = submission ;
683
+ }
684
+ } ) ;
685
+ } else {
686
+ const firstSubmissionId = filtered [ 0 ] . id ;
687
+ this . _hydrateCluster ( firstSubmissionId ) . then ( submission => {
688
+ if ( submission ) {
689
+ this . _submissions = [ ...filtered ] ;
690
+ this . _submission = submission ;
691
+ }
692
+ } ) ;
693
+ }
684
694
} else {
685
695
this . _submission = new Submission ( ) ;
686
696
}
You can’t perform that action at this time.
0 commit comments