Define a native application.
A native application is an application software that is developed for use on a particular platform or device
State 3 advantages of using native applications over web applications.
State 5 disadvantages of using native applications over web applications
Define a web application.
A web application is an application software that runs on a web server and is accessed by a web browser
State 3 advantages of using web applications over native applications. (5 in total)
State 3 disadvantages of using web applications over native applications. (4 in total)
What are the roles of HTML and CSS in creating a web application?
HTML is used to structure the content and give it semantic meaning
CSS is responsible for the design, styling, and layout of the content
How is the GET method and POST method different in sending data? (2 differences)
What is the role of Flask in creating a web application?
Python operates in the background to process user requests and return a response.
When should GET method be used when sending data?
When data is collected in the form of a non-sensitive input
When should POST method be used when sending data?
Mostly used in sending forms, especially when handling file uploads, or sensitive data.
What are the 10 usability principles?
CURVE:
1. Consistency and standards (follow estabished conventions)
2. User control and freedom (allow users to undo and exit easily)
3. Recognistion rather than recall (making options visible)
4. Visibility of system status (keep users informed of wht happening)
5. Error prevention, detection, recognistion and recovery (provide clear error messages)
HAME:
6. Help and documentation (offer useful help if needed)
7. Aesthetic and minimalist design (clean and uncluttered)
8. Match between system and real world (use familar language and concepts)
9. Effeciency and flexibility of use (allow both beginners and experts to use)
What is User Control and Freedom? What is an example of it?
User have the freedom to navigate and perform actions, including undoing accidental actions.
For example, support undo, redo, and cancel (to exit from the current interaction)
What is Flexibility and Efficiency of Use? What is an example of it?
Able to transform itself to suit multiple users, allowing people to pick whatever way that works for them.
Example: Shortcut buttons, personalisation and customisation. May transform itself for novice and advanced users eg. advanced settings.
What are the tags that must be present in an HTML document?
html
head
title
body
What is the minimal code for a Flask app?
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route(…)
def function1():
# retrieve any required request data from request obj
# jinja template files must be in ‘templates’ folder
return render_template(‘index.html’) # replace with appropriate template name
app.run() # by default, runs on 127.0.0.1:5000
The following HTML snippet is used in index.html to capture user input and send it to the ‘/’ route with a GET request:
input type=”text” name=”search”
What is the Python code used to retrieve the data in the route function?
remember to import request first
…
data = request.args[‘search’]
The following HTML snippet is used in index.html to capture user input and send it to the ‘/’ route with a POST request:
input type=”text” name=”search”
What is the Python code used to retrieve the data in the route function?
remember to import request first
…
value = request.form[‘search’]
The following Python code is used to retrieve data from user input sent to the route ‘/profile’:
@app.route(‘/profile’, methods=[“POST”])
def search():
value = request.form[‘address’]
…
return render_template(‘profile.html’, data=value)
Write the HTML needed to implement this form.
Brainscape does not support HTML, so the angled tag brackets are omitted here
# note that the value attribute of the element determines the label shown on the submit button
form action=’/profile’ method=’post’
input type=’text’ name=’address’
input type=’submit’ value=’Submit’
/form
The following Python code is used to retrieve data from user input sent to the route ‘/search’:
@app.route(‘/search’, methods=[“GET”])
def search():
value = request.args[‘query’]
…
return render_template(‘search.html’, data=value)
Write the HTML needed to implement this form.
Brainscape does not support HTML, so the angled tag brackets are omitted here
# note that the value attribute of the element determines the label shown on the submit button
form action=’/search’ method=’get’
input type=’text’ name=’query’
input type=’submit’ value=’Submit’
/form
Write HTML for a page asking for user input
Brainscape does not support HTML, so the angled tag brackets are omitted here
# note that the value attribute of the element determines the label shown on the submit button
html
head
title
/title
/head
body
form action=’/destination’ method=’get’
label
/label
input type=’text’ name=’name’
input type=’submit’ value=’Submit’
/form
/body
/html
Write HTML for a form with a single text input field and a submit button
Brainscape does not support HTML, so the angled tag brackets are omitted here
# note that the value attribute of the element determines the label shown on the submit button
form action=’/destination’ method=’get’
label
/label
input type=’text’ name=’name’
input type=’submit’ value=’Submit’
/form