What is required and what tips you'd recommend us?



  • So me and my coworker want to build a simple GUI using Qt. We want to build some form of login system that tracks students ID number and the amount of hours they spend in lab. For example, A student will approach a stationary display were they will enter they're 8 digit student ID Number. If the user enter a correct student ID, then it will prompt with a message saying "Login Successful" and after 10 seconds, it will go back to "Login Status" were it will wait upon the new student to enter they're ID. Once the student leaves the lab, they must log out and this time it will present "Log off", this messages are a way for the student to know theyre in and out. Now for the part i find confusing and need help in, how to track student hours? I want each student ID to log when they log in and log out for everyday. I would also like it to perhaps be implemented in an excel sheet saves within the local desktop, so that when were reading to print it for record, we can easily open the excel and print it!

    How can i go about that? As of right now we just need the student ID to connect with they're hours! Eventually i will push towards information such as name, etc. but for now that should be good enough.

    So what do you guys think? what should i use? what tips can help me? is it possible? what extra features will be allowed? I will be posting a github repo in case anyone wants to follow the approach and status. thank you


  • Lifetime Qt Champion

    Hi,

    Sounds like a database powered software that should be integrated in the school's own system. From a hardware point of view, a card reader would probably avoid wrong inputs.

    Without more information about the current software ecosystem you should integrate with it's a bit more complex to suggest ideas.

    Hope it helps



  • [quote author="SGaist" date="1420491404"]Hi,

    Sounds like a database powered software that should be integrated in the school's own system. From a hardware point of view, a card reader would probably avoid wrong inputs.

    Without more information about the current software ecosystem you should integrate with it's a bit more complex to suggest ideas.

    Hope it helps[/quote]

    Is it really that elaborate and difficult to come up with? I would assume i can just save each student ID into a text file, however, that text file eventually will become over cluttered. Regarding database, could i use a simple MySQL? I've never played with it but im sure i can quickly pick it up, the thing is i dont want anything web based, it should all remain local. What would you recommend? Surely my school should have some feature like this but unfortunately it doesnt, and it would be amazing if i accomplish this for two great reasons: 1) improve my C++ programming and 2) extend my portfolio!

    I'm currently coding this in a macbook pro laptop based computer running window 8.1 OS. Idk if you need specific hardware?


  • Lifetime Qt Champion

    Even if you have only a handful of students you'll have quickly a big amount of data so a plain text file is a bad idea.

    MySQL/PostgreSQL/Or even SQLite, up to you.

    What do you mean by local ? Local as in on a computer only or local to your school network ?

    How will you validate that the students are entering a valid id ?



  • [quote author="SGaist" date="1420500300"]Even if you have only a handful of students you'll have quickly a big amount of data so a plain text file is a bad idea.

    MySQL/PostgreSQL/Or even SQLite, up to you.

    What do you mean by local ? Local as in on a computer only or local to your school network ?

    How will you validate that the students are entering a valid id ?[/quote]

    I meant to say local desktop computer. That is a very interesting topic, i personally believe that i might be able to insert numerous of student ID perhaps using a vector or idk. I'm not trying to make to most big time software, i just want a small system that lets me track students. I can see were i can run into some issues with validation as you mention. So what do you think? putting a stop to this project is not an option, so for someone with more skills than i, what is your recommendation and tips?



  • Hi,

    I would suggest install a local database (My choice is PostgreSQL since its free and opensource and I am familiar with it, or MySQL or any other). Then make a table that contains a few columns, like student id, event time and event type. When a student logs in or out insert the event. Then you can use normal SQL queries to get the information for specific students and take the time between login and logout events as the time that the student was logged in. I know you can export the columns in a PostgreSQL to a csv file which you can then import in Excel. Note that this is not Qt related so any help regarding databases should be directed at other forums.

    For help setting up Qt to connect to a database just check the documentation and forums (http://doc.qt.io/qt-5/sql-driver.html).



  • I too would vote for a database. In the long run your life will be much easier because access the data in an ordered format will make reporting much easier.

    For example to get a report for a month you would simply select based on the date range. Something like (not tested)

    @SELECT * FROM <table> WHERE <table>.loginDate>=<startdate> AND <table>.loginDate<=<enddate> ORDER BY <table>loginDate ASCENDING@

    Obviously the values in < table > <startdate> <enddate> need to be replaced with real values and best to use SQL variable substitution but what you would get out of this kind of statement would be a nicely sorted list of all records in the table between the specified dates.

    Normally you don't want to SELECT * either, you probably want to specify the exact fields you want for the report. But simple changes to the SQL query will result in almost an infinite number of outputs.

    The question was raised above about how you plan to validate students. Again having a table would allow you to quickly add new students, look up students to ensure login is ok and remove students that you no longer want in the system.

    MySQL is free, extremely easy to install and use. Sounds like initially you can get started with two tables, one that keeps track of students who are allowed to login, and another table that tracks login/logout.

    But the benefit of an SQL based system is lets say you decide later to add another item to track such as time spent on a specific project. You just either add a new field to your second table or even create an entire new table and start writing project tracking data to that. Nothing gets lost, everything remains in sync and there is usually if designed right, no data translation needed.

    You can use the popular tool phpmyadmin if you have php on your system (which is also easy to install if required) to administer the database. You can create, add tables, edit/delete records using this tool. There are many others that would work as well.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.