Open cTheDragons opened 8 years ago
This feature (or any other feature that provides similar data) is important for judging how long a participant has been doing the challenge tasks and/or how quickly they have ticked off the To-Dos.
The user's challenge tasks should have a dateCreated attribute which would be the date they joined the challenge. Might just be a matter of exposing that info.
That would require to load all the tasks for each member
Instead of loading all tasks for each member every time:
dateJoined
field in the user.challenges
schemadateJoined
valuedateJoined
values to the dateCreated
value of the user's challenge's task(s)Unfortunately, it's not that easy. user.challenges
is an Array
of challenge ids. To do what you propose, it'd need to be an Array
of Object
s, which would be a breaking change for any integration that displays a user's challenges.
So, to do what you propose, we'd also have to transform the Array
of Object
s back to an Array
of ids whenever someone requested the user object to maintain backwards compatibility.
Hmmm... I see. What about adding a new field user.challengesDateJoined
(or something more succinct) that maps challenge ids to date strings?
I'd rather not. Probably the best course of action would be to have a new property. Something like user.challengesJoined
that would be an object:
{
'some-challenge-id': {
dateJoined: DATE,
otherProp: 'foo'
},
'some-other-challenge-id': {
dateJoined: DATE,
otherProp: 'foo'
}
}
And then for backwards compatibility, user.challenges
would be computed by looping over it and creating an array of ids.
Is this still a desired fix?
I believe so, unless there's a technical reason that we wouldn't want to do this!
I've updated the labels on this issue.
It should be noted that this information is available in the Challenge Data Tool now
@cTheDragons How does the Challenge Data Tool track this info?
The Challenge Data Tool uses the dates of when the task was created for each user and takes the earliest of when the the challenger joined the challenge.
Closing this for now as Challenge participants can be sorted by join date.
Doh. Alys caught my mistake. 😄
That join date sort is actually the date they joined Habitica. :) Knowing when they joined the challenge is what's needed to accurately judge the participants' progress.
It should be noted that the Challenge Data Tool does show when the task was created for the person. However it not the same as the person join the challenge. (As task may be added throughout the challenge) And as noted earlier you do need to load all the tasks. (Which in the challenge data tool makes sense).
General Info
bc10ec41-4213-4482-bbb8-558e3c3ea8d5 Opera 37.0.2178.43 Windows 8.1 32-bit
Description
In API2, you could determine when a user joined a challenge by the order they appear on the list. Now it is difficult to determine who are the late comers are, without keeping a list outside Habitica.
Thanks