Open RayyanDarugar opened 7 months ago
Joshua Thinh Peer assessment: Grading: Rayyan The code shows all requirements that answer each question. The screenshots are very clear in what it is showing and include answering the discussion question at the end.
92%
Rayyan Darugar Data Structures Writeup
Collections
[ ] From VSCode using SQLite3 Editor, show your unique collection/table in database, display rows and columns in the table of the SQLite database.
Shows a database model for the classes in one of our projects Games, TBFT - a fantasy turn based game I developed. This shows all of the classes and their respective health stats, and is used to connect with backend request models for gameplay.
[ ] From VSCode model, show your unique code that was created to initialize table and create test data.
This is the code that creates that SQL model - it initializes the characters with the base stats that I hard coded into them. It does this by defining a short dataset of what we want put in and then feeds that to our defined create function. We later call this in a second database, Current Character, which tracks health and stats as you play.
Lists and Dictionaries
[ ] In VSCode using Debugger, show a list as extracted from database as Python objects.
[ ] In VSCode use Debugger and list, show two distinct example examples of dictionaries, show Keys/Values using debugger.
This debug process shows how as we go along signing up for the game and choosing our character, the inputed information feeds into CurrentCharacter and is shown as an object/dictionary.
APIs and JSON
[ ] In VSCode, show Python API code definition for request and response using GET, POST, UPDATE methods. Discuss algorithmic condition used to direct request to appropriate Python method based on request method.
discussion: directs to the correct python request method via JSON data passed through and the correct frontend post. gets items individually and updates info accordingly. Python API code shown above uses key stat definitions like "health" to track and update individual parts of the character model.
[ ] In VSCode, show algorithmic conditions used to validate data on a POST condition.
The first screenshot shows our fronted algorithms which validate posted data - checking them with a fetch method and returning errors to us if we don't get a status check 200.
[ ] In Postman, show URL request and Body requirements for GET, POST, and UPDATE methods.
[ ] In Postman, show the JSON response data for 200 success conditions on GET, POST, and UPDATE methods.
[ ] In Postman, show the JSON response for error for 400 when missing body on a POST request.
[ ] In Postman, show the JSON response for error for 404 when providing an unknown user ID to a UPDATE request.
Frontend
Chrome inspect shows how create character model finds the requested backend data with a GET function and displays that on the page: here it is the Mage and all of its stats, formatted.
[ ] In JavaScript code, describe fetch and method that obtained the Array of JSON objects.
[ ] In JavaScript code, show code that performs iteration and formatting of data into HTML.
JS Code shows fetch of data and formats it into tables using document.createElements. Formats it by data per column needed and turns that into HTML readable code.
[ ] In the Chrome browser, show a demo (POST or UPDATE) gathering and sending input and receiving a response that show update. Repeat this demo showing both success and failure.
Shows success of login - takes you to game screen and alerts you of the success. Shows failure of login - routes you to 403 error page for incorrect credentials.
[ ] In JavaScript code, show and describe code that handles success. Describe how code shows success to the user in the Chrome Browser screen.
Code, if no errors logging in (checked by seeing what the status method returns by the backend is), routes the user to the game screen where they can play games from our site in Chrome and returns a success message.
[ ] In JavaScript code, show and describe code that handles failure. Describe how the code shows failure to the user in the Chrome Browser screen.