|
|
|
@ -714,10 +714,10 @@ pop_box_new(htmlvalue, 480, 182);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
testSetUnlock() {
|
|
|
|
|
const { game } = this.state;
|
|
|
|
|
const url = `/v1/games/${game.identifier}/check_test_sets.json`
|
|
|
|
|
const { game, challenge } = this.state;
|
|
|
|
|
const url = `/tasks/${game.identifier}/check_test_sets.json`
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
withCredentials: true,
|
|
|
|
|
// withCredentials: true,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
// TODO status -2 重复操作,直接解锁
|
|
|
|
@ -727,12 +727,12 @@ pop_box_new(htmlvalue, 480, 182);
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
// 被扣除的金币,是负数
|
|
|
|
|
const deltaScore = response.data.score;
|
|
|
|
|
const deltaScore = -challenge.score * 5;
|
|
|
|
|
// output_sets
|
|
|
|
|
let { output_sets } = this.state;
|
|
|
|
|
output_sets = Object.assign({}, output_sets);
|
|
|
|
|
const test_sets_array = JSON.parse("[" + response.data.test_sets + "]");
|
|
|
|
|
output_sets.test_sets_array = test_sets_array;
|
|
|
|
|
// const test_sets_array = JSON.parse("[" + response.data.test_sets + "]");
|
|
|
|
|
output_sets.test_sets_array = response.data.test_sets;
|
|
|
|
|
this.setState({
|
|
|
|
|
output_sets: output_sets,
|
|
|
|
|
grade: this.state.grade + deltaScore,
|
|
|
|
|