discreteoptimization / assignment

Assignments and Graders for Discrete Optimization on Coursera
https://www.coursera.org/learn/discrete-optimization
MIT License
95 stars 81 forks source link

Ask email and token *before* computing #42

Closed pgrandinetti closed 6 years ago

pgrandinetti commented 6 years ago

If the computation is going to be some hours long then I'd rather prefer to enter my email and submission token before to start the computational part, otherwise I need to be sure I come back at the computer to enter email+token before the 5h/10h deadline expires. And if I run it overnight that may be a bit annoying.

ccoffrin commented 6 years ago

Entering the e-mail and token at the end was designed to resolve this issue. The idea is,

  1. start your computation
  2. come back in a couple hours when it is completed
  3. generate a fresh token from the Coursera web interface
  4. finish the submission process with your fresh token Do you see any issue with this workflow?
pgrandinetti commented 6 years ago

the scenario I imagine is

ccoffrin commented 6 years ago

Last I looked into it the token timeout was stated to be around 30 mins (although I have not observed this in practice), which is too short for the assignments where each problem could take a few hours to get 10 points. Also note that the solutions of all problem parts need to be submitted together to get full credit. This is a requirement of the Coursera platform. You might need to run your solver for 6 hours locally and then perform the submission.

pgrandinetti commented 6 years ago

Oh, that's it. I thought the token verification could be done at any moment (for instance, as first step in the submit.py script). If that's not the case than this ticket can be closed :)

ccoffrin commented 6 years ago

Unfortunately not, it all has to be sent to Coursera as a single payload see, https://github.com/discreteoptimization/assignment/blob/master/submit.py#L326

You might give the _credentials file a try, but this will fail if Cousera expires your assignment token.

pgrandinetti commented 6 years ago

I see. Then maybe you could count the total time from the moment the first instance starts till the moment the last instance is completed, and if that is < 10h then let the program waiting for email+token even if they are entered much later?

ccoffrin commented 6 years ago

I don't follow your last comment. The code does all of the computations then it prompts for email+token. It's fine if they are entered much later, as long as the token is still valid in Coursera's system.