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

Commit 27c6dec

Browse files
author
ykohata
committed
Merge branch 'technology-2014-09-25'
2 parents d182ae7 + 0c968b8 commit 27c6dec

File tree

7 files changed

+16
-127
lines changed

7 files changed

+16
-127
lines changed

actions/challenges.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved.
33
*
4-
* @version 1.30
4+
* @version 1.31
55
* @author Sky_, mekanizumu, TCSASSEMBLER, freegod, Ghost_141, kurtrips, xjtufreeman, ecnu_haozi, hesibo, LazyChild,
66
* @author isv, muzehyun, bugbuka
77
* @changes from 1.0
@@ -77,6 +77,8 @@
7777
* - Fixed existing errors report by jsLint tool.
7878
* Changes in 1.30:
7979
* - Update challenge type filter.
80+
* Changes in 1.31:
81+
* - Remove screeningScorecardId and reviewScorecardId from search challenges api.
8082
*/
8183
"use strict";
8284
/*jslint stupid: true, unparam: true, continue: true */
@@ -721,12 +723,6 @@ function transferResultV2(src, helper) {
721723
if (!_.isUndefined(challenge.forumId)) {
722724
challenge.forumId = Number(challenge.forumId);
723725
}
724-
if (!_.isUndefined(challenge.screeningScorecardId)) {
725-
challenge.screeningScorecardId = Number(challenge.screeningScorecardId);
726-
}
727-
if (!_.isUndefined(challenge.reviewScorecardId)) {
728-
challenge.reviewScorecardId = Number(challenge.reviewScorecardId);
729-
}
730726
if (!challenge.isStudio) {
731727
delete challenge.submissionsViewable;
732728
}
@@ -1598,7 +1594,7 @@ var uploadForDevelopChallenge = function (api, connection, dbConnectionMap, next
15981594
//Note 2 - this will also cover the case of private challenges
15991595
//User will have role Submitter only if the user belongs to group of private challenge and is registered.
16001596
if (!rows[0].is_user_submitter_for_challenge) {
1601-
cb(new ForbiddenError('You cannot submit for this challenge as you are not a Submitter.'));
1597+
cb(new ForbiddenError('You cannot submit for this challenge as you are not a submitter.'));
16021598
return;
16031599
}
16041600

@@ -2488,14 +2484,15 @@ exports.getChallenge = {
24882484
transaction: 'read', // this action is read-only
24892485
databases: ["tcs_catalog", "tcs_dw"],
24902486
run: function (api, connection, next) {
2491-
var error = api.helper.checkIdParameter(connection.params.challengeId, "challengeId");
2487+
var challengeId = Number(connection.params.challengeId),
2488+
error = api.helper.checkIdParameter(challengeId, "challengeId");
24922489

24932490
if (error) {
24942491
api.helper.handleError(api, connection, new NotFoundError("Challenge Id Not Valid."));
24952492
next(connection, true);
24962493
} else if (connection.dbConnectionMap) {
24972494
api.log("Execute getChallenge#run", 'debug');
2498-
api.dataAccess.executeQuery('check_challenge_exists', {challengeId: connection.params.challengeId}, connection.dbConnectionMap, function (err, result) {
2495+
api.dataAccess.executeQuery('check_challenge_exists', {challengeId: challengeId}, connection.dbConnectionMap, function (err, result) {
24992496
if (err) {
25002497
api.helper.handleError(api, connection, err);
25012498
next(connection, true);

apiary.apib

Lines changed: 8 additions & 54 deletions
Large diffs are not rendered by default.

config/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ exports.default = {
2828
// disables the whitelisting of client params
2929
disableParamScrubbing: false,
3030
// params you would like hidden from any logs
31-
filteredParams: ['password', 'oldPassword', 'newPassword'],
31+
filteredParams: ['password', 'oldPassword', 'newPassword', 'fileData'],
3232
// The default filetype to server when a user requests a directory
3333
directoryFileType : 'index.html',
3434
// configuration for your actionhero project structure

queries/get_active_challenges

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ SELECT
33
, pcl.description AS challenge_type
44
, pn.value AS challenge_name
55
, p.project_id AS challenge_id
6-
, pc3.parameter AS screening_scorecard_id
7-
, pc4.parameter AS review_scorecard_id
86
, pi4.value AS forum_id
97
, (SELECT COUNT(*) FROM submission s1 INNER JOIN upload u1 ON s1.upload_id = u1.upload_id
108
WHERE u1.project_id = p.project_id
@@ -38,10 +36,6 @@ FROM project p
3836
, project_phase pp1 --registration phase
3937
, project_phase pp2 --submission phase
4038
, outer project_phase pp15 --checkpoint submission phase
41-
, outer ( project_phase pp3 --screening phase
42-
, outer phase_criteria pc3 ) --screening phase scorecard
43-
, outer ( project_phase pp4 --review phase
44-
, outer phase_criteria pc4) --review phase scorecard
4539
, project_info pn
4640
, outer project_info pidr
4741
, outer project_phase nd_phase
@@ -57,14 +51,6 @@ AND pp2.project_id = p.project_id
5751
AND pp2.phase_type_id = 2 --submission phase
5852
AND pp15.project_id = p.project_id
5953
AND pp15.phase_type_id = 15 --checkpoint submission phase
60-
AND pp3.project_id = p.project_id
61-
AND pp3.phase_type_id = 3 --screening phase
62-
AND pp3.project_phase_id = pc3.project_phase_id
63-
AND pc3.phase_criteria_type_id = 1 -- scorecardid type
64-
AND pp4.project_id = p.project_id
65-
AND pp4.phase_type_id = 4 --review phase
66-
AND pp4.project_phase_id = pc4.project_phase_id
67-
AND pc4.phase_criteria_type_id = 1 -- scorecardid type
6854
AND pidr.project_id = p.project_id
6955
AND pidr.project_info_type_id = 26 --digital run
7056
AND pi4.project_id = p.project_id

queries/get_open_challenges

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ FIRST @page_size@
55
, pcl.description AS challenge_type
66
, pn.value AS challenge_name
77
, p.project_id AS challenge_id
8-
, pc3.parameter AS screening_scorecard_id
9-
, pc4.parameter AS review_scorecard_id
108
, pi4.value AS forum_id
119
, (SELECT COUNT(*) FROM submission s1 INNER JOIN upload u1 ON s1.upload_id = u1.upload_id
1210
WHERE u1.project_id = p.project_id
@@ -39,10 +37,6 @@ FROM project p
3937
, project_phase pp1 --registration phase
4038
, project_phase pp2 --submission phase
4139
, outer project_phase pp15 --checkpoint submission phase
42-
, outer ( project_phase pp3 --screening phase
43-
, outer phase_criteria pc3 ) --screening phase scorecard
44-
, outer ( project_phase pp4 --review phase
45-
, outer phase_criteria pc4) --review phase scorecard
4640
, project_info pn
4741
, outer project_info pidr
4842
, outer project_phase nd_phase
@@ -58,14 +52,6 @@ AND pp2.project_id = p.project_id
5852
AND pp2.phase_type_id = 2 --submission phase
5953
AND pp15.project_id = p.project_id
6054
AND pp15.phase_type_id = 15 --checkpoint submission phase
61-
AND pp3.project_id = p.project_id
62-
AND pp3.phase_type_id = 3 --screening phase
63-
AND pp3.project_phase_id = pc3.project_phase_id
64-
AND pc3.phase_criteria_type_id = 1 -- scorecardid type
65-
AND pp4.project_id = p.project_id
66-
AND pp4.phase_type_id = 4 --review phase
67-
AND pp4.project_phase_id = pc4.project_phase_id
68-
AND pc4.phase_criteria_type_id = 1 -- scorecardid type
6955
AND pidr.project_id = p.project_id
7056
AND pidr.project_info_type_id = 26 --digital run
7157
AND pi4.project_id = p.project_id

queries/get_past_challenges

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ FIRST @page_size@
55
, pcl.description AS challenge_type
66
, pn.value AS challenge_name
77
, p.project_id AS challenge_id
8-
, screening.parameter AS screening_scorecard_id
9-
, review.parameter AS review_scorecard_id
108
, (SELECT value FROM project_info WHERE project_id = p.project_id AND project_info_type_id = 4) AS forum_id
119
, (SELECT COUNT(*) FROM submission s1 INNER JOIN upload u1 ON s1.upload_id = u1.upload_id
1210
WHERE u1.project_id = p.project_id
@@ -40,24 +38,6 @@ INNER JOIN project_phase pp2 ON pp2.project_id = p.project_id AND pp2.phase_type
4038
INNER JOIN project_info pn ON pn.project_id = p.project_id AND pn.project_info_type_id = 6
4139
INNER JOIN project_info pi1 ON pi1.project_id = p.project_id AND pi1.project_info_type_id = 1
4240
LEFT JOIN project_phase pp15 ON pp15.project_id = p.project_id AND pp15.phase_type_id = 15
43-
LEFT JOIN (
44-
SELECT
45-
pp3.project_id
46-
, pc3.parameter
47-
FROM project_phase pp3
48-
LEFT JOIN phase_criteria pc3 ON pp3.project_phase_id = pc3.project_phase_id
49-
WHERE pp3.phase_type_id = 3
50-
AND pc3.phase_criteria_type_id = 1
51-
) screening ON screening.project_id = p.project_id
52-
LEFT JOIN (
53-
SELECT
54-
pp4.project_id
55-
, pc4.parameter
56-
FROM project_phase pp4
57-
LEFT JOIN phase_criteria pc4 ON pp4.project_phase_id = pc4.project_phase_id
58-
WHERE pp4.phase_type_id = 4
59-
AND pc4.phase_criteria_type_id = 1
60-
) review ON review.project_id = p.project_id
6141
LEFT JOIN project_info pidr ON pidr.project_id = p.project_id AND pidr.project_info_type_id = 26
6242
WHERE
6343
p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11)

queries/get_upcoming_challenges

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ SELECT
33
, pcl.description AS challenge_type
44
, pn.value AS challenge_name
55
, p.project_id AS challenge_id
6-
, pc3.parameter AS screening_scorecard_id
7-
, pc4.parameter AS review_scorecard_id
86
, pi4.value AS forum_id
97
, NVL((SELECT SUM(pr.number_of_submissions) FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 14), 0) AS number_of_checkpoints_prizes
108
, (SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1) AS first_place_prize
@@ -30,10 +28,6 @@ FROM project p
3028
, project_phase pp1 --registration phase
3129
, project_phase pp2 --submission phase
3230
, outer project_phase pp15 --checkpoint submission phase
33-
, outer ( project_phase pp3 --screening phase
34-
, outer phase_criteria pc3 ) --screening phase scorecard
35-
, outer ( project_phase pp4 --review phase
36-
, outer phase_criteria pc4) --review phase scorecard
3731
, project_info pn
3832
, project_info pi32
3933
, outer project_info pidr
@@ -49,14 +43,6 @@ AND pp2.project_id = p.project_id
4943
AND pp2.phase_type_id = 2 --submission phase
5044
AND pp15.project_id = p.project_id
5145
AND pp15.phase_type_id = 15 --checkpoint submission phase
52-
AND pp3.project_id = p.project_id
53-
AND pp3.phase_type_id = 3 --screening phase
54-
AND pp3.project_phase_id = pc3.project_phase_id
55-
AND pc3.phase_criteria_type_id = 1 -- scorecardid type
56-
AND pp4.project_id = p.project_id
57-
AND pp4.phase_type_id = 4 --review phase
58-
AND pp4.project_phase_id = pc4.project_phase_id
59-
AND pc4.phase_criteria_type_id = 1 -- scorecardid type
6046
AND pidr.project_id = p.project_id
6147
AND pidr.project_info_type_id = 26 --digital run
6248
AND pi4.project_id = p.project_id

0 commit comments

Comments
 (0)