Skip to content

Commit ed15f0b

Browse files
jlorionASPactores
authored andcommitted
feat(evaluations): add new questions and fix endpoints to accept pycon specific questions
1 parent e2e21e8 commit ed15f0b

3 files changed

Lines changed: 57 additions & 8 deletions

File tree

backend/controller/evaluation_router.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List
1+
from typing import List, Union
22

33
from constants.common_constants import CommonConstants
44
from fastapi import APIRouter, Path, Query
@@ -9,7 +9,10 @@
99
EvaluationOut,
1010
EvaluationPatch,
1111
)
12-
from model.evaluations.evaluations_constants import EvaluationQuestionType
12+
from model.evaluations.evaluations_constants import (
13+
EvaluationQuestionType,
14+
PyconEvaluationQuestionType,
15+
)
1316
from usecase.evaluation_usecase import EvaluationUsecase
1417

1518
evaluation_router = APIRouter()
@@ -69,7 +72,7 @@ def get_evaluations(
6972
)
7073
def get_evaluations_by_question(
7174
event_id: str = Path(..., title='Event Id', alias=CommonConstants.EVENT_ID),
72-
question: EvaluationQuestionType = Path(..., title='Question'),
75+
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Path(..., title='Question'),
7376
):
7477
"""Get Evaluation Entries by Question
7578
@@ -106,7 +109,7 @@ def get_evaluations_by_question(
106109
def get_evaluation(
107110
event_id: str = Path(..., title='Event Id', alias=CommonConstants.EVENT_ID),
108111
registration_id: str = Path(..., title='Registration Id', alias=CommonConstants.REGISTRATION_ID),
109-
question: EvaluationQuestionType = Query(..., title='Question'),
112+
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Query(..., title='Question'),
110113
):
111114
"""Get Evaluation Entry
112115
@@ -180,7 +183,7 @@ def update_evaluation(
180183
evaluation: EvaluationPatch,
181184
event_id: str = Path(..., title='Event Id', alias=CommonConstants.EVENT_ID),
182185
registration_id: str = Query(..., title='Registration Id'),
183-
question: EvaluationQuestionType = Query(..., title='Question'),
186+
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Query(..., title='Question'),
184187
):
185188
"""Update Evaluation Entry
186189

backend/model/evaluations/evaluation.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import os
22
from datetime import datetime
3-
from typing import List
3+
from typing import List, Union
44

5-
from model.evaluations.evaluations_constants import EvaluationQuestionType, QuestionType
5+
from model.evaluations.evaluations_constants import (
6+
EvaluationQuestionType,
7+
PyconEvaluationQuestionType,
8+
QuestionType,
9+
)
610
from model.registrations.registration import RegistrationPreviewOut
711
from pydantic import BaseModel, Extra, Field
812
from pynamodb.attributes import (
@@ -71,7 +75,7 @@ class EvaluationIn(EvaluationPatch):
7175
class Config:
7276
extra = Extra.forbid
7377

74-
question: EvaluationQuestionType = Field(None, title='Question')
78+
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Field(None, title='Question')
7579

7680

7781
class EvaluationListIn(BaseModel):

backend/model/evaluations/evaluations_constants.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,48 @@ class EvaluationQuestionType(str, Enum):
1414
NOTIFIED_OF_FUTURE_EVENTS = 'notified_of_future_events'
1515

1616

17+
class PyconEvaluationQuestionType(str, Enum):
18+
HOW_WOULD_YOU_RATE_PYCON_DAVAO_OVERALL = 'how_would_you_rate_pycon_davao_overall' # (1-5)
19+
WhAT_WAS_THE_HIGHLIGHT_OF_THE_EVENT_FOR_YOU = 'what_was_the_highlight_of_the_event_for_you' # Text
20+
IS_THERE_ANYTHING_SPECIFIC_YOU_WOULD_LIKE_TO_COMMEND_ABOUT_THE_EVENT = (
21+
'is_there_anything_specific_you_would_like_to_commend_about_the_event' # Text
22+
)
23+
HOW_SATISFIED_WERE_YOU_WITH_THE_CONTENT_AND_PRESENTATIONS = (
24+
'how_satisfied_were_you_with_the_content_and_presentations' # (1-5)
25+
)
26+
WHICH_SESSIONS_OR_TOPICS_DID_YOU_FIND_MOST_VALUABLE = 'which_sessions_or_topics_did_you_find_most_valuable' # Text
27+
WERE_THERE_ANY_TOPICS_OR_SESSIONS_YOU_FELT_WERE_MISSING = (
28+
'were_there_any_topics_or_sessions_you_felt_were_missing' # Text
29+
)
30+
HAVE_YOU_ATTENDED_PYTHON_EVENTS_BEFORE = 'have_you_attended_python_events_before_if_so_what_kind_of_community_support_did_you_find_helpful_in_previous_events' # Text
31+
HOW_LIKELY_ARE_YOU_TO_RECOMMEND_THIS_EVENT = 'how_likely_are_you_to_recommend_this_event_to_other_python_developers_or_enthusiasts_based_on_the_community_support_provided' # (1-5)
32+
# Organization and Logistics
33+
HOW_WOULD_YOU_RATE_EVENT_ORGANIZATION_AND_LOGISTICS = 'how_would_you_rate_event_organization_and_logistics' # (1-5)
34+
WERE_THE_EVENT_SCHEDULE_AND_TIMING_CONVENIENT_FOR_YOU = (
35+
'were_the_event_schedule_and_timing_convenient_for_you' # (1-5)
36+
)
37+
WERE_THE_VENUE_FACILITIES_ADEQUATE = 'were_the_venue_facilities_adequate' # (1-5)
38+
DID_YOU_ENCOUNTER_ANY_PROBLEMS_WITH_THE_ORGANIZATION_AND_LOGISTICS = (
39+
'did_you_encounter_any_problems_with_the_organization_and_logistics' # Text
40+
)
41+
# Networking and Interaction
42+
DID_YOU_FIND_OPPORTUNITIES_FOR_NETWORKING_VALUABLE = 'did_you_find_opportunities_for_networking_valuable' # (1-5)
43+
HOW_WOULD_YOU_RATE_THE_NETWORKING_OPPORTUNITIES_PROVIDED = (
44+
'how_would_you_rate_the_networking_opportunities_provided' # (1-5)
45+
)
46+
WHAT_COULD_HAVE_BEEN_IMPROVED_RELATED_TO_THE_NETWORKING = (
47+
'what_could_have_been_improved_related_to_the_networking_and_interaction_aspects_of_the_event' # Text
48+
)
49+
# Suggestions and Improvements
50+
SUGGESTIONS_FOR_IMPROVING_FUTURE_PYCON_EVENTS = (
51+
'what_suggestions_do_you_have_for_improving_future_pycon_events' # Text
52+
)
53+
ADDITIONAL_COMMENTS = 'is_there_anything_else_you_would_like_to_share_about_your_experience_at_the_event' # Text
54+
LIKELIHOOD_OF_ATTENDING_FUTURE_PYCON_DAVAO_EVENTS = (
55+
'how_likely_are_you_to_attend_future_pycon_davao_events' # (1-5)
56+
)
57+
58+
1759
class QuestionType(str, Enum):
1860
MULTIPLE_CHOICE = 'multiple_choice'
1961
TEXT = 'text'

0 commit comments

Comments
 (0)