PyJaipur / PyJudge

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

sample question have been added. please read description #11

Closed shivankgtm closed 5 years ago

shivankgtm commented 5 years ago

here it is only a sample question and also contains a download link for the input file. the output needs to be generated from input. I guess @arnabsinha99 is working with that. I still think this PR can be improved so I seek review.

i used /question/<number> so we can further put more question in same pattern.

theSage21 commented 5 years ago

This request attempts to solve two things at once. #2 and #5 We can wait for a merge request for issue #2 before merging or you can attempt to factor your solution into two files. One python file for the server and one html file for the question statement.

shivankgtm commented 5 years ago

sounds right. I will wait for @rustagishubhi

theSage21 commented 5 years ago

This can be updated to reflect changes introduced by solving #2 ?

shivankgtm commented 5 years ago

On it

shivankgtm commented 5 years ago

please review @theSage21

theSage21 commented 5 years ago

Correct me if I'm wrong but since it is attempting to solve 2 issues it should have at most 2 URLs. One to show the question, one to download the input file.

Perhaps the /quesiton/<no> and /question/<no>/submit urls can be the same? The statement goes in the HTML file and the file gets renamed to something like q1.html. The HTML will need to be edited to contain the download link right?

shivankgtm commented 5 years ago

yeah right, will try best to make it good. by tomorrow, I will submit a Nice PR. sorry for delay

shivankgtm commented 5 years ago
    <div class="highlight">
        <div class="row">
            <div class="column column-20">

            </div>
            <div class="column">
                <div class="shift-center">
                    <p><!--Question-->Add Two Given Numbers.</p>
                    <a href="/question/1/download/">Download Test Case></a>
                </div>
            </div>
            <div class="column column-20">

            </div>
        </div>
@app.get('/question/<number>')
def question(number):
    return static_file('index.html' , root=dir_path)

@app.get('/question/<number>/download/')
def download(number):
    input_file_name = 'inputs'+number+'.txt'
    return static_file(input_file_name, root=dir_path+'/'+'files/questions/')
shivankgtm commented 5 years ago

I have made changes in HTML file so it will have a link to submit along with question. as discussed in the last comment

shivankgtm commented 5 years ago

@theSage21 sounds cool for now ?

theSage21 commented 5 years ago

This is fine for now.