Skip to content

Commit

Permalink
Merge pull request #75 from MoaRoom/feat/#72
Browse files Browse the repository at this point in the history
Fix issues about window reload
  • Loading branch information
NayeonKeum authored Sep 14, 2023
2 parents 43b1f4b + 38c4a64 commit e131851
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/components/Submit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Submit: FC = () => {
useEffect(() => {
api.client.get("/steps/" + assignment_id).then((response) => {
if (isProfessor) {
console.log(response.data)
console.log(response.data);
//기존 코드로 인해 list에 값이 중복으로 들어가게 되므로 삭제
for (let i = 0; i < response.data.length; i++) {
tmpList.push({
Expand All @@ -39,7 +39,7 @@ const Submit: FC = () => {
lecture_id: lecture_id,
isProfessor: isProfessor,
} as SubmitterPropType);
console.log(tmpList)
console.log(tmpList);
}
setSubmittersPropsList(tmpList);
//setSubmittersPropsList(response.data)
Expand All @@ -58,13 +58,13 @@ const Submit: FC = () => {
} as SubmitterPropType);
}
}
console.log(submittersPropsList)
console.log(submittersPropsList);
}
});
}, []);

const autoScore = () => {
console.log(submittersPropsList)
console.log(submittersPropsList);
// user_id is professor
console.log("/users/" + user_id + "/urls");
api.client.get("/users/" + user_id + "/urls").then((response) => {
Expand All @@ -81,25 +81,26 @@ const Submit: FC = () => {
assignment_id
)
.then((response) => {
console.log(response)
console.log(response);
var answer = JSON.parse(response.data).answer;
var runtime = JSON.parse(response.data).runtime;
let params = {
user_id: submittersPropsList[i].id,
answer: answer.slice(0, -1), // infra comes with /n
runtime: 1.0,
};
console.log(params)
console.log(params);
api.client
.post("/assignments/" + assignment_id + "/auto", params)
.then(() => {
console.log("자동채점 api 호출")
console.log("자동채점 api 호출");
// window.location.reload();
});
});
}
});
}
});
};
});
};

return (
<>
Expand Down

0 comments on commit e131851

Please # to comment.