PDA

View Full Version : 'Big' QT Project for school



Sicko
1st December 2006, 09:53
Hi, I'm a Belgian student in my Final year, and I need to create a Presences and Absences Program that should help teachers to easily mark who's in class and who's not.
I'm working on it with 1 other guy from my class.
To start off, teachers should login, and they should only be able to access the classes they teach, but they should be able to view other classes, but not edit/delete.


The problem is; We don't know where to start, OR how to even do all the things we have in mind.
We would really appreciate anyone's help, someone to guide us through the whole thing, if possible...

If there's someone out there that is willing to help, please post and I will provide all details about this project.

Thanks,

Mic

munna
1st December 2006, 10:40
You will need a database for this to store all the information about teachers, students, subjects etc.

I think to start off with you can design the database and decided how the User Interface is going to be like. This database will be installed on the server and will be updated by the teachers.

If you use Qt then I think u'll need some kind of agent (client application) deployed on all the computers that the teachers will use to Add, Read, Edit or Update the information.

If you make this web based (no Qt) then teachers can access and edit students information from the browser itself. Teachers will not need to install any application on their system.

I don't have much experience with databases but would like to help you out.

bond007
1st December 2006, 11:46
Hi,

I can think about 2 solutions:
1) Using MySQL server to store data from (Presense Tables). And then using QSqlQueryModel(etc) to work with the tables.
2) Storing data in XML and using a simple form with a table(where you would have the Presense Table)

You can see how it's done by going throught examples in Qt dir.


Good Luck!

Bond007

Conel
1st December 2006, 12:15
I would advice using SQLite database for these purposes. It is included in Qt package and is very simple for usage.

All data is stored in one file and no additional installation for this database is required. All that you will need is to load sql driver (it is in Qt package)

All the info could be found in Qt docs

Mike
1st December 2006, 12:22
I would advice using SQLite database for these purposes. It is included in Qt package and is very simple for usage.

All data is stored in one file and no additional installation for this database is required. All that you will need is to load sql driver (it is in Qt package)

All the info could be found in Qt docs

It may be simple. But what about the requirements. I believe the SQLite database is linked to an application. But how would you implement a distributed scenario? From what it sounds like, they have to support multiple instances of the teachers frontend at the same time. Each one looking at the same data. So to me a real client server architecture would be required, if they do not decide to go web based. If they prefer Qt for this, then they would need something like MySQL as was mentioned before, so that they can access the DB over network.

jacek
1st December 2006, 13:15
1) Using MySQL server
Or PostgreSQL server ;)

Brandybuck
1st December 2006, 19:58
Yes, it depends on the requirements. But since this is a class project, I'll assume it doesn't need to be distributed. In that case sqlite is appropriate. It avoids the whole issue of deployments, which can be intimidating for newbies to the database domain.

wysota
1st December 2006, 22:44
Anyway, what class is it? I think we shouldn't interfere with the actual theme of the class, as it is your task to solve the problem. We can give general hints or provide some code snippets that do some things, but the main problem should be solved by you. I'm sure others agree with that opinion...

gfunk
1st December 2006, 23:32
Sounds like you guys should just figure out the design first. Draw up some diagrams or mockups of what you want your application to look like, and how it should function - how you want the teachers to use it, any complex interactions that they should be able to do. Once you start putting some substance behind your project at a tangible level, things should start to look a little more clearer, and a little less daunting, a little less 'Big'.

Sicko
4th December 2006, 14:40
Thanks for your replies so far.
I'm surprised so many people are showing intrest and are willing to help :).

We're trying to keep it simple at first, that way we can always make it better when our 'QT Skills' improve...

When a teacher logs in, they can select their class, and then all the names of the students show up with tickboxes behind it (unless anyone has a better idea)?
Then there would be 2 tickboxes behind every name, present and absent.
There should also be a button 'All present' or something to automatticly tick all present tickboxes.
Then just a save button to save the changes and the teachers done.
Ofcourse, people are sometimes late, so there should be an 'arrived late' box too, that you can assign a time to.
Well, you know what I mean (I think :p).

sunil.thaha
4th December 2006, 16:49
Would it not be better if you could have a status table which says, Present, Absent, Late arrival, early departure ... ;)


And In the Attendance table have the status id captured against each student ?

Sicko
5th December 2006, 07:25
Would it not be better if you could have a status table which says, Present, Absent, Late arrival, early departure ... ;)


And In the Attendance table have the status id captured against each student ?

That does indeed sound way better.
Do you have any example programs that work that way?

joseph
5th December 2006, 10:20
This is a small smaple ( not fine tuned ) Database architecture.
This is just for giving u a clue ( Not in detail )


Member_type_table
1. pki_
2. type_code ( for distingush Teaher or Student ) ( UNIQUE)
3. remark

eg; pki_ | type_code
----------------------------
1 | TECH
2 | STUD


Status_Table ( for the status like PRESENT/ABSENT/OUT/IN...etc )
1. pki_
2. status_name ( should be UNIQUE )

eg: pki_ | status_name
------------------------------
1 | PRESENT
2 | ABSENT
3 | OUT
4 | IN




Member_table
1. pki_ID ( unique code or number given to teahers as well as students )
2. fki_member_type ( refrence to primary key of Member_type_table )
3. Member_Name

eg: pki_ | fki_member_type | member_name
---------------------------------------------------------------
1 | 1 ( ie; TECH ) | Gadies
2 | 1 | Ros
3 | 2 ( ie; STUD ) | Tom


Attendance_Table
1. pki_attendence
2. fki_member id ( all teachers + sutdents must have ID ) ( reference to Primary Key of Member_table )
3. time_
4. date_
5. fki_status_id ( for the current status ) ( reference to Primary Key of Status_Table )

eg : pki_ | fki_member_id | time_ | date_ | fki_status_id
----------------------------------------------------------------------
1 | 1 ( i; Gladies ) | 1/1/06 | 10.00 | 1 ( ie; PRESENT )
2 | 1 ( i; Gladies ) | 1/1/06 | 12.00 | 3 ( ie; OUT )

------
NB : This Attendance table is not normalised ...U can normalise it as your requirement.


N:B : pki_ means PRIMARY KEY
fki_ means FOREIGN KEY

If u want the attendance in detail split it into different table as u wish.

Good Luck

Sicko
8th December 2006, 10:12
Thanks joseph.

We installed eSVN so we can work on our project without screwing up eachothers work.
More news later..

Sicko
11th December 2006, 13:54
.. bump ..

mm78
15th December 2006, 15:38
I recommend that you split this application in two: a server and a client.

Have the server application listen on a TCP socket for client requests, and handles all the database stuff. You can use SQLite for DB-stuff. Have a look at QTcpServer and QSqlDatabase in the Qt docs. It's not very complicated at all.

The client application is just a simple GUI that communicates with the server (sending requests and receiving and presenting the response to the user). The server is the guy who actually does all the work.

Have a look at the Fortune Server example in the Qt docs to see how to use QTcpServer.

As I said this isn't very complicated, but yet it's close to how it's done for real. You might consider to use a database such as MySql or PostgreSQL, but I'm quite sure SQLite would do just fine for this task. I'd rather spend my time on making this a server/client application than set up MySql or PostgreSql.

You could also look into making the server multi-threaded.

And you might want to google for "three-tier architecture".

mm78
15th December 2006, 15:41
It may be simple. But what about the requirements. I believe the SQLite database is linked to an application. But how would you implement a distributed scenario? From what it sounds like, they have to support multiple instances of the teachers frontend at the same time. Each one looking at the same data. So to me a real client server architecture would be required, if they do not decide to go web based. If they prefer Qt for this, then they would need something like MySQL as was mentioned before, so that they can access the DB over network.

SQLite is linked to the application, but it could be part of the server app, right?

So all they would need is the server app (with a SQLite database) and a client app.

sunil.thaha
18th December 2006, 05:25
I second Mike, probably you should use MySql, rather that re-inventing the wheel.

QSqlDatabase + QSocket + QThread is an overkill, remember that this is a School project.