You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be cool to add a parser function similar to get_solution, but for mashup contests created in gym.
Implementation should be similar, except for /gym/ in the url path
defget_gym_solution(self, contest_id, submit_id):
solutionPage=self.session.get(
"https://codeforces.com/gym/"+str(contest_id)
+"/submission/"+str(submit_id)
)
ifint(solutionPage.status_code) !=200:
raiseException("Returned not OK code "+str(solutionPage))
tree2=html.fromstring(solutionPage.text)
code=tree2.xpath("//pre[@id='program-source-text']/text()")
iflen(code) ==0:
raiseValueError("Incorrect contest_id or submit_id "+str(code))
returncode[0].replace("\r", "")
or just add one more parameter to get_solution with default value gym=False
The text was updated successfully, but these errors were encountered:
I can see gym submissions aren't public, so you need to authenticate to grab the solution. So it's nearly impossible to create such feature. Correct me if I'm mistaken.
Yes, this feature requires authorized access to api, so should be available only when api key and secret specified.
Nevertheless, I am as a tutor could have plenty of different private contests for training and anyway will need to download student's solutions for plagiarism and code style checks.
Would be cool to add a parser function similar to
get_solution
, but for mashup contests created in gym.Implementation should be similar, except for
/gym/
in the url pathor just add one more parameter to
get_solution
with default valuegym=False
The text was updated successfully, but these errors were encountered: