Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Challenge API update #174

Merged
merged 3 commits into from
Apr 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions actions/challenges.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved.
*
* @version 1.18
* @version 1.19
* @author Sky_, mekanizumu, TCSASSEMBLER, freegod, Ghost_141, kurtrips, xjtufreeman, ecnu_haozi, hesibo, LazyChild
* @changes from 1.0
* merged with Member Registration API
Expand Down Expand Up @@ -44,6 +44,8 @@
* add API for submitting to design challenge
* changes in 1.18:
* add clientSelection flag in studio results
* changes in 1.19:
* add new allowed sort columns.
*/
"use strict";
/*jslint stupid: true, unparam: true, continue: true */
Expand Down Expand Up @@ -90,7 +92,8 @@ var ALLOWABLE_QUERY_PARAMETER = [
*/
var ALLOWABLE_SORT_COLUMN = [
"challengeName", "challengeType", "challengeId", "cmcTaskId", "registrationEndDate",
"submissionEndDate", "finalFixEndDate", "prize1", "currentStatus", "digitalRunPoints"
"submissionEndDate", "finalFixEndDate", "prize1", "currentStatus", "digitalRunPoints",
"postingDate", "numSubmissions", "numRegistrants", "currentPhaseRemainingTime", "currentPhaseName", "registrationOpen"
];

/**
Expand Down Expand Up @@ -357,7 +360,8 @@ function transferResult(src, helper) {
digitalRunPoints: row.digital_run_points,
prize: [],
reliabilityBonus: helper.getReliabilityBonus(row.prize1),
challengeCommunity: row.is_studio ? 'design' : 'develop'
challengeCommunity: row.is_studio ? 'design' : 'develop',
registrationOpen: row.registration_open
});

for (i = 1; i < 10; i = i + 1) {
Expand Down
8 changes: 7 additions & 1 deletion initializers/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ var apiName2dbNameMap = {
numberofsubmissions: 'number_of_submissions',
numberofreviewpositionsavailable: 'number_of_review_positions_available',
round2scheduledstartdate: 'round_2_scheduled_start_date',
round1scheduledstartdate: 'round_1_scheduled_start_date'
round1scheduledstartdate: 'round_1_scheduled_start_date',
postingdate: 'posting_date',
numsubmissions: 'num_submissions',
numregistrants: 'num_registrants',
currentphaseremainingtime: 'current_phase_remaining_time',
currentphasename: 'current_phase_name',
registrationopen: 'registration_open'
};

/**
Expand Down
1 change: 1 addition & 0 deletions queries/search_software_studio_challenges
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ FIRST @pageSize@
, (SELECT event_short_desc from event e where e.event_id = nvl((SELECT max(event_id) from contest_project_xref x, contest c where project_id = p.project_id and c.contest_id = x.contest_id), 0)) as event_name
, technology_list(pi1.value) AS technology
, platform_list(p.project_id) as platforms
, CASE WHEN (pp1.phase_status_id = 2) THEN 'Yes' ELSE 'No' END AS registration_open
FROM project p
, project_status_lu pstatus
, project_phase pp1 --registration phase
Expand Down