PyJaipur / PyJudge

Simple Programming Contest hosting software
MIT License
17 stars 29 forks source link

Accepting a participant's output file #4

Closed theSage21 closed 5 years ago

theSage21 commented 5 years ago

We need a place for the participant to upload her program's output. We should be able to accept a plain text file from the form mentioned in #2

On accepting the file, we have to compare it to a known output file and tell the user if the output was correct or not.

How to solve

arnabsinha99 commented 5 years ago

I am up for #4

theSage21 commented 5 years ago

Wonderful!

On Sun 13 Jan, 2019, 15:36 Arnab Sinha <notifications@github.com wrote:

I am up for #4 https://github.com/PyJaipur/PyJudge/issues/4

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PyJaipur/PyJudge/issues/4#issuecomment-453816955, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVj0TSUVPWuIswZoeTCoMih0vCScpuCks5vCwUTgaJpZM4Z3h0N .

arnabsinha99 commented 5 years ago

Is there any other source, Just for additional reference , to refer for Bottle framework other than the documentation? @theSage21

theSage21 commented 5 years ago

bottle is small enough that if the documentation is not helping, looking at the source code can help. It's just one file called bottle.py

If however you are looking for examples of usage, a github search might yield some good results

For this particular issue what you are looking for is the file upload section

theSage21 commented 5 years ago

@arnabsinha99 any updates?

arnabsinha99 commented 5 years ago

I have started to understand what Bottle is and some syntaxes.. I will soon do it as I need some more time.

theSage21 commented 5 years ago

Wonderful!

On Tue 15 Jan, 2019, 18:20 Arnab Sinha <notifications@github.com wrote:

I have started to understand what Bottle is and some syntaxes.. I will soon do it as I need some more time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PyJaipur/PyJudge/issues/4#issuecomment-454381346, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVj0ShpLBSpfB5yWzKxSJeAR7OKf7yAks5vDc6SgaJpZM4Z3h0N .

jayeshchoubisa commented 5 years ago

@arnabsinha99 has you done with the issue. I am also trying to merge the code but having some issues.

theSage21 commented 5 years ago

Merge? Is there a pull request?

Also if you are having problems ask here

arnabsinha99 commented 5 years ago

@arnabsinha99 has you done with the issue. I am also trying to merge the code but having some issues.

Have you continued with the same code after the "server.py" file that is already made or have you made a new "server.py" file ?

arnabsinha99 commented 5 years ago

@theSage21 In the "Browse files" button, the user has to submit only the produced output that he/she has got right? Do we have to accept the code as well?

theSage21 commented 5 years ago

no. only the output file that they have produced

arnabsinha99 commented 5 years ago

Where do I store the file that we are accepting?

jayeshchoubisa commented 5 years ago

I am confused with one thing are we using any platform to run the code and check the correctness.

theSage21 commented 5 years ago

no need to store it. Just like we have the question's input file, we need one expected output file also. The file that the user uploaded we just have to read that, compare to the expected file and return if thy are equal or not.

Maybe something like:

def fn():
    uploaded = somehow_get_the_uploaded_file_text()
    with open('expected_file_path', 'r') as fl:
        expected = fl.read()
    return 'Solved!' if expected == uploaded else 'wrong answer'
theSage21 commented 5 years ago

In this project we are not running code. We are simply checking if output supplied matches expected output. In later sprints we will be running code also (Java / C) etc.

theSage21 commented 5 years ago

By project I mean https://github.com/PyJaipur/PyJudge/projects

jayeshchoubisa commented 5 years ago

yeah okay

jayeshchoubisa commented 5 years ago

has you got executed with it.

theSage21 commented 5 years ago

मतलब?

jayeshchoubisa commented 5 years ago

has you got executed with it.

jayeshchoubisa commented 5 years ago

tumne issue resolve kar diya with function for submit

arnabsinha99 commented 5 years ago

I am on it. It is completely new and I am getting the hang of it slowly.

jayeshchoubisa commented 5 years ago

same here .

theSage21 commented 5 years ago

Lage raho. Koi sawaal ho toh yahan puch lena.

arnabsinha99 commented 5 years ago

capture

I have made changes to server.py and index.html . Why is the above error occuring in GitHub Desktop when I am trying to push to origin?

theSage21 commented 5 years ago

Are you tying to push to this repository?

You have to fork this, push to your repo and then open a merge request.

There are a lot of tutorials on the internet regarding this.

https://github.com/PyJaipur/PyJaipur-first-PR

arnabsinha99 commented 5 years ago

I had forked the original repo by mistake even though I was aware of the steps. I apologize for the inconvenience. I have made a pull request recently. Kindly review it. Thanks @theSage21

theSage21 commented 5 years ago

no problem. :+1:

theSage21 commented 5 years ago

24 fixed this