Skip to content
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
13 changes: 8 additions & 5 deletions backend/controller/evaluation_router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import List, Union

from constants.common_constants import CommonConstants
from fastapi import APIRouter, Path, Query
Expand All @@ -9,7 +9,10 @@
EvaluationOut,
EvaluationPatch,
)
from model.evaluations.evaluations_constants import EvaluationQuestionType
from model.evaluations.evaluations_constants import (
EvaluationQuestionType,
PyconEvaluationQuestionType,
)
from usecase.evaluation_usecase import EvaluationUsecase

evaluation_router = APIRouter()
Expand Down Expand Up @@ -69,7 +72,7 @@ def get_evaluations(
)
def get_evaluations_by_question(
event_id: str = Path(..., title='Event Id', alias=CommonConstants.EVENT_ID),
question: EvaluationQuestionType = Path(..., title='Question'),
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Path(..., title='Question'),
):
"""Get Evaluation Entries by Question

Expand Down Expand Up @@ -106,7 +109,7 @@ def get_evaluations_by_question(
def get_evaluation(
event_id: str = Path(..., title='Event Id', alias=CommonConstants.EVENT_ID),
registration_id: str = Path(..., title='Registration Id', alias=CommonConstants.REGISTRATION_ID),
question: EvaluationQuestionType = Query(..., title='Question'),
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Query(..., title='Question'),
):
"""Get Evaluation Entry

Expand Down Expand Up @@ -180,7 +183,7 @@ def update_evaluation(
evaluation: EvaluationPatch,
event_id: str = Path(..., title='Event Id', alias=CommonConstants.EVENT_ID),
registration_id: str = Query(..., title='Registration Id'),
question: EvaluationQuestionType = Query(..., title='Question'),
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Query(..., title='Question'),
):
"""Update Evaluation Entry

Expand Down
10 changes: 7 additions & 3 deletions backend/model/evaluations/evaluation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import os
from datetime import datetime
from typing import List
from typing import List, Union

from model.evaluations.evaluations_constants import EvaluationQuestionType, QuestionType
from model.evaluations.evaluations_constants import (
EvaluationQuestionType,
PyconEvaluationQuestionType,
QuestionType,
)
from model.registrations.registration import RegistrationPreviewOut
from pydantic import BaseModel, Extra, Field
from pynamodb.attributes import (
Expand Down Expand Up @@ -71,7 +75,7 @@ class EvaluationIn(EvaluationPatch):
class Config:
extra = Extra.forbid

question: EvaluationQuestionType = Field(None, title='Question')
question: Union[EvaluationQuestionType, PyconEvaluationQuestionType] = Field(None, title='Question')


class EvaluationListIn(BaseModel):
Expand Down
31 changes: 31 additions & 0 deletions backend/model/evaluations/evaluations_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,37 @@ class EvaluationQuestionType(str, Enum):
NOTIFIED_OF_FUTURE_EVENTS = 'notified_of_future_events'


class PyconEvaluationQuestionType(str, Enum):
HOW_WOULD_YOU_RATE_PYCON_DAVAO_OVERALL = 'how_would_you_rate_pycon_davao_overall'
WHAT_WAS_THE_HIGHLIGHT_OF_THE_EVENT_FOR_YOU = 'what_was_the_highlight_of_the_event_for_you'
IS_THERE_ANYTHING_SPECIFIC_YOU_WOULD_LIKE_TO_COMMEND_ABOUT_THE_EVENT = (
'is_there_anything_specific_you_would_like_to_commend_about_the_event'
)
HOW_SATISFIED_WERE_YOU_WITH_THE_CONTENT_AND_PRESENTATIONS = (
'how_satisfied_were_you_with_the_content_and_presentations'
)
WHICH_SESSIONS_OR_TOPICS_DID_YOU_FIND_MOST_VALUABLE = 'which_sessions_or_topics_did_you_find_most_valuable'
WERE_THERE_ANY_TOPICS_OR_SESSIONS_YOU_FELT_WERE_MISSING = 'were_there_any_topics_or_sessions_you_felt_were_missing'
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'
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'
HOW_WOULD_YOU_RATE_EVENT_ORGANIZATION_AND_LOGISTICS = 'how_would_you_rate_event_organization_and_logistics'
WERE_THE_EVENT_SCHEDULE_AND_TIMING_CONVENIENT_FOR_YOU = 'were_the_event_schedule_and_timing_convenient_for_you'
WERE_THE_VENUE_FACILITIES_ADEQUATE = 'were_the_venue_facilities_adequate'
DID_YOU_ENCOUNTER_ANY_PROBLEMS_WITH_THE_ORGANIZATION_AND_LOGISTICS = (
'did_you_encounter_any_problems_with_the_organization_and_logistics'
)
DID_YOU_FIND_OPPORTUNITIES_FOR_NETWORKING_VALUABLE = 'did_you_find_opportunities_for_networking_valuable'
HOW_WOULD_YOU_RATE_THE_NETWORKING_OPPORTUNITIES_PROVIDED = (
'how_would_you_rate_the_networking_opportunities_provided'
)
WHAT_COULD_HAVE_BEEN_IMPROVED_RELATED_TO_THE_NETWORKING = (
'what_could_have_been_improved_related_to_the_networking_and_interaction_aspects_of_the_event'
)
SUGGESTIONS_FOR_IMPROVING_FUTURE_PYCON_EVENTS = 'what_suggestions_do_you_have_for_improving_future_pycon_events'
ADDITIONAL_COMMENTS = 'is_there_anything_else_you_would_like_to_share_about_your_experience_at_the_event'
LIKELIHOOD_OF_ATTENDING_FUTURE_PYCON_DAVAO_EVENTS = 'how_likely_are_you_to_attend_future_pycon_davao_events'


class QuestionType(str, Enum):
MULTIPLE_CHOICE = 'multiple_choice'
TEXT = 'text'
Expand Down