top of page

Adding Groups

The first page in the Adverse Impact calculator helps the user with the input of data.

Add group.png

Challenges

A list of some challenges we faced with this page.

Creating responsive steps

step code.png

The event triggered by inputting the group total

While inputting the data it gets checked multiple times. Once while inputting, and again when saving it. The first numbers check returns a tuple with two booleans:

  • The first item in the tuple tells us if the overall check was good by returning as true. If that's the case the number gets added to the group. If it's false the warning is customized with item 2.

  • If item 2 in the tuple is true then the number is zero. And a warning stating the number can't be zero is shown. If it's false the number was negative or decimal. Prompting a warning about negative or decimal input. 

​

After the initial check VisibilityControl() is called. In this function we wrote code that checked if all the data of the current group is correct. if it's correct, steps 2 and 2a are made visible. Otherwise they're reset and made invisible.

​

In later versions we added two quality of life changes. The first is an automatic scroll action when the total input is completed. Reducing the need for the user to scroll down. A second improvement was with the unknown switch. In earlier versions an activated switch would prevent the user of inputting a total number. Even prompting an alert pop up. After tester feedback this was changed. Now when a user inputs something, when the unknown switch is activated, it gets deactivated and the number is accepted.

​

​

Customizing alerts

Alertbuilder code.png

One of the functions callable from the alertbuilder class

We wanted to customize our alerts. A different warning needed to be shown when inputting an incorrect number, than when leaving a page. We even wanted to make our alerts dynamic: A user deleting a specific group would be shown that group's name in the alert.

​

To reach this we made cases for each alert we wanted to display. These cases were gathered in a class we made AlertBuilder.cs. To help us keep the code clean we opted to make it a separate class. This also had the added effect it could easily be called from different pages.

​

Within the AlertBuilder class the function WarningBuilder() was written. This function accepts a variable, such as a group name, to customize the string it returns. This string can the be given to an Alertdisplay. Creating dynamic messages for the user.

​

​

bottom of page