Commit 6c032ff6 authored by Bernardo Lucas Almeida Sunderhus's avatar Bernardo Lucas Almeida Sunderhus Committed by bernardosunderhus

[API] Adiciona rotas ao Competifier e refatora rotas de Ranking do Admin

parent 3e11a351
...@@ -523,11 +523,11 @@ paths: ...@@ -523,11 +523,11 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
'/phases/{phaseId}/rankings': '/phases/{phaseId}/ranking':
get: get:
tags: tags:
- phases - phases
summary: Retrieves all Rankings for the Phase summary: Retrieves the last Ranking for the Phase
responses: responses:
'200': '200':
description: '' description: ''
...@@ -536,62 +536,24 @@ paths: ...@@ -536,62 +536,24 @@ paths:
schema: schema:
type: array type: array
items: items:
$ref: '#/components/schemas/Ranking' $ref: '#/components/schemas/Rank'
post: # post:
tags: # tags:
- phases # - phases
summary: Creates a new Ranking for the Phase # summary: Creates a new Ranking for the Phase
requestBody: # requestBody:
content: # content:
application/json: # application/json:
schema: # schema:
$ref: '#/components/schemas/Ranking' # $ref: '#/components/schemas/Ranking'
required: true # required: true
responses: # responses:
'200': # '200':
description: '' # description: ''
content: # content:
application/json: # application/json:
schema: # schema:
$ref: '#/components/schemas/Ranking' # $ref: '#/components/schemas/Ranking'
parameters:
- name: phaseId
in: path
required: true
schema:
format: int32
type: integer
'/phases/{phaseId}/rankings/{rankingId}':
get:
tags:
- phases
summary: Retrieves the specific Ranking
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Ranking'
patch:
tags:
- phases
summary: Updates the specific Ranking
requestBody:
content:
application/json-patch+json:
schema:
type: array
items:
$ref: '#/components/schemas/JsonPatch'
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Ranking'
parameters: parameters:
- name: phaseId - name: phaseId
in: path in: path
...@@ -599,12 +561,50 @@ paths: ...@@ -599,12 +561,50 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
- name: rankingId # '/phases/{phaseId}/rankings/{rankingId}':
in: path # get:
required: true # tags:
schema: # - phases
format: int32 # summary: Retrieves the specific Ranking
type: integer # responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Ranking'
# patch:
# tags:
# - phases
# summary: Updates the specific Ranking
# requestBody:
# content:
# application/json-patch+json:
# schema:
# type: array
# items:
# $ref: '#/components/schemas/JsonPatch'
# required: true
# responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Ranking'
# parameters:
# - name: phaseId
# in: path
# required: true
# schema:
# format: int32
# type: integer
# - name: rankingId
# in: path
# required: true
# schema:
# format: int32
# type: integer
'/phases/{phaseId}/participations': '/phases/{phaseId}/participations':
get: get:
tags: tags:
...@@ -1156,8 +1156,6 @@ components: ...@@ -1156,8 +1156,6 @@ components:
$ref: './schemas/Phase.yaml/#/EvaluationRule' $ref: './schemas/Phase.yaml/#/EvaluationRule'
TieBreakCriteria: TieBreakCriteria:
$ref: './schemas/Phase.yaml/#/TieBreakCriteria' $ref: './schemas/Phase.yaml/#/TieBreakCriteria'
Ranking:
$ref: './schemas/Phase.yaml/#/Ranking'
Rank: Rank:
$ref: './schemas/Phase.yaml/#/Rank' $ref: './schemas/Phase.yaml/#/Rank'
SubscriptionRule: SubscriptionRule:
......
...@@ -62,7 +62,6 @@ paths: ...@@ -62,7 +62,6 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
/preferences: {}
/assessments: /assessments:
get: get:
tags: tags:
...@@ -100,25 +99,6 @@ paths: ...@@ -100,25 +99,6 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
'/assessments/{assessmentId}/evaluation':
get:
tags:
- assessments
summary: Retrives an Assessment evaluation
responses:
'200':
description: Successfully retrieved assessment evaluation
content:
application/json:
schema:
type: object
parameters:
- name: assessmentId
in: path
required: true
schema:
format: int32
type: integer
'/assessments/{assessmentId}/submissions': '/assessments/{assessmentId}/submissions':
get: get:
tags: tags:
...@@ -403,6 +383,24 @@ paths: ...@@ -403,6 +383,24 @@ paths:
oneOf: oneOf:
- $ref: '#/components/schemas/HandmadeAssessmentSubmission' - $ref: '#/components/schemas/HandmadeAssessmentSubmission'
- $ref: '#/components/schemas/VirtualAssessmentSubmission' - $ref: '#/components/schemas/VirtualAssessmentSubmission'
'/assessments/{assessmentId}/evaluation':
get:
tags:
- assessments
summary: Retrieves the Assessment Submission Evaluation.
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/AssessmentSubmissionEvaluation'
parameters:
- name: assessmentId
in: path
required: true
schema:
type: integer
/competifier: /competifier:
get: get:
tags: tags:
...@@ -492,111 +490,167 @@ paths: ...@@ -492,111 +490,167 @@ paths:
get: get:
tags: tags:
- phases - phases
summary: Retrives all phases summary: Retrieves all phases
responses: responses:
'200': '200':
description: '' description: ''
content: content:
application/json: application/json:
schema: schema:
type: object type: array
items:
$ref: '#/components/schemas/Phase'
'/phases/{phaseId}':
get:
tags:
- phases
summary: Retrieves a specific phase
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Phase'
parameters:
- name: phaseId
in: path
required: true
schema:
type: integer
'/phases/{phaseId}/ranking':
get:
tags:
- phases
summary: Retrieves the last ranking of a given Phase
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Rank'
parameters:
- name: phaseId
in: path
required: true
schema:
type: integer
'/phases/{phaseId}/ranking/me':
get:
tags:
- phases
summary: Retrieves the Competifier's Rank
responses:
'200':
description: 'Must return the Classification Rule, the Evaluation Rule and evaluations.'
content:
application/json:
schema:
$ref: '#/components/schemas/Rank'
parameters:
- name: phaseId
in: path
required: true
schema:
type: integer
components: components:
schemas: schemas:
ScheduledEvent: ScheduledEvent:
$ref: './schemas/Assessment.yaml/#/ScheduledEvent' $ref: './schemas/Assessment.yaml#/ScheduledEvent'
Assessment: Assessment:
$ref: './schemas/Assessment.yaml/#/Assessment' $ref: './schemas/Assessment.yaml#/Assessment'
VirtualAssessment: VirtualAssessment:
$ref: './schemas/Assessment.yaml/#/VirtualAssessment' $ref: './schemas/Assessment.yaml#/VirtualAssessment'
HandmadeAssessment: HandmadeAssessment:
$ref: './schemas/Assessment.yaml/#/HandmadeAssessment' $ref: './schemas/Assessment.yaml#/HandmadeAssessment'
AssessmentEvent: AssessmentEvent:
$ref: './schemas/Assessment.yaml/#/AssessmentEvent' $ref: './schemas/Assessment.yaml#/AssessmentEvent'
QuestionGroup: QuestionGroup:
$ref: './schemas/Exam.yaml/#/QuestionGroup' $ref: './schemas/Exam.yaml#/QuestionGroup'
QuestionStatement: QuestionStatement:
$ref: './schemas/Exam.yaml/#/QuestionStatement' $ref: './schemas/Exam.yaml#/QuestionStatement'
Question: Question:
$ref: './schemas/Exam.yaml/#/Question' $ref: './schemas/Exam.yaml#/Question'
SubjectiveQuestion: SubjectiveQuestion:
$ref: './schemas/Exam.yaml/#/SubjectiveQuestion' $ref: './schemas/Exam.yaml#/SubjectiveQuestion'
ObjectiveQuestion: ObjectiveQuestion:
$ref: './schemas/Exam.yaml/#/ObjectiveQuestion' $ref: './schemas/Exam.yaml#/ObjectiveQuestion'
ExamCover: ExamCover:
$ref: './schemas/Exam.yaml/#/ExamCover' $ref: './schemas/Exam.yaml#/ExamCover'
Exam: Exam:
$ref: './schemas/Exam.yaml/#/Exam' $ref: './schemas/Exam.yaml#/Exam'
Alternative: Alternative:
$ref: './schemas/Exam.yaml/#/Alternative' $ref: './schemas/Exam.yaml#/Alternative'
ExamQuestionComplaint: ExamQuestionComplaint:
$ref: './schemas/Exam.yaml/#/ExamQuestionComplaint' $ref: './schemas/Exam.yaml#/ExamQuestionComplaint'
AssessmentSubmission: AssessmentSubmission:
$ref: './schemas/Submission.yaml/#/AssessmentSubmission' $ref: './schemas/Submission.yaml#/AssessmentSubmission'
HandmadeAssessmentSubmission: HandmadeAssessmentSubmission:
$ref: './schemas/Submission.yaml/#/HandmadeAssessmentSubmission' $ref: './schemas/Submission.yaml#/HandmadeAssessmentSubmission'
VirtualAssessmentSubmission: VirtualAssessmentSubmission:
$ref: './schemas/Submission.yaml/#/VirtualAssessmentSubmission' $ref: './schemas/Submission.yaml#/VirtualAssessmentSubmission'
Answer: Answer:
$ref: './schemas/Submission.yaml/#/Answer' $ref: './schemas/Submission.yaml#/Answer'
AssessmentSubmissionEvaluation: AssessmentSubmissionEvaluation:
$ref: './schemas/Submission.yaml/#/AssessmentSubmissionEvaluation' $ref: './schemas/Submission.yaml#/AssessmentSubmissionEvaluation'
AnswerGrade: AnswerGrade:
$ref: './schemas/Submission.yaml/#/AnswerGrade' $ref: './schemas/Submission.yaml#/AnswerGrade'
VirtualAssessmentSubmissionDraft: VirtualAssessmentSubmissionDraft:
$ref: './schemas/Submission.yaml/#/VirtualAssessmentSubmissionDraft' $ref: './schemas/Submission.yaml#/VirtualAssessmentSubmissionDraft'
Competifier: Competifier:
$ref: './schemas/Competifier.yaml/#/Competifier' $ref: './schemas/Competifier.yaml#/Competifier'
SoloCompetifier: SoloCompetifier:
$ref: './schemas/Competifier.yaml/#/SoloCompetifier' $ref: './schemas/Competifier.yaml#/SoloCompetifier'
TeamCompetifier: TeamCompetifier:
$ref: './schemas/Competifier.yaml/#/TeamCompetifier' $ref: './schemas/Competifier.yaml#/TeamCompetifier'
CompetifierEvent: CompetifierEvent:
$ref: './schemas/Competifier.yaml/#/CompetifierEvent' $ref: './schemas/Competifier.yaml#/CompetifierEvent'
Tag: Tag:
$ref: './schemas/Competifier.yaml/#/Tag' $ref: './schemas/Competifier.yaml#/Tag'
Participant: Participant:
$ref: './schemas/Competifier.yaml/#/Participant' $ref: './schemas/Competifier.yaml#/Participant'
Message: Message:
$ref: './schemas/Competifier.yaml/#/Message' $ref: './schemas/Competifier.yaml#/Message'
JsonPatch: JsonPatch:
$ref: './schemas/JsonPatch.yaml' $ref: './schemas/JsonPatch.yaml'
Competition: Competition:
$ref: './schemas/Phase.yaml/#/Competition' $ref: './schemas/Phase.yaml#/Competition'
Phase: Phase:
$ref: './schemas/Phase.yaml/#/Phase' $ref: './schemas/Phase.yaml#/Phase'
PhaseEvent: PhaseEvent:
$ref: './schemas/Phase.yaml/#/PhaseEvent' $ref: './schemas/Phase.yaml#/PhaseEvent'
PhaseParticipation: PhaseParticipation:
$ref: './schemas/Phase.yaml/#/PhaseParticipation' $ref: './schemas/Phase.yaml#/PhaseParticipation'
BestRanked: BestRanked:
$ref: './schemas/Phase.yaml/#/BestRanked' $ref: './schemas/Phase.yaml#/BestRanked'
MinimumPerformance: MinimumPerformance:
$ref: './schemas/Phase.yaml/#/MinimumPerformance' $ref: './schemas/Phase.yaml#/MinimumPerformance'
ClassificationRule: ClassificationRule:
$ref: './schemas/Phase.yaml/#/ClassificationRule' $ref: './schemas/Phase.yaml#/ClassificationRule'
EvaluationRule: EvaluationRule:
$ref: './schemas/Phase.yaml/#/EvaluationRule' $ref: './schemas/Phase.yaml#/EvaluationRule'
TieBreakCriteria: TieBreakCriteria:
$ref: './schemas/Phase.yaml/#/TieBreakCriteria' $ref: './schemas/Phase.yaml#/TieBreakCriteria'
Ranking:
$ref: './schemas/Phase.yaml/#/Ranking'
Rank: Rank:
$ref: './schemas/Phase.yaml/#/Rank' $ref: './schemas/Phase.yaml#/Rank'
SubscriptionRule: SubscriptionRule:
$ref: './schemas/Subscription.yaml/#/SubscriptionRule' $ref: './schemas/Subscription.yaml#/SubscriptionRule'
Subscription: Subscription:
$ref: './schemas/Subscription.yaml/#/Subscription' $ref: './schemas/Subscription.yaml#/Subscription'
SoloSubscription: SoloSubscription:
$ref: './schemas/Subscription.yaml/#/SoloSubscription' $ref: './schemas/Subscription.yaml#/SoloSubscription'
TeamSubscription: TeamSubscription:
$ref: './schemas/Subscription.yaml/#/TeamSubscription' $ref: './schemas/Subscription.yaml#/TeamSubscription'
FormTemplate: FormTemplate:
$ref: './schemas/Subscription.yaml/#/FormTemplate' $ref: './schemas/Subscription.yaml#/FormTemplate'
FormField: FormField:
$ref: './schemas/Subscription.yaml/#/FormField' $ref: './schemas/Subscription.yaml#/FormField'
FormAnswer: FormAnswer:
$ref: './schemas/Subscription.yaml/#/FormAnswer' $ref: './schemas/Subscription.yaml#/FormAnswer'
FormSection: FormSection:
$ref: './schemas/Subscription.yaml/#/FormSection' $ref: './schemas/Subscription.yaml#/FormSection'
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"start": "concurrently \"npm run start:files\" \"npm run start:editor\"", "start": "concurrently \"npm run start:files\" \"npm run start:editor\"",
"start:editor": "http-server ./node_modules/swagger-editor-dist -p 3000", "start:editor": "live-server ./node_modules/swagger-editor-dist --port=3000 --no-browser",
"start:files": "http-server . -p 3001" "start:files": "live-server . --no-browser --port=3001"
}, },
"dependencies": { "dependencies": {
"concurrently": "^3.5.1", "concurrently": "^3.5.1",
"http-server": "^0.11.1", "live-server": "^1.2.0",
"swagger-editor-dist": "^3.5.5" "swagger-editor-dist": "^3.5.5"
} }
} }
...@@ -37,7 +37,7 @@ Assessment: ...@@ -37,7 +37,7 @@ Assessment:
description: Why the fuck is this a string? description: Why the fuck is this a string?
type: string type: string
exam: exam:
$ref: '../Exam.yaml/#/Exam' $ref: './Exam.yaml#/Exam'
oid: oid:
description: Object identifier description: Object identifier
type: integer type: integer
......
...@@ -7,7 +7,6 @@ Competition: ...@@ -7,7 +7,6 @@ Competition:
name: name:
type: string type: string
oid: oid:
format: int32
type: integer type: integer
subscriptionConf: subscriptionConf:
$ref: '#/SubscriptionRule' $ref: '#/SubscriptionRule'
...@@ -22,13 +21,11 @@ Phase: ...@@ -22,13 +21,11 @@ Phase:
order: order:
type: integer type: integer
type: type:
format: int32 description: {CLASSIFICATORY, FINAL}
type: integer type: integer
status: status:
format: int32
type: integer type: integer
oid: oid:
format: int32
type: integer type: integer
events: events:
type: array type: array
...@@ -46,11 +43,9 @@ PhaseEvent: ...@@ -46,11 +43,9 @@ PhaseEvent:
properties: properties:
timestamp: timestamp:
type: integer type: integer
format: int64
descr: descr:
type: string type: string
type: type:
format: int32
description: '{PHASE_CREATED, PHASE_STARTED, EVALUATION_FORMULA_UPDATED, RANKING_EVALUATED, PHASE_CLOSED}' description: '{PHASE_CREATED, PHASE_STARTED, EVALUATION_FORMULA_UPDATED, RANKING_EVALUATED, PHASE_CLOSED}'
type: integer type: integer
PhaseParticipation: PhaseParticipation:
...@@ -87,10 +82,8 @@ ClassificationRule: ...@@ -87,10 +82,8 @@ ClassificationRule:
- type - type
properties: properties:
oid: oid:
format: int32
type: integer type: integer
type: type:
format: int32
description: '{BEST_RANKED, MINIMUM_PERFORMANCE}' description: '{BEST_RANKED, MINIMUM_PERFORMANCE}'
type: integer type: integer
discriminator: discriminator:
...@@ -103,7 +96,6 @@ EvaluationRule: ...@@ -103,7 +96,6 @@ EvaluationRule:
- expression - expression
properties: properties:
oid: oid:
format: int32
type: integer type: integer
expression: expression:
type: string type: string
...@@ -112,35 +104,22 @@ TieBreakCriteria: ...@@ -112,35 +104,22 @@ TieBreakCriteria:
- type - type
properties: properties:
oid: oid:
format: int32
type: integer type: integer
type: type:
format: int32
type: integer type: integer
Ranking: Rank:
required: required:
- position
- grade
- status
- timestamp - timestamp
- evaluationRule
properties: properties:
timestamp: timestamp:
type: integer type: integer
format: int64 classificationRule:
qualified: $ref: '#/ClassificationRule'
type: array
items:
$ref: '#/Rank'
evaluationRule: evaluationRule:
$ref: '#/EvaluationRule' $ref: '#/EvaluationRule'
positions:
type: array
items:
$ref: '#/Rank'
Rank:
required:
- position
- grade
- status
properties:
position: position:
type: integer type: integer
grade: grade:
...@@ -148,7 +127,7 @@ Rank: ...@@ -148,7 +127,7 @@ Rank:
status: status:
description: '[QUALIFIED, DISQUALIFIED]' description: '[QUALIFIED, DISQUALIFIED]'
type: integer type: integer
assessmentEvaluations: evaluations:
type: array type: array
items: items:
$ref: '#/AssessmentSubmissionEvaluation' $ref: './Submission.yaml#/AssessmentSubmissionEvaluation'
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment