Leading 0 in group number

Issue #108 new
John J. Camilleri created an issue

In URLs, group numbers < 10 do not have a leading 0, e.g. https://xdat09.ce.chalmers.se/2016/lp3/afp/admin/labs/1/submissions/group6. When downloading all submissions, folders in the archive for these groups do contain a leading 0, e.g. group06. It is unimportant, but it would be nice these two things matched.

Comments (9)

  1. Víctor López Juan

    So the question is: how many leading zeroes should the group number have? Some courses have less than 10 groups, others may have more than a 100 (e.g. 202 students in pairs). And, even if the total number of groups varies during the existence of the course, we do not want URLs to suddenly become invalid.

    On the other hand, if we remove the leading zeroes in the folder names, they will be sorted awkwardly by some file browsers (i.e. group1, group 10, group, 11, group2, group20, …).

    Do you have a specific solution in mind?

  2. John J. Camilleri reporter

    The awkward sorting is mildly inconvenient, but I don't like the idea of fixing an arbitrary upper limit on the number of groups (9, 99, 999...). So my vote is that we get rid of the leading zeros everywhere.

  3. Gregoire Detrez

    What is the problem with having different strings? do you use a script that needs to link a group to the URL?

  4. John J. Camilleri reporter

    No I don't use a script, it's just that I often type both the URLs and the file paths manually, and I always need to remember when to include a leading 0 or not.

  5. John J. Camilleri reporter

    Ok it's nice that the URLs are flexible. But then what about the downloaded archives? Is the number of leading zeros decided based on the total number of groups? Or is it always 1?

  6. Gregoire Detrez

    I think right now it is at most one, meaning you'll get group03 group33 but group333. I agree that it would be nicer if it was a function of the max. group number.

  7. Log in to comment