Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1back-end | Aif not is_valid_token(token): return 401 | |
| 2SELECT * FROM students WHERE studentId = 1 | BA back-end database query that retrieves one student's stored record | |
| 3Business logic on the back-end applies the rules of the system before data is saved | CThe server side of a system that processes requests, applies business rules and stores data, hidden from the user | |
| 4A server-side security check verifies the user's login on the back-end instead of trusting the front-end | Dif quantity > stock: reject_order() | |
| 5Back-end code runs in the user's browser so the user can see and edit it | EThe back-end runs on the server and is hidden from the user. It is the front-end code that runs in the browser and can be seen. | |
| 6Only check the price in the front-end form. The back-end can trust it. | FThe back-end must never trust data from the front-end. It must run its own server-side checks because a user can change front-end data. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
back-end — The server side of a system that processes requests, applies business rules and stores data in databases, hidden from the user. The front-end displays results.@app.route("/login", methods=["POST"])
def login():
return check_user(request.form)rows = db.execute("SELECT * FROM students")if quantity > stock:
return "Out of stock"if not user.is_logged_in:
return "Access denied", 403db.execute(sql, values)
db.commit()