Вы находитесь на странице: 1из 16

Rebublic of the Phlippines

Batangas State University


Alangilan Campus
College of Informatics and Computing Sciences

STUDENT REQUIREMENT CHECKLIST

In Partial Fulfillment of the Requirements in


CS 111 Computer Programming

By:
Malveda, Evan Joseph R.

Submitted to:
Mr. Raymond Kit M. Rodriguez

May 2019
Introduction

In the fast changing world, the enhancement of technology increases almost every day.

That enhance or innovation helps the people to do work or make their lives easier. For example,

instead of sending letters to communicate with someone like in the past, people are now capable

of communicating with someone by just typing the message and sending it off in just one tap. In

ordering foods, people don’t need to go to the mall or shop to order or buy the things they want,

instead they shop online and wait for the delivery guy to deliver the item right at their doorstep.

Almost all the things and happenings around the world is manipulated by technology and

through that technology, there is a program involved. Without that program, a certain technology

will not work properly or will not work entirely because it will not follow any rules, restrictions,

functions or syntax that the program provides.

As time goes by, programs seize to amaze the user because of its never ending

capabilities that can make the life of user easier. It involves on creating a system where it solves

a certain problem that the user has, that is how the program make things work at ease without

using too much energy.

That is why the developer came up with an idea that can help the adviser of a certain

section reduce his/her load of paper works, files and documents that are only important within

the semester or until the school year ends. It is an application where the adviser can check the

requirements of a student without bringing or using any record books. This will ensure that the

data gathered is safely stored without having any problem of missing or misplacing it because it

is on a personal computer or laptop not on a piece of paper or record book. To ensure the safety

of the data inputted at the application, it has a login process where the user cannot enter or use

the application without logging in it. This will make sure that the data inside cannot be altered by
any person except the adviser. For example, the adviser accidentally leave his/her laptop inside a

certain room with the application opened and somebody tries to login, the adviser do not need to

worry because the application has that login process. The login process has only three (3) tries

and if a certain user does not succeed on logging in after three (3) consecutive tries, the

application will be closed temporarily until the adviser opened it and only the adviser knows

where the application is located.

The use of this application is limited to only one adviser per section. This will ensure that

the data/information gathered is accurate. It can also prevent the alteration of data when checking

the requirements. The developer also thought that it is easier for the adviser to manipulate the

application if it has only one user (the adviser) and the section he/she is handling.

The application cannot show a message that says “A person tries to login your account.”

if someone attempted to use the application. It cannot also display what has been typed on the

username and password field if someone attempted to after three (3) consecutive tries.

The application only has the requirements of the first year students to be checked because

it is an application focused on the advisers who handle the freshmen.

If the adviser wants to add a student, any character can be used for the SR-Code of the

student. If any character is available for the SR-Code, it means that the SR-Code is not unique

enough.

The application is limited to offline use only, it cannot be used to transfer or send data

online. The application is for desktop or laptop use only, it is not available for mobile devices.
The application is not yet fully developed that is it is open for recommendation to make it

fully functional without experiencing any errors, bugs or problems that can affect the user.

The application should display a message if someone tries to login to the application. If

the adviser uses the application after the attempted login, the application will show what the

intruder typed on the username and password field.

There will be restriction on how many characters and what characters you will put on the

SR-Code field when adding a student. This will make sure that the SR-Code of the students will

be unique with each other.

The application will accept different kind of requirements like exercises, assignments,

activities, and examinations to be checked and is usable by different year levels.

The application will be available for online use and is accessible through mobile devices.

Improve the UI of the application to make it appealing to the eye of the user.

Source Code

#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])


