@@ -86,7 +86,7 @@ export default class CodeEditor extends Component {
8686 ] )
8787
8888 setCodeStubs ( ) {
89- this . problem . solutionStubs . map ( stub => {
89+ this . problem . get ( ' solutionStubs' ) . map ( stub => {
9090 const languageSpec = this . languageSpecs . findBy ( 'code' , stub . language )
9191 if ( languageSpec . source === '' ) {
9292 set ( languageSpec , 'source' , stub . body )
@@ -162,19 +162,19 @@ export default class CodeEditor extends Component {
162162 "method" : "GET"
163163 } ) , submissionStatus => submissionStatus && submissionStatus [ 'judge-result' ] !== null ) ;
164164
165- this . get ( 'api' ) . request ( `code_challenges/${ this . codeChallenge . get ( 'id' ) } /problems ` , {
165+ this . get ( 'api' ) . request ( `code_challenges/${ this . codeChallenge . get ( 'id' ) } /content ` , {
166166 data : {
167167 contest_id : runAttempt . get ( "run.contestId" )
168168 } ,
169169 } ) . then ( async result => {
170- this . set ( "problemJsonApiPayload" , result ) ;
170+ // this.set("problemJsonApiPayload", result);
171171 const payload = JSON . parse ( JSON . stringify ( result ) )
172- this . get ( 'store' ) . unloadAll ( 'problem' )
173- later ( async ( ) => {
172+ // this.get('store').unloadAll('hbcontent') // kyu ?
173+ later ( async ( ) => {
174174 this . get ( 'store' ) . pushPayload ( payload )
175- const problem = await this . get ( 'store' ) . peekRecord ( 'problem ' , result . data . id )
176- if ( await problem . get ( 'hasLatestSubmissionPassed' ) && await problem . get ( 'mostSuccessfullSubmission .score') == 100 ) {
177- const progress = await this . get ( 'content. progress' )
175+ const hbContent = await this . get ( 'store' ) . peekRecord ( 'hbcontent ' , result . data . id )
176+ if ( await hbContent . get ( 'topSubmission .score' ) == 100 ) {
177+ const progress = await this . content . get ( 'progress' )
178178 progress . set ( "status" , 'DONE' )
179179 return progress . save ( ) ;
180180 }
0 commit comments