Please enable JavaScript.
Coggle requires JavaScript to display documents.
Coding for user interactions - Coggle Diagram
Coding for user interactions
Communicating effectively with the user
- It is important for the developer to generate code to display information through users hardware devices. As there is many devices, it can be helpful to identify one single popular hardware device and search for more from there.
Presenting information to the user
Majority of user interactions in tech contexts is via a screen or other type of display
Basic layout of display could be created with a generic template or user interface design tool.
Layout:
Consistent and uncluttered
Clearly identifiable menus, buttons and output fields
Developer should consider which parts of the layout will be used to communicate information or error feedback to user
Waiting for user input
- Computers never wait, they are constantly processing millions of instructions per second. There are a number of ways to program a computer to wait:
Input Loops
- The computer asks for input and sets a time. The computer checks if the input is received after the timer in an infinite loop until input is received or the user quits the program.
Event Handlers
- Function is connected to the event, the code will only run when the event occurs. For example, a mouse click, timer tick, a change to a valued of a field on a web form. Called adding an event listener or event driven program.
Input Sequence
- The computer will check millions of timer per second waiting until the user input is received, otherwise the computer will not run the next command in the program.
Processing user input
- Users responds with an input which is stored in computer memory. Errors should be checked and handled. All user inputs should be converted to a digital format before they can be stored.
Providing user to feedback
- It is important for users to receive feedback of their responses. This could be achieved through error messages, sounds and colour alerts.
Validating User data
- Data validation is important to reduce possibility of human error. Data verifications attempts to assure correctly formatted and accurate stored data.
Preventing user input errors
Clear instructions:
Describe the expected format of data. For example to input date of birth, it should be clear if the format is dd/mm/yyyy or mm/dd/yyyy.
Instructions should be easily understood by users - non-technical language, and should be tested that these instructions were clearly understood.
Input Constaints
:
To ensure a valid option is selected, provide limited options
-Eg. drop down box, radio buttons or calendar widget.
Proofreading
:
Confirmation screens - encourage users to check and confirm their inputs. Opportunity for users to undo/redo and improve a user's feeling of control.
Double entry
:
Requiring users to verify inputs twice to check for inconsistencies.
Validating user input
- Providing immediate feedback to the user about their data entries to give an opportunity to correct data to meet the correct format requirements.
Missing Input
: Test if the field is required but empty. Eg, HTML5
required
or [fieldname]!='' ''
Length
: Test if text input is the expected length. Eg. A Member ID has a specific number of characters.
Range
: Test if numeric input is in the expected range. For example, a high school has an age range of between 11 and 18.
Allowed list
: Check if the value entered appears in a list of expected values, such as days of the week or states of a country.
Data Patterns
: Use a regular expression to test if the input matches a specific person.
Check digit
: Barcodes, ISBNs and Credit Cards include a check digit which can be used to ensure a card has been successfully scanned.
Verifying user input
- Its still possible, even after verification checks for user inputs to be incorrect
Confirmation Codes - Sent through SMS or mobile to verify data entered by user
Lookups - Using an SQL Query to verify a user exists in a database. Using the SELECT method.