emvecchi commited on
Commit
7c741ef
1 Parent(s): 36758e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -30
app.py CHANGED
@@ -15,7 +15,7 @@ class Field:
15
  title: str
16
  name: str = None
17
  help: Optional[str] = None
18
- children: List['Field'] = None
19
  other_params: Optional[Dict[str, object]] = field(default_factory=lambda: {})
20
 
21
 
@@ -57,43 +57,18 @@ fields: List[Field] = [
57
  Field(type="container", title="**Moderation Function**", children=[
58
  Field(name="mod_function", type="multiselect",
59
  title="**What type of moderation function is needed here?** (Multiple selection possible)"),
 
60
  ]),
61
 
62
 
63
- #Field(type="expander",
64
- # title="Expand and fill-out this section if you see **issues in the original comment**",
65
- # children=[
66
- # Field(name="issues_in_comment", type="slider",
67
- # title="Do **you see some issues** in the original comment?"),
68
- # Field(name="moderator_spotted", type="slider",
69
- # title="Based on the reply, has the **moderator spotted the issues** in the original comment?"),
70
- # Field(name="reply_addresses_issues", type="slider",
71
- # title="How well does the reply **address those issues**?")
72
- # ]),
73
-
74
- #Field(type="container", title="**Score the following properties of the moderator comment?**", children=[
75
- # Field(name="neutrality", type="slider", title="Neutrality",
76
- # help='Remain Neutral on the topic and on the Comment Substance and Commenter’s Viewpoint. The reply shouldn’t give away the opinion of the moderator on the topic or comment. '),
77
- # # FieldDict(name="attitude", type="slider", title="Attitude", help=''),
78
- # Field(name="clarity", type="slider", title="Clarity",
79
- # help="Plain language, simple, clear, avoid overwhelming the user e.g. too many questions"),
80
- # Field(name="curiosity", type="slider", title="Curiosity",
81
- # help="Moderators should model a spirit of inquiry and a desire to learn from and understand commenter’s experience and views. Try to be interested in the bases upon which each commenter stakes his or her claims and the lines of reasoning that has led each commenter to those particular conclusions."),
82
- # # TODO
83
- # Field(name="bias", type="slider", title="Bias",
84
- # help="Does the reply show some biases towards the commenter? Are there stereotypes or prejudices?"),
85
- # Field(name="encouraging", type="slider", title="Encouraging",
86
- # help="Welcoming, encouraging and acknowledging. Avoid Evaluative and/or Condescending Responses"),
87
- #]),
88
- #
89
  Field(name="other_comments", type="text", title="Further comments: (free text)"),
90
  ]
91
- INPUT_FIELD_DEFAULT_VALUES = {'slider': 3,
92
  'text': None,
93
  'textarea': None,
94
  'checkbox': False,
95
  'radio': False,
96
- 'select_slider': 0,
97
  'multiselect': None}
98
  SHOW_HELP_ICON = False
99
 
@@ -193,7 +168,7 @@ def show_field(f: Field, index: int):
193
  choices = default_choices if not f.other_params.get('choices') else f.other_params.get('choices')
194
  st.session_state.data_inputs[f.name] = st.multiselect(f.title,
195
  options = choices,
196
- key=key,
197
  help=f.help)
198
  case 'text':
199
  st.session_state.data_inputs[f.name] = st.text_input(f.title, key=key, value=value)
 
15
  title: str
16
  name: str = None
17
  help: Optional[str] = None
18
+ children: Optional[List['Field']] = None
19
  other_params: Optional[Dict[str, object]] = field(default_factory=lambda: {})
20
 
21
 
 
57
  Field(type="container", title="**Moderation Function**", children=[
58
  Field(name="mod_function", type="multiselect",
59
  title="**What type of moderation function is needed here?** (Multiple selection possible)"),
60
+ Field(name="mod_function_other", type="text", title="*If Other, please specify:*"),
61
  ]),
62
 
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  Field(name="other_comments", type="text", title="Further comments: (free text)"),
65
  ]
66
+ INPUT_FIELD_DEFAULT_VALUES = {'slider': 0,
67
  'text': None,
68
  'textarea': None,
69
  'checkbox': False,
70
  'radio': False,
71
+ 'select_slider': 50,
72
  'multiselect': None}
73
  SHOW_HELP_ICON = False
74
 
 
168
  choices = default_choices if not f.other_params.get('choices') else f.other_params.get('choices')
169
  st.session_state.data_inputs[f.name] = st.multiselect(f.title,
170
  options = choices,
171
+ key=key, max_selections=3
172
  help=f.help)
173
  case 'text':
174
  st.session_state.data_inputs[f.name] = st.text_input(f.title, key=key, value=value)