Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old DCI Number Conversion #4

Open
Nightfirecat opened this issue Sep 29, 2014 · 20 comments
Open

Old DCI Number Conversion #4

Nightfirecat opened this issue Sep 29, 2014 · 20 comments

Comments

@Nightfirecat
Copy link
Contributor

Older (smaller) DCI numbers will need to be converted into the new format. Currently don't know the formula to do this, though.

@april
Copy link
Owner

april commented Sep 29, 2014

I'll ask my judge friends to find out how to do the conversion.

@april
Copy link
Owner

april commented Sep 29, 2014

http://pastebin.com/PG59ZsJ7

The process for generating DCI numbers is:

Prepend a zero
Calculate check digit
Prepend that check digit
(and repeat until full length DCI number)

@Nightfirecat
Copy link
Contributor Author

Wow, that's complicated.

On the bright side, it looks like this should be usable to validate ALL DCI numbers - past, present, and future - regardless of length. That's handy.

@april
Copy link
Owner

april commented Sep 29, 2014

Totally! They have the most complicated check digit system I have ever seen. O_o But now can validate all DCI numbers, which is pretty sweet. :)

On Sep 29, 2014, at 4:03 PM, Jordan [email protected] wrote:

Wow, that's complicated.

On the bright side, it looks like this should be usable to validate ALL DCI numbers - past, present, and future - regardless of length. That's handy.


Reply to this email directly or view it on GitHub.

@Nightfirecat
Copy link
Contributor Author

Alrighty, just checking in on this again, since I'm nearly done with the validation methods for #5, and I want to be sure they're all working before implementing the display status and tooltips for the fields.

As I understand this, the code in the pastebin does two things:

  1. Determines if a given DCI number is valid (using sum).
  2. Determines what the next digit for a given number would be for it to be a valid DCI number.

With that in mind, we could effectively break it up into those two parts - one for validation and one for check digit generation?

From there, we can use part 1 to check a given number. If it's an invalid number, the process is to prepend a 0 and use part 2 to get a valid number, and that's it, regardless of length? Or do we repeat that until a 9- or 10-digit number, exactly is reached?

@ChaimW
Copy link
Contributor

ChaimW commented Jun 28, 2017

@Nightfirecat after doing some research, there seem to be 3 kinds of numbers

  1. Older <8 digit numbers - no checksum
  2. Intermediate 8 digit numbers
  3. Current 10 digit numbers
  • conversion from 1 to 2 is prepend zeros to get to 7 digits, then prepend a check digit
  • conversion 2 to 3 is prepend a zero, prepend a check digit

for a 1 you do both steps

@ChaimW
Copy link
Contributor

ChaimW commented Jun 28, 2017

I'm planning to take a shot at it now.

@ChaimW
Copy link
Contributor

ChaimW commented Jul 2, 2017

@Nightfirecat @april

I think I got everything except the wording for the warning message for shorter (older) dci numbers.

Currently: DCI Numbers with less than 8 digits cannot be validated
Previously: Older DCI Numbers cannot be validated
But neither one is quite what I want.

@Nightfirecat
Copy link
Contributor Author

I'm leaning toward wanting this to be a warning (eg. We recommend updating your DCI number to xxx, as it is currently in an old format) rather than a hard-and-fast error. That said, something like this would also be fine in my mind: We recommend updating your DCI number to xxx, as DCI numbers with fewer than 8 digits are in an old format.

@ChaimW
Copy link
Contributor

ChaimW commented Jul 2, 2017

Current behavior is convert and warning.

The issue is that they don't have a checksum, so theoretically they could have an entry error that is another valid number (someone else's) that then gets compounded by doing the conversion process on the wrong number.

With a 8/10 digit number, the checksum can be validated, but with a <8 digit, there is simply no way to check. (unless we can get wizards to give us an api endpoint)

@ChaimW
Copy link
Contributor

ChaimW commented Jul 5, 2017

@Nightfirecat
I really want to say somthin to the effect of We cannot verify that your dci# is valid as it is in an old format. Please double-check and/or use the 8 or 10 digit form of your number.

oh, and to be clear, this is in pr #29

@andyrut
Copy link

andyrut commented Nov 20, 2017

I'd like to see the DCI number validation become optional, like with a checkbox below the DCI number input textbox that reads "Validate my DCI Number", checked by default. Two reasons:

  1. Out of pure vanity, I have a four-digit DCI number that I like to show off and it doesn't need validation. It goes into WER just fine as a four-digit number and I like the ooohs and aaahs from scorekeepers. Plus it's less for them to type.

  2. WER (at least in offline mode, have yet to test it in online mode) doesn't handle the 10-digit DCI number and 4-digit number correctly. If I enter a tournament using the "validated" 10-digit DCI number and then enter another player with the original 4-digit DCI number (supposedly the same player, right?) it actually enters them as two separate players. I can get paired up against myself!

@tooomm
Copy link

tooomm commented Dec 5, 2017

If I understand it correctly there are two steps performed automatically right now:

  • check if entered number is in an expected dci number format (digits + checksum check i guess?)
    • if not and/or too long: print error
    • if too short: convert given number to 10 digits version
      (which allows to validate them because of the included checksum)

We still never know if it is a real or valid DCI number, correct?
It's just checked if it's form/style matches a theoretical real number from wizards?

@ChaimW
Copy link
Contributor

ChaimW commented Dec 5, 2017

@tooomm basically, yes to all

@april
Copy link
Owner

april commented Dec 5, 2017

I'm okay with just validating and warning, without changing the official number in the PDF. Any objections to that?

@ChaimW
Copy link
Contributor

ChaimW commented Dec 5, 2017

Seems reasonable, I can do that in a little bit.

@tooomm
Copy link

tooomm commented Dec 5, 2017

So you prefer to remove the expand to 10 digits "feature" completely? @april
Or do you want to make the conversion an optional selection?

If the second... it could be an expanded warning message instead an option present to everybody next to the DCI field to keep the interface clean - just a huge minority is using the old numbers I would assume:
Your DCI number isn't valid regarding new 10 digits conventions. If you're using an old, shorter number and prefer the new style - (we can convert it for you!) with the last part clickable.
Or any other suitable shorter phrase for the warning. :)

The expanded warning message as alternative was just my first idea, there are other options too, I'm sure.

@Nightfirecat
Copy link
Contributor Author

Closed via #29? Unless we want to change the behavior to "Don't change the number entered, but notify user of the expanded 10-digit number"

@sombreroEnPuntas
Copy link

It's a bit confusing when a user enters an old (short) DCI number and it gets changed with no warning.
Plus, I believe those are still valid even without the expansion to 10 digits.

Would be better to do as @tooomm suggests, make it a button and optionally convert.

@ChaimW
Copy link
Contributor

ChaimW commented Jun 23, 2019

I actually have time now, so I'll probably work on it this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants