Comments (16)
can you supply your output file?
from pyjudge.
from pyjudge.
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.
@theSage21 I did not get the cause of the problem i.e. how does "arjoon"=="arjoon".encode()
cause the problem?
from pyjudge.
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.
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.
* **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.
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 giveFalse
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.
yes. In an independent file
from pyjudge.
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.
Is your server running? Connection errors usually happen when the server shuts down.
from pyjudge.
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.
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.
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.
from pyjudge.
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)
- Database HOT 1
- Contest timings HOT 2
- Home page HOT 5
- Multiple contests
- Multiple contest UI design
- Move pre-commit and black to dev dependencies
- Pip installable project HOT 11
- 404 handler HOT 2
- Proper question statement and support HOT 5
- Session support
- Use sqlite as a database
- Interface to add questions via website HOT 4
- Raise error in proper places HOT 5
- Use a more common template system HOT 5
- Continuous testing needs to be added
- User stats/ profile HOT 4
- problem status in contest
- Reinstall black HOT 1
- Code Documentaion HOT 1
- Install pytest in pipenv HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyjudge.