Help with developing a QR code self attendance app

I’m working on this QR code self-attendance app as one of my personal projects. So far, I’ve run into some issues concerning how to compare data inputted by user (before uploading the submitted data to Google Sheets that acts as the data base) with pre-existing information on a separate Google sheet. For example, if the user inputs a string of numbers that represents the places ID containing the registered IP address (I’ll address it as “Place ID” variable), then the app searches on the Google Sheet database for the corresponding code and compares it to the user’s inputted data, if it matches then it allows for submission, or else, it clears the field and provides a hint that either the place was not registered in the first place or an incorrect Place ID was inputted.
Also, I need some help on how the application is going to detect the IP address of the place from the device’s Wifi connection, as well as the code for scanning the QR code that will be pasted on the wall of the room, not to mention taking into account the time of scanning of the QR code to determine whether the user was on time, late for more than 10 min or absent (late for more than 50 mins).

For wifi IP try: Taifun’s WIFI Extension

To query Google Sheet try: THIS

Use barcode scanner for the QR Code

If the QR code on the wall identifies the room as well as the class,
why would you need the IP address?

My guess was that a student could photo the QR code first time, then print it out later and user it to scan again when they are “not there”. The IP address / timestamp would give some proof that they were actually there as this data is “hidden” inside the app, and not user managed.