Closed shivankgtm closed 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.
sounds right. I will wait for @rustagishubhi
This can be updated to reflect changes introduced by solving #2 ?
On it
please review @theSage21
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?
yeah right, will try best to make it good. by tomorrow, I will submit a Nice PR. sorry for delay
<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/')
I have made changes in HTML file so it will have a link to submit along with question. as discussed in the last comment
@theSage21 sounds cool for now ?
This is fine for now.
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.