jquery-bracket icon indicating copy to clipboard operation
jquery-bracket copied to clipboard

How to mark 'no result' from match?

Open kamilwylegala opened this issue 6 years ago • 9 comments

Hello!

Is it possible to not provide result from match?

E.g. there is situation where both players get disqualified so no one move forward in bracket. It means opponent from other side of bracket will have BYE match.

Is it possible to indicate something like that using your plugin?

Thanks in advance!

kamilwylegala avatar Mar 05 '18 21:03 kamilwylegala

It's not currently possible to flag forfeit/disqualification/default. Workaround is just give e.g. 1-0 win for the team that should proceed, which might or might not be a problem depending on your system.

teijo avatar Mar 05 '18 22:03 teijo

I could contribute and create PR for that. Any idea how to approach this? How API should look like to support this?

E.g.

Results:
[
 [
   [1,0], //winner goes to final round alone
   [null, null] //no result available, both disqualified
 ],
 [
   [1, 0] // obvious winner?
 ]
]

kamilwylegala avatar Mar 07 '18 11:03 kamilwylegala

null is problematic as that's currently indicating that the match is not yet played or the score is not input, i.e. that result should not affect the propagation of teams. This might require bringing a new more extensible score type into play, as currently only number | null is used.

For example something like this:

{
  type: "pass",
  reason: "Disqualified"
}

Current functionality should be possible to be represented too with this "object score" approach:

{
  type: "number",
  score: 2
}

Additionally there could be a custom type for user-defined scores (in this demo you could have custom 3-round score that would be calculated in way you'd define in a scoring function):

{
  type: "user",
  value: [2,3,0]
}

For best TypeScript utilization, there should be a common enumerated field in the score object for distinguishing the different variations, including the built-in types and the user-extensible type. In this case it's the type field.

Better support for something like this is actually being worked currently in a feature branch to have proper typing - using generics - for custom scores and team definitions (which already exists as a feature).

teijo avatar Mar 07 '18 13:03 teijo

Thanks for detailed response.

Yes, it totally makes sense to have result object.

What is the progress in branch you mentioned? Can I support you somehow?

kamilwylegala avatar Mar 12 '18 22:03 kamilwylegala

What is the progress in branch you mentioned? Can I support you somehow?

Merged the stuff to master now. The generics are not exposed from the library yet but used internally.

teijo avatar Mar 18 '18 19:03 teijo

See my solution (for wordpress) on https://github.com/teijo/jquery-bracket/issues/147

millhoff avatar May 21 '18 20:05 millhoff

@millhoff

How does it relate?

Isn't your solution about different spacing in score boxes?

kamilwylegala avatar May 26 '18 13:05 kamilwylegala

It’s a bit more than that as I created a short code which does allow you to specify the result as e.g 6:3,6:4. Or 0:6,6:4,7:6. It will make sure that the winner is the one who wins the last set and it also deals with the possible 0 at the beginning.

But it is only for WordPress and so far it has no DB or other features.

Cheers

Thorsten

Sent from my iPad

On 26 May 2018, at 14:05, Kamil Wylegala [email protected] wrote:

@millhoff

How does it relate?

Isn't your solution about different spacing in score boxes?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

millhoff avatar May 26 '18 13:05 millhoff

Hi, I'm also facing the same situation where both competitors did not appear for the match and got disqualified. If possible, I don't want to randomly select either one to be winner. Is there any solution or workaround for this case?

Slasher154 avatar Jun 28 '18 06:06 Slasher154