{
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QPixmap>

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowTitle("Batangas State University");
QPixmap pix("C:/Users/yagur/Documents/LogIn/img/LoginIconAppl.png");
ui->label_pic->setPixmap(pix.scaled(100,100,Qt::KeepAspectRatio));
}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::on_pushButton_Login_clicked()
{
connect_studentinfo();

QString username = ui->lineEdit_username->text();


QString password = ui->lineEdit_password->text();

if(!connect_studentinfo())
{
qDebug()<<"Failed to connect the database";
return;
}
QSqlQuery qr;

if(qr.exec("select * from Adviser where Username='"+username+"' and


Password='"+password+"'"))
{
int count=0;
while(qr.next())
{
count++;
}
if(count==1)
{
QMessageBox::information(this, "Login", "Username and
password is correct.");
this->hide();
Dialog dialog;
dialog.setModal(true);
dialog.exec();

disconnect_student();
}
if(count>1){
QMessageBox::warning(this, "Login", "Duplicate username and
password");
}
if(count<1)
{
QMessageBox::warning(this, "Login", "Username and password is
incorrect!");
attempts++;
}
}
if(attempts==3)
{
this->hide();
}
}

#include "dialog.h"
#include "ui_dialog.h"
#include "mainwindow.h"
#include <QMessageBox>
#include "add_students.h"
#include "remove_student.h"

Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
this->setWindowTitle("Batangas State University Requirement Checklist");

checklist=QSqlDatabase::addDatabase("QSQLITE");
checklist.setDatabaseName("C:/Users/yagur/Desktop/Database/login
database.db");
}

Dialog::~Dialog()
{
delete ui;
}

void Dialog::on_pushButton_clicked()
{
MainWindow database;
database.connect_studentinfo();

QSqlQueryModel *students = new QSqlQueryModel();

QSqlQuery *qr = new QSqlQuery(database.studentinfo);

qr->prepare("select * from Information");


qr->exec();

students->setQuery(*qr);
ui->tableView_studentinfo->setModel(students);

QSqlQueryModel *info = new QSqlQueryModel;


QSqlQuery *qy = new QSqlQuery(database.studentinfo);

qy->prepare("select Name from Information");


qy->exec();

info->setQuery(*qy);
ui->comboBox->setModel(info);
database.disconnect_student();
}
void Dialog::on_pushButton_submit_clicked()
{
QString name;
name = ui->comboBox->currentText();

MainWindow connect;

if(ui->checkBox_goodmoral->isChecked())
{

connect.connect_studentinfo();
QSqlQuery qu;
qu.prepare("update Information set Good_Moral = 'Passed'
where Name = '"+name+"' ");

if(qu.exec())
{

//QMessageBox::information(this,tr("Update"),tr("Requirement update
successful."));
connect.disconnect_student();

}
}

else if(ui->checkBox_goodmoral->checkState()==Qt::Unchecked)
{

connect.connect_studentinfo();

QSqlQuery qu;
qu.prepare("update Information set Good_Moral = 'N/A' where
Name = '"+name+"' ");
if(qu.exec())
{
// QMessageBox::warning(this,tr("Update"),tr("Requirement
update unsuccessful!"));
connect.disconnect_student();

}
}

if(ui->checkBox_psa->isChecked())
{

connect.connect_studentinfo();

QSqlQuery psa;
psa.prepare("update Information set PSA = 'Passed' where Name
= '"+name+"' ");
if(psa.exec())
{

//QMessageBox::information(this,tr("Update"),tr("Requirement update
successful."));
connect.disconnect_student();
}
}

else if(ui->checkBox_psa->checkState()==Qt::Unchecked)
{

connect.connect_studentinfo();

QSqlQuery psa;
psa.prepare("update Information set PSA = 'N/A' where Name =
'"+name+"' ");
if(psa.exec())
{
//QMessageBox::warning(this,tr("Update"),tr("Requirement
update unsuccessful!"));
connect.disconnect_student();

}
}
if(ui->checkBox_form137->isChecked())
{

connect.connect_studentinfo();

QSqlQuery form;
form.prepare("update Information set Form_137 = 'Passed'
where Name = '"+name+"' ");
if(form.exec())
{

//QMessageBox::information(this,tr("Update"),tr("Requirement update
successful."));
connect.disconnect_student();

}
}

else if(ui->checkBox_form137->checkState()==Qt::Unchecked)
{

connect.connect_studentinfo();

QSqlQuery form;
form.prepare("update Information set Form_137 = 'N/A' where
Name = '"+name+"' ");
if(form.exec())
{
//QMessageBox::warning(this,tr("Update"),tr("Requirement
update unsuccessful!"));
connect.disconnect_student();

}
}
if(ui->checkBox_form138->isChecked())
{
connect.connect_studentinfo();

QSqlQuery forms;
forms.prepare("update Information set Form_138 = 'Passed'
where Name = '"+name+"' ");
if(forms.exec())
{

//QMessageBox::information(this,tr("Update"),tr("Requirement update
successful."));
connect.disconnect_student();

}
}

else if(ui->checkBox_form138->checkState()==Qt::Unchecked)
{

connect.connect_studentinfo();

QSqlQuery forms;
forms.prepare("update Information set Form_138 = 'N/A' where
Name = '"+name+"' ");
if(forms.exec())
{
//QMessageBox::warning(this,tr("Update"),tr("Requirement
update unsuccessful!"));
connect.disconnect_student();

}
}
if(ui->checkBox_medicalcertificate->isChecked())
{

connect.connect_studentinfo();

QSqlQuery med;
med.prepare("update Information set Medical_Certificate =
'Passed' where Name = '"+name+"' ");
if(med.exec())
{

//QMessageBox::information(this,tr("Update"),tr("Requirement update
successful."));
connect.disconnect_student();

}
}

else if(ui->checkBox_medicalcertificate-
>checkState()==Qt::Unchecked)
{

connect.connect_studentinfo();

QSqlQuery med;
med.prepare("update Information set Medical_Certificate =
'N/A' where Name = '"+name+"' ");
if(med.exec())
{
//QMessageBox::warning(this,tr("Update"),tr("Requirement
update unsuccessful!"));
connect.disconnect_student();
}
}
}

void Dialog::on_pushButton_add_clicked()
{
add_students add_students;
add_students.setModal(true);
add_students.exec();
}

void Dialog::on_pushButton_remove_clicked()
{
remove_student remove_students;
remove_students.setModal(true);
remove_students.exec();
}

void Dialog::on_pushButton_logout_clicked()
{
QMessageBox::about(this,"Logout","You are now logged out.");
this->close();
MainWindow *login = new MainWindow;
login->show();
}

void Dialog::change_check(QString& name)


{
MainWindow con;
QSqlQuery qry;
connect(ui->comboBox, SIGNAL(on_comboBox_editTextChanged(Qstring& name))
, this, SLOT(change_check(Qstring& name)));
con.connect_studentinfo();
QString Good_Moral;

qry.prepare("select * from Information where Name = '" +name+"' ");

if (qry.exec())
{
while (qry.next())
{
Good_Moral = qry.value(2).toString();
}
}

if(Good_Moral == "Passed")
{
ui->checkBox_goodmoral->setChecked(true) ;
}
else if(Good_Moral == "N/A")
{
ui->checkBox_goodmoral->setChecked(false) ;
}
qDebug() << name << Good_Moral;
}
void Dialog::on_comboBox_currentIndexChanged(const QString &arg1)
{
MainWindow con;
// connect(ui->comboBox, SIGNAL(on_comboBox_editTextChanged(Qstring&
name)) , this, SLOT(change_check(Qstring& name)));
con.connect_studentinfo();

QSqlQuery qry;
QString Good_Moral,PSA,f_137,f_138,med_cert;
QString name = arg1;
qry.prepare("select * from Information where Name='"+name+"'");
// qry.bindValue(":name", name);
if (qry.exec())
{
while (qry.next())
{
Good_Moral = qry.value(2).toString();
PSA = qry.value(3).toString();
f_137 = qry.value(4).toString();
f_138 = qry.value(5).toString();
med_cert = qry.value(6).toString();
}
}else
{
qDebug() << Good_Moral << qry.lastQuery() << qry.lastError();
}

if(Good_Moral == "Passed")
{
ui->checkBox_goodmoral->setChecked(true) ;
}
else if(Good_Moral == "N/A")
{
ui->checkBox_goodmoral->setChecked(false) ;
}else if (Good_Moral == NULL) {
ui->checkBox_goodmoral->setChecked(false) ;
}

if(PSA == "Passed")
{
ui->checkBox_psa->setChecked(true) ;
}
else if(PSA == "N/A")
{
ui->checkBox_psa->setChecked(false) ;
}else if (PSA == NULL) {
ui->checkBox_psa->setChecked(false) ;
}

if(f_137 == "Passed")
{
ui->checkBox_form137->setChecked(true) ;
}
else if(f_137 == "N/A")
{
ui->checkBox_form137->setChecked(false) ;
}else if (f_137 == NULL) {
ui->checkBox_form137->setChecked(false) ;
}

if(f_138 == "Passed")
{
ui->checkBox_form138->setChecked(true) ;
}
else if(f_138 == "N/A")
{
ui->checkBox_form138->setChecked(false) ;
}else if (f_138 == NULL) {
ui->checkBox_form138->setChecked(false) ;
}

if(med_cert == "Passed")
{
ui->checkBox_medicalcertificate->setChecked(true) ;
}
else if(med_cert == "N/A")
{
ui->checkBox_medicalcertificate->setChecked(false) ;
}
else if (med_cert == NULL) {
ui->checkBox_medicalcertificate->setChecked(false) ;
}
qDebug() << name;
// QMessageBox::about(this,"","texxtchange");

// QMessageBox::about(this,"","index");
}

void Dialog::on_comboBox_activated(QString& name)


{
QMessageBox::about(this,"","acivated");
}

void Dialog::on_comboBox_editTextChanged(QString& name)


{

void Dialog::on_comboBox_currentTextChanged(const QString &arg1)


{
}

#include "add_students.h"
#include "ui_add_students.h"
#include "mainwindow.h"
#include <QMessageBox>
add_students::add_students(QWidget *parent) :
QDialog(parent),
ui(new Ui::add_students)
{
ui->setupUi(this);
this->setWindowTitle("Add Student");
}

add_students::~add_students()
{
delete ui;
}

void add_students::on_pushButton_addstudent_clicked()
{
MainWindow add;
add.connect_studentinfo();
QString srcode, name;
srcode = ui->lineEdit_srcode->text();
name = ui->lineEdit_name->text();

if(!ui->lineEdit_name->text().isEmpty()&&!ui->lineEdit_srcode-
>text().isEmpty())
{
QSqlQuery qr;

qr.prepare("insert into Information (SR_Code,Name) values


('"+srcode+"' , '"+name+"')");
if (qr.exec())
{
QMessageBox::information(this,tr("Add Student"), tr("Student
added succesfully."));
add.disconnect_student();
this->hide();
}
else
{
QMessageBox::warning(this,tr("Failed"), qr.lastError().text());
}
}

else
{
QMessageBox::warning(this,tr("Failed"), tr("Field cannot be empty"));
}

void add_students::on_pushButton_clicked()
{
this->hide();
}
#include "remove_student.h"
#include "ui_remove_student.h"
#include "mainwindow.h"
#include <QString>
#include <QMessageBox>

remove_student::remove_student(QWidget *parent) :
QDialog(parent),
ui(new Ui::remove_student)
{
ui->setupUi(this);
this->setWindowTitle("Remove Student");

MainWindow remove;
remove.connect_studentinfo();
QSqlQueryModel *student = new QSqlQueryModel();

QSqlQuery* qy = new QSqlQuery(remove.studentinfo);


qy->prepare("select Name from Information");
qy->exec();

student->setQuery(*qy);
ui->comboBox_student->setModel(student);
remove.disconnect_student();
}

remove_student::~remove_student()
{
delete ui;
}

void remove_student::on_pushButton_removestudent_clicked()
{
QString name;
name=ui->comboBox_student->currentText();

MainWindow remove;
remove.connect_studentinfo();

QSqlQuery qu;
qu.prepare("delete from Information where Name='"+name+"'");

if (qu.exec())
{
QMessageBox::information(this,tr("Remove"),tr("Student removed
succesfully."));
remove.disconnect_student();
this->hide();
}
else
{
QMessageBox::information(this,tr("Error::"),qu.lastError().text());
}
}

void remove_student::on_pushButton_clicked()
{
this->hide();
}

Journal

April 26 - nagdownload ng installer para sa qt na aking gagamitin

April 27 - nanood ng tutorial at sinunod ang mga ito kaya nakagawa na ako ng application kung

saan gagawin ko ang checklist

April 28 - Inayos ang application kung saan magkakaroon ito ng login process para masunod ang

features ng aking application

April 29 - nagpacopy ng sqlite studio para sa data base

April 30 - nagpahinga muna kasi umuwi sa sto.tomas

May 1 - nagconnect ng sqlite sa qt at gumawa ng table para sa user/adviser

may 2 - Gumawa ng panibagong table sa database para sa info at requirements ng students

May 3 - namahinga muna

May 4 - nag-isip kung ano ang magiging itsura ng ui after mag-login ang user

May 5 - nanood ng tutorial para malaman kung ano ang maaaring ilagay na button para maging

maayos ang ui ng window

May 6 - Inayos na ang magiging ui after mag-login at naglagay na rin ng button, combo box,

checkbox at table view ngunit hindi pa nalalagyan ng function ang mga ito
May 7 - Nilagyan ng function ang bawat button sa loob ng window.

May 8 - nanood ng tutorial kung paano iconnect ang table view sa data base para maipakita ang

nilalaman ng data base kung saan nakalagay ang information ng estudyante

May 9 - Naconnect na ang table view sa data base at maayos naman na nakikita ang information

dito.

May 10 - Umisip at ginawa ang paraan kung paano papasok ang data ng check box sa loob ng

data base

May 11 - Inayos ang ui ng application para maging maayos tignan

May 12 - naisipan ko nalang mamahinga sa araw na ito at intayin ang magiging kalbaryo sa mga

susunod na araw

May 13 - Chinecheck ang application kung nagana ba ng ayos at nagpapractice na rin ng mga

posibleng sasabihin

May 14 - Naggawa ng documentation para sa defense bukas

May 15 - nagdefense na pero nagkaroon ng problema dahil may hinahanap pa sa system.

May 16 - naghanap ng paraan kung paano aayusin yung system kung saan dapat nakacheck sa

checkbox ang requirement na naipasa

May 17 - nasolusyonan na ang naging problema sa system

Вам также может понравиться