Topcoder Challenge API - Support Marathon Match Detail Requirements Transformation In Detail API

Key Information

Register
Submit
The challenge is finished.

Challenge Overview

We are expecting to return the detail requirement from challenge detail API for marathon matches, which is shown http://community.topcoder.com/longcontest/?module=ViewProblemStatement&compid=64279&rd=17179

There is a special transfomation when rendering the page, you can check https://github.com/topcoder-platform/tc-website/blob/dev/src/main/com/topcoder/web/tc/view/hs/problemStatement.jsp

Scope

The purpose of this challenge is to get the detailRequirement field properly populated and transformed for marathon matches so we can show it similar https://github.com/topcoder-platform/tc-website/blob/dev/src/main/com/topcoder/web/codinginterface/longcontest/view/problemStatement.jsp

Basically, 

1. The change should be based on mm-features branch of challenge service
1. Only apply the following logic when the subTrack is `MARATHON_MATCH`.
2. Define DAO methods to get the required information similar as https://github.com/topcoder-platform/tc-website/blob/dev/src/main/com/topcoder/web/codinginterface/longcontest/controller/request/ViewProblemStatement.java
2. 1 the major info is languageId and problem, etc
2.2 keep in mind, in the future, we will are going to move this logic into https://github.com/topcoder-platform/tc-elasticsearch-feeder-service/ (except the rendering based on the language logic), so be sure to make this logic isolated. 
2.3 so in your implementation, first, check if the detailRequirements field can be get from the ES Index, and the data is valid to render, otherwise use DAO methods to get it.

3. the HTML generation is similar as https://github.com/topcoder-platform/tc-website/blob/dev/src/main/com/topcoder/web/common/tag/ProblemStatementTag.java, and put in detailedRequirements field in response. (this logic will be always kept in challenge detail API).
3.1 since the rendered HTML are mostly same for same language, please use some cache it for some period, so we don't need to re-generate it for the same language.

Local Setup

1. Following https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app to run all dependent services
1.1 you need to build from the latest code of direct app (see https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app#build-and-run-with-docker-compose)
1.2 also the elasticsearch service should be up, run like (docker-compose up -d elasticsearch)
2. Run the elasticsearch feeder service using mm-features branch, you probably should change the ports (8080, 8081 in src/main/resources/elasticsearch-feeder-service.yaml) due to port conflict.
3. Create some challenges through direct app, so the elasticsearch feeder will get the data populated into elasticsearch and they will be used by challenge service.

Final Submission Guidelines

- Code Changes based on mm-features branch of challenge service
- Setup and Verification Steps

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30066174