Skip to content

[$80] All SRM challenges are not listed #4875

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

Open
luizrrodrigues opened this issue Sep 8, 2020 · 21 comments
Open

[$80] All SRM challenges are not listed #4875

luizrrodrigues opened this issue Sep 8, 2020 · 21 comments

Comments

@luizrrodrigues
Copy link
Collaborator

image

  1. Open the application and login as TonyJ
  2. Go to https://www.topcoder.com/members/tourist/details/?track=DATA_SCIENCE&subTrack=SRM&tab=Past%20srm
  3. Click Past SRM

Actual: All SRM challenges are not listed

Expected: Should show all 269 challenges

Reproducibility Rate: 3/3

Environment: HP Pavilion x360 14 inch; Windows 10 | Browser: Google Chrome 73.0.3683.75

Context: The work should be done against branch hot-fix-srm-data

IMPORTANT: See full details in original issue: #2213

@luizrrodrigues luizrrodrigues added Member Profiles P1 Urgent (resolve within 24 hours) labels Sep 8, 2020
@luizrrodrigues luizrrodrigues added this to the By 9/17/2020 milestone Sep 8, 2020
@crazyk07
Copy link

crazyk07 commented Sep 8, 2020

Contest https://www.topcoder.com/challenges/30141020 has been created for this ticket.

This is an automated message for crazyk via Topcoder X

@cagdas001 cagdas001 self-assigned this Sep 8, 2020
@crazyk07
Copy link

crazyk07 commented Sep 8, 2020

Contest https://www.topcoder.com/challenges/30141020 has been updated - it has been assigned to cagdas001.

This is an automated message for crazyk via Topcoder X

@luizrrodrigues
Copy link
Collaborator Author

@topcoder-platform/topcodercompetitors @topcoder-platform/tcxcommunity this is open for pickup

Submit in 8 hours and PR to

https://github.com/topcoder-platform/community-app/tree/milestone-20200917
https://github.com/topcoder-platform/topcoder-react-lib/tree/milestone-20200917

run npm run test before PR

@luizrrodrigues
Copy link
Collaborator Author

@cagdas001 Thanks for join on this.

Please make sure to see whole history here: #2213

@cagdas001
Copy link
Collaborator

@luizrrodrigues it calls old APIs, will they be replaced by V5?

@luizrrodrigues
Copy link
Collaborator Author

@cagdas001 Yes, if not available in v5, please let me know.

@luizrrodrigues
Copy link
Collaborator Author

@cagdas001 Any progress on this?

@cagdas001
Copy link
Collaborator

cagdas001 commented Sep 9, 2020

The code looks at these fields:

const roundId = challenge.rounds.length ? challenge.rounds[0].id : 0;
const codingEndAt = challenge.rounds.length ? challenge.rounds[0].codingEndAt : '2000-01-01T00:00:00.000Z';
const finalPoints = _.get(challenge.rounds, '0.userSRMDetails.finalPoints') || 0;
const division = _.get(challenge.rounds, '0.userSRMDetails.division') || 0;
const divisionPlacement = _.get(challenge.rounds, '0.userSRMDetails.divisionPlacement') || 0;
const roomPlacement = _.get(challenge.rounds, '0.userSRMDetails.roomPlacement') || 0;
...

The current call:
https://api.topcoder.com/v4/members/tourist/srms/?filter=status%3Dpast%26isRatedForSRM%3Dtrue&limit=36&offset=0

which returns

...
            {
                "id": 17420,
                "name": "TCO19 SRM 752",
                "type": null,
                "status": "PAST",
                "startDate": "2019-03-04T13:54:00.000Z",
                "endDate": "2019-03-04T13:54:00.000Z",
                "track": "DATA_SCIENCE",
                "subTrack": "SRM",
                "numRegistrants": [
                    349
                ],
                "userIds": [...],
                "handles": null,
                "rounds": [
                    {
                        "id": 17420,
                        "registrationStartAt": "2019-03-05T12:00:00.000Z",
                        "registrationEndAt": "2019-03-06T11:55:00.000Z",
                        "codingStartAt": "2019-03-06T12:00:00.000Z",
                        "codingEndAt": "2019-03-06T13:15:00.000Z",
                        "systemTestStartAt": "2019-03-06T13:35:00.000Z",
                        "systemTestEndAt": "2019-03-06T13:35:00.000Z",
                        "status": "PAST",
                        "forumId": null
                    }
                ]
            },
...

doesn't have userSRMDetails that contains all these necessary information like score placement etc

V5 equivalent of this call:
https://api.topcoder.com/v5/members/tourist/stats/history which doesnt return some necessary fields too.

        "DATA_SCIENCE": {
            "SRM": {
                "history": [
                    {
                        "challengeId": 10709,
                        "challengeName": "SRM 352",
                        "date": 1180742400000,
                        "rating": 1867,
                        "placement": 387,
                        "percentile": 92.9904
                    },
            ...

Score, divison, room are the missing fields in V5. Not sure if percentile is the score, if so, then the missing fields are division, room

@luizrrodrigues
Copy link
Collaborator Author

Thanks @cagdas001 , let me check with API team.

@luizrrodrigues
Copy link
Collaborator Author

@Oanh-and-only-Oanh
Copy link

@cagdas001, please provide status update.

@cagdas001
Copy link
Collaborator

@cagdas001, please provide status update.

any update? @luizrrodrigues @urwithat

@luizrrodrigues
Copy link
Collaborator Author

@Oanh-and-only-Oanh We need help with member-aip here. #4875 (comment)

@urwithat
Copy link
Contributor

@cagdas001, @luizrrodrigues -

Would not suggest using "https://api.topcoder.com/v5/members/tourist/stats/history" as an alternative to "https://api.topcoder.com/v4/members/tourist/srms/?filter=status%3Dpast%26isRatedForSRM%3Dtrue&limit=36&offset=0"
The purpose and meaning of both APIs are divergent.

@Oanh-and-only-Oanh - I'm not sure of an alternative API for this, will enquire and get back.

@mtwomey
Copy link
Contributor

mtwomey commented Sep 17, 2020

This should live in v5-challenge-api. I don't think it's there at present though, so we may need to stick with the older APIs until this part gets figured out. @rootelement please correct me if I've mis-stated this.

@rootelement
Copy link
Contributor

@mtwomey is correct. I'll have to find what ES index houses this information and bring it over to v5.

@Oanh-and-only-Oanh
Copy link

@rootelement, how long do you think it'll take to bring it over to v5? I'm trying to understand if it's worth waiting for v5 if it's quick or if @cagdas001 should move forward with resolving it in the interim with the older apis.

@Oanh-and-only-Oanh Oanh-and-only-Oanh changed the title [$50] All SRM challenges are not listed [$80] All SRM challenges are not listed Sep 17, 2020
@luizrrodrigues
Copy link
Collaborator Author

@cagdas001 Any update on this one?

@Oanh-and-only-Oanh Oanh-and-only-Oanh modified the milestones: By 9/24/2020, Release by 10/1/2020 Sep 23, 2020
@Oanh-and-only-Oanh
Copy link

@cagdas001, please update us.

@cagdas001
Copy link
Collaborator

@Oanh-and-only-Oanh waiting for update from @rootelement . See above comments

@rootelement
Copy link
Contributor

We need to leave the old SRMs to the old apis for now. Please log this as tech debt on the community app. I have an issue open on the challenge-api side to do this, but this is of lower importance than the Work Manager release, so I won't get to it until later this week at the earliest.

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

No branches or pull requests

7 participants