@@ -129,7 +129,7 @@ export default class CodeEditor extends Component {
129
129
const payload = yield this . api . request ( "code_challenges/submit" , {
130
130
method : "POST" ,
131
131
data : {
132
- problemId : this . codeChallenge . get ( "hbProblemId " ) ,
132
+ contentId : this . codeChallenge . get ( "hbContentId " ) ,
133
133
custom_input : Base64 . encode ( this . customInputText ) ,
134
134
source : Base64 . encode ( this . selectedLanguage . source ) ,
135
135
language : this . selectedLanguage . code ,
@@ -151,7 +151,7 @@ export default class CodeEditor extends Component {
151
151
method : "POST" ,
152
152
data : {
153
153
contestId : runAttempt . get ( "run.contestId" ) ,
154
- problemId : this . codeChallenge . get ( "hbProblemId " ) ,
154
+ contentId : this . codeChallenge . get ( "hbContentId " ) ,
155
155
language : this . selectedLanguage . code ,
156
156
source : Base64 . encode ( this . selectedLanguage . source )
157
157
}
@@ -162,21 +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/problems' , {
165
+ this . get ( 'api' ) . request ( ` code_challenges/${ this . codeChallenge . get ( 'id' ) } /problems` , {
166
166
data : {
167
- contest_id : runAttempt . get ( "run.contestId" ) ,
168
- problem_id : this . codeChallenge . get ( "hbProblemId" )
167
+ contest_id : runAttempt . get ( "run.contestId" )
169
168
} ,
170
169
} ) . then ( async result => {
171
170
this . set ( "problemJsonApiPayload" , result ) ;
172
171
const payload = JSON . parse ( JSON . stringify ( result ) )
173
172
this . get ( 'store' ) . unloadAll ( 'problem' )
174
173
later ( async ( ) => {
175
174
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 )
177
176
if ( await problem . get ( 'hasLatestSubmissionPassed' ) && await problem . get ( 'mostSuccessfullSubmission.score' ) == 100 ) {
178
177
const progress = await this . get ( 'content.progress' )
179
- debugger
180
178
progress . set ( "status" , 'DONE' )
181
179
return progress . save ( ) ;
182
180
}
0 commit comments