Challenge Overview

Project Overview

www.verigames.com is a gaming community website, the games perform formal verification of software, “Formal Verification of a Software” is a process that checks that software is free from flaws that can make it operate improperly or vulnerable to misuse.

Challenge Overview

We have a UI prototype for a new page, the goal of this challenge is to implement this page we call "Achievements" as outlined below. This page will display leaderboards and achievements of CSFV games players.

Challenge Requirements

You are addressing the following in this challenge :

  • You are updating csfv_frontend_module in this challenge.

  • Pages to be implemented in the UI prototype:

  • Routes :

    • /achievements - access the achievements page.

    • /achievements/data - to load data via ajax.

  • Frontend Changes :

    • Add new menu item 'Achievements' to the navigation menu.

    • The page will have multiple tabs, each tab represents a game, the content below the tab will be changed according to selected/active tab.

    • The tab bar will contains 10 games entries. You need to show that in your solution.

    • By default, when accessing /achievements page the first tab will be active.

    • The user name and photo will be displayed for logged in user. Widgets content of the active tab will be loaded via ajax.

    • We are implementing two widgets in achievement page :

      • Top Leaderboard

      • My Awards widgets

    • The two widgets content should be loaded via ajax after the page loaded.

    • Top Leaderboard widget
       Screenshot 2015-04-19 15.01.40.png

      • Rename widget title to "Rankings"

      • This widget load players scores under active game tab, sorted by top performers.

      • Logged in user can view her score at header of the widget.

      • Clicking view more will retrieve more data via ajax.

    • My Award widget

      • Rename widget title to "Achievements"

      • The widget load player badges under selected game, sorted by earned date.

      • Replace "My Award: Chondrite Complete" with "My Achievements" link when clicking on it will reload the widget via ajax with achievements of the logged in user.

        • "My Achievements" should be toggled to "All Achievements" link so user can switch back and forth between her achievements and all achievements.

      • Hovering over badge icon should display the badge name.

      • Clicking view more will retrieve more data via ajax.

    • The bottom three widgets already implemented, view home page view and controller to understand how to add them to the page.

    • Implement filtering at top right corner, the options should be limited to "Today, last 7 days, this month, last month, this year, all time", we have input field to the search methods to filter the result by dates. You can refer to the gaming api documentation to understand how to use it.

  • Backend changes :

    • Add new controller to csfv_frontend_module :

      • Name it : Achievements.js

      • It will have two methods:

        • A method to render the achievements page.

          • It serves /achievements route

          • The method will retrieve CMS posts of all games to be displayed in achievements page.

          • Render the achievements view.

        • And another method to serve ajax requests from that page.

          • It serves /achievements/data route

          • The method will return game data based on input parameters (logic described in next points).

      • Fetching cms posts :

        • You will fetch the CMS posts using cmsPostService#search where the search criteria parameter will be retrieved from configuration.

        • There will be one CMS Post for each game.

        • In each retrieved cms post :

          • cmsPost#title will be the game name to be displayed in the games tabs bar.

          • cmsPost#id this will be passed to frontend along with other data to be used in ajax methods to fetch game specific information.

          • Put the retrieved data into an array and pass it to frontend when rendering the achievements page.

      • /achievements/data method :

        • Input parameters :

          • postId (requried) : represents the cms post id of the game to retrieve it’s information.

          • pullMyAwards (optional) boolean: represents a flag whether or not to retrieve user’s awards.

          • startDate date (optional): represents start date to filter data.

          • endDate date (optional) : represents the end date to filter data.

          • offset number (optional) : represents page number for pagination. set to 0 by default.

        • Fetch the CMS posts using same logic as in “Fetching cms posts” section above with difference that we only pull a single cms post.

          • From retrieved cms post, we need to read cmsPost#metadata array to get the game info:

        • Retrieve the game scores :

          • API call {{game_api_link}}/api/scores/aggregate?{{query_string}}.

          • {{query_string}} parameters :

            • gameId : set from the cms post metadata

            • aggregateType : SUM

            • parameter.name : score

            • sortType : descending

            • pageIndex : Use passed in offset

            • pageSize : 10

            • reportedOn.type : BETWEEN_DATES

            • reportedOn.firstDate : use startDate parameter

            • reportedOn.secondDate : use endDate parameter

          • Using each returned user, retrieve the user object. This is needed to render username and photo in frontend.

        • If there is a user session then we retrieve user current score:

          • API call {{game_api_link}}/api/scores/aggregate?{{query_string}}.

          • {{query_string}} parameters :

            • gameId : set from the cms post metadata

            • aggregateType : SUM

            • parameter.name : score

            • playerIds[] : logged user id

            • reportedOn.type : BETWEEN_DATES

            • reportedOn.firstDate : use startDate parameter

            • reportedOn.secondDate : use endDate parameter

        • Retrieve the game achievements :

          • Api call {{game_api_link}}/api/achievements/search/player?{{query_string}

          • {{query_string}} parameters:

            • achievementType : BADGE

            • gameId : set from the cms post metadata

            • date.type : BETWEEN_DATES

            • date.firstDate : use startDate parameter

            • date.secondDate : use endDate parameter

            • sortType : descending

            • pageIndex : Use passed in offset

            • pageSize : 10

            • playerIds[0] : logged in user id (if pullMyAwards flag is present and equal to true)

          • Using each returned user, retrieve the user object. This is needed to render username and photo in frontend.

          • For each achievement returned return the achievement metadata information :

            • API call {{game_api_link}}/api/achievements?{{query_string}}

            • {{query_string}} parameter:

              • achievementsIds : array of achievement ids we need to pull it’s information.

        • Put the required data by frontend view in json and return the response.

General Information

  • Provide test data for the new page. You are expected to update csfv_test_data_generator.

  • You need to show how you can host multiple games api. Each gaming api will have it’s own database and data.

Documentation Provided

  • UI Prototype provided in challenge forums.

  • The deployemnt guide of the CSFV websites and game api can be found in the github private repos, in README file. Ask questions in challenge forums. if you have troubles deploying the websites.

Source Code

Source code exists in private github repo https://github.com/topcoderinc/

If you get 404 then you need permission to access it. Request it in challenge forums, copilot will add you to the repository and you should receive email about you being added to github. Post your *github* account name when requesting access.

 



Final Submission Guidelines

Submission Deliverables

Below is an overview of the deliverables:

  • Patch file of changes.

  • Detailed document about structure of CMS posts and metadata, and configuration needed by the page.

  • Deployment document with verification screens for reviewers.

  • Updated csfv_test_data_generator module if needed.

  • Updated nodejs_sitemap_generator module to include new route.

Final Submission

For each member, the final submission should be uploaded to the Online Review Tool.

 

ELIGIBLE EVENTS:

2015 topcoder Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30047601