Giter Site home page Giter Site logo

Comments (16)

theSage21 avatar theSage21 commented on July 17, 2024

can you supply your output file?

from pyjudge.

shivankgtm avatar shivankgtm commented on July 17, 2024

output.txt

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

Supplying this file via requests:

import requests
r = requests.post('http://localhost:8080/upload', files={'upload': open('output.txt', 'rb')})
print(r.text)

reproduces the bug. The problem is still there even if we supply the actual expected_output file, meaning the issue is in the python server.

The problem is there because "arjoonn" == "arjoonn".encode() will always give False

I've verified that this is indeed the problem. I will leave the actual code fix open for someone else to do.

from pyjudge.

arnabsinha99 avatar arnabsinha99 commented on July 17, 2024

@theSage21 I did not get the cause of the problem i.e. how does "arjoon"=="arjoon".encode() cause the problem?

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

That is for you to figure out. You can explore the code using print statements or a debugger if your editor/IDE provides one. If I point out why it's the cause, there will be no learning.

  • Try to understand Why 'arjoonn' == 'arjoonn'.encode() gives False
  • Try to find out why this affects our code

from pyjudge.

arnabsinha99 avatar arnabsinha99 commented on July 17, 2024

That is for you to figure out. You can explore the code using print statements or a debugger if your editor/IDE provides one. If I point out why it's the cause, there will be no learning.

  • Try to understand Why 'arjoonn' == 'arjoonn'.encode() gives False
  • Try to find out why this affects our code

Sure I will look into it. :-)

from pyjudge.

arnabsinha99 avatar arnabsinha99 commented on July 17, 2024
* **I am submitting this regarding a:**
  
  * [ ]  Bug report

* **Description of the ISSUE:**
  it's not telling the output correctly. though following part of the code looks good when we see it.
expected = expected.strip()
    uploaded = uploaded.strip()
    ans = (uploaded==expected)
    
    if not ans:
        return "Wrong Answer!!"
    else:
        
        return "Solved! Great Job! "

expected and present behavior

* I solved the question1 of adding two numbers and submitted on our platform but it's not showing the "Wrong Answer".

* I should have got "Solved! Great Job".

someone need to look into it and see what's going on.

You mean it is showing Wrong answer right? I am not getting any output when I am submitting any file. Where can you see your output?

from pyjudge.

arnabsinha99 avatar arnabsinha99 commented on July 17, 2024

Supplying this file via requests:

import requests
r = requests.post('http://localhost:8080/upload', files={'upload': open('output.txt', 'rb')})
print(r.text)

reproduces the bug. The problem is still there even if we supply the actual expected_output file, meaning the issue is in the python server.

The problem is there because "arjoonn" == "arjoonn".encode() will always give False

I've verified that this is indeed the problem. I will leave the actual code fix open for someone else to do.

Where did you place this snippet of code? In an independent file? @theSage21

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

yes. In an independent file

from pyjudge.

arnabsinha99 avatar arnabsinha99 commented on July 17, 2024
import requests
r = requests.post('http://localhost:8080/upload', files={'upload': open('output.txt', 'rb')})
print(r.text)

I use VSCode 2015. The above code, in an independent file, ran once, gave "Wrong Answer". Then on running the code once again, I got the following error:-
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it .
I searched the net but could not understand any solution that I found. Could you suggest what I can do?

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

Is your server running? Connection errors usually happen when the server shuts down.

from pyjudge.

arnabsinha99 avatar arnabsinha99 commented on July 17, 2024

Is your server running? Connection errors usually happen when the server shuts down.

How do I check if it is running or not?

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

How did you run it? I'm not familiar with VS Code. Wherever you ran the server file there the process should be running.

from pyjudge.

arnabsinha99 avatar arnabsinha99 commented on July 17, 2024

How did you run it? I'm not familiar with VS Code. Wherever you ran the server file there the process should be running.

@theSage21 I put the file having this code in the local repository of PyJudge i.e. where server.py exists. I then executed the code.

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

from pyjudge.

cquark7 avatar cquark7 commented on July 17, 2024

I solved this issue just by adding 1 character to the existing server.py script.
My travis-ci checks are failing. Don't know what's wrong.
I created a local repo by cloning PyJudge.
Made some changes and pushed them to my fork.
Sent PR.

Please suggest some workaround.

from pyjudge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.