@@ -129,7 +129,7 @@ export default class CodeEditor extends Component {
129129 const payload = yield this . api . request ( "code_challenges/submit" , {
130130 method : "POST" ,
131131 data : {
132- problemId : this . codeChallenge . get ( "hbProblemId " ) ,
132+ contentId : this . codeChallenge . get ( "hbContentId " ) ,
133133 custom_input : Base64 . encode ( this . customInputText ) ,
134134 source : Base64 . encode ( this . selectedLanguage . source ) ,
135135 language : this . selectedLanguage . code ,
@@ -151,7 +151,7 @@ export default class CodeEditor extends Component {
151151 method : "POST" ,
152152 data : {
153153 contestId : runAttempt . get ( "run.contestId" ) ,
154- problemId : this . codeChallenge . get ( "hbProblemId " ) ,
154+ contentId : this . codeChallenge . get ( "hbContentId " ) ,
155155 language : this . selectedLanguage . code ,
156156 source : Base64 . encode ( this . selectedLanguage . source )
157157 }
@@ -162,21 +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/problems' , {
165+ this . get ( 'api' ) . request ( ` code_challenges/${ this . codeChallenge . get ( 'id' ) } /problems` , {
166166 data : {
167- contest_id : runAttempt . get ( "run.contestId" ) ,
168- problem_id : this . codeChallenge . get ( "hbProblemId" )
167+ contest_id : runAttempt . get ( "run.contestId" )
169168 } ,
170169 } ) . then ( async result => {
171170 this . set ( "problemJsonApiPayload" , result ) ;
172171 const payload = JSON . parse ( JSON . stringify ( result ) )
173172 this . get ( 'store' ) . unloadAll ( 'problem' )
174173 later ( async ( ) => {
175174 this . get ( 'store' ) . pushPayload ( payload )
176- const problem = await this . get ( 'store' ) . peekRecord ( 'problem' , this . codeChallenge . get ( 'hbProblemId' ) )
175+ const problem = await this . get ( 'store' ) . peekRecord ( 'problem' , result . data . id )
177176 if ( await problem . get ( 'hasLatestSubmissionPassed' ) && await problem . get ( 'mostSuccessfullSubmission.score' ) == 100 ) {
178177 const progress = await this . get ( 'content.progress' )
179- debugger
180178 progress . set ( "status" , 'DONE' )
181179 return progress . save ( ) ;
182180 }
0 commit comments