@@ -86,7 +86,7 @@ export default class CodeEditor extends Component {
86
86
] )
87
87
88
88
setCodeStubs ( ) {
89
- this . problem . solutionStubs . map ( stub => {
89
+ this . problem . get ( ' solutionStubs' ) . map ( stub => {
90
90
const languageSpec = this . languageSpecs . findBy ( 'code' , stub . language )
91
91
if ( languageSpec . source === '' ) {
92
92
set ( languageSpec , 'source' , stub . body )
@@ -162,19 +162,19 @@ export default class CodeEditor extends Component {
162
162
"method" : "GET"
163
163
} ) , submissionStatus => submissionStatus && submissionStatus [ 'judge-result' ] !== null ) ;
164
164
165
- this . get ( 'api' ) . request ( `code_challenges/${ this . codeChallenge . get ( 'id' ) } /problems ` , {
165
+ this . get ( 'api' ) . request ( `code_challenges/${ this . codeChallenge . get ( 'id' ) } /content ` , {
166
166
data : {
167
167
contest_id : runAttempt . get ( "run.contestId" )
168
168
} ,
169
169
} ) . then ( async result => {
170
- this . set ( "problemJsonApiPayload" , result ) ;
170
+ // this.set("problemJsonApiPayload", result);
171
171
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 ( ) => {
174
174
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' )
178
178
progress . set ( "status" , 'DONE' )
179
179
return progress . save ( ) ;
180
180
}
0 commit comments