Skip to content

Commit

Permalink
feat(#451): add designer free text type
Browse files Browse the repository at this point in the history
  • Loading branch information
jannis-baum committed Jun 29, 2023
1 parent bca8a40 commit 8514158
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'package:studyu_designer_v2/localization/app_translation.dart';
enum SurveyQuestionType {
choice,
bool,
scale;
scale,
freeText;

static SurveyQuestionType of(Question question) {
final typeMapping = {
Expand All @@ -14,6 +15,7 @@ enum SurveyQuestionType {
ScaleQuestion.questionType: SurveyQuestionType.scale,
AnnotatedScaleQuestion.questionType: SurveyQuestionType.scale,
VisualAnalogueQuestion.questionType: SurveyQuestionType.scale,
FreeTextQuestion.questionType: SurveyQuestionType.freeText,
};
if (!typeMapping.containsKey(question.type)) {
throw UnimplementedError("Missing SurveyQuestionType for question of type: ${question.type}");
Expand Down Expand Up @@ -42,6 +44,8 @@ enum SurveyQuestionType {
return Icons.rule_rounded; // Icons.contrast
case SurveyQuestionType.scale:
return Icons.tune_rounded;
case SurveyQuestionType.freeText:
return Icons.note;
default:
return null;
}
Expand Down
1 change: 1 addition & 0 deletions designer_v2/lib/localization/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"form_field_question_response_options_tooltip": "Definiere welche Optionen zur Beantwortung der Frage in der App verfügbar sind",
"form_field_question_response_options_description": "Wähle die Antwortoptionen so, dass sie zur Frage passen und die von dir gewünschten Daten erhoben werden.",
"question_type_choice": "Multiple-Choice",
"question_type_free_text": "Freitext",
"question_type_bool": "Ja/Nein",
"question_type_scale": "Skala",
"form_array_response_options_bool_yes": "Ja",
Expand Down
1 change: 1 addition & 0 deletions designer_v2/lib/localization/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"form_field_question_response_options_tooltip": "Define the options that participants can answer your question with",
"form_field_question_response_options_description": "Choose the response type that best matches your question and define the response options according to the data you want to collect.",
"question_type_choice": "Multiple choice",
"question_type_free_text": "Free text",
"question_type_bool": "Yes/no",
"question_type_scale": "Scale",
"form_array_response_options_bool_yes": "Yes",
Expand Down

0 comments on commit 8514158

Please sign in to comment.