0 évaluation0% ont trouvé ce document utile (0 vote)
81 vues81 pages
The document provides an overview of the software requirements specification for an automated test system. It describes the purpose as developing an application to provide online computer-based testing to replace paper-based exams. This will allow students to take tests more efficiently by saving time and providing fast results. The system will use a client-server database architecture. The document also outlines the project scope, operating environment, methodology involving multiple phases from initiation to operations and maintenance, and some design and implementation constraints.
The document provides an overview of the software requirements specification for an automated test system. It describes the purpose as developing an application to provide online computer-based testing to replace paper-based exams. This will allow students to take tests more efficiently by saving time and providing fast results. The system will use a client-server database architecture. The document also outlines the project scope, operating environment, methodology involving multiple phases from initiation to operations and maintenance, and some design and implementation constraints.
The document provides an overview of the software requirements specification for an automated test system. It describes the purpose as developing an application to provide online computer-based testing to replace paper-based exams. This will allow students to take tests more efficiently by saving time and providing fast results. The system will use a client-server database architecture. The document also outlines the project scope, operating environment, methodology involving multiple phases from initiation to operations and maintenance, and some design and implementation constraints.
Automated Test 1 1.1 Introduction Software Requirements Specification is a complete description of the behavior of the system to be developed. It includes asset of use cases that describe all the interactions the users will have with the software. Use cases are also known as functional requirements. In addition to use cases the SRS also contains non!functional "or supplementary# requirements. $on!functional requirements are requirements which impose constraints on the desi%ner implementation "such as performance en%ineerin% requirements quality standards or desi%n constraints#. This pro&ect is concerned to develop an application in order to provide a basis for effective fulfillment of conductin% tests on computer as a replacement for the paper based tests for testin% the capability of the students. The purpose of test simulator is to take test in an efficient manner and no time wastin% for checkin% the paper. The main ob&ective of test simulator is to efficiently evaluate the candidate thorou%hly throu%h a fully automated system that not only saves lot of time but also %ives fast results.'or students they %ive papers accordin% to their convenience and time and there is no need of usin% e(tra thin% like paper pen etc. The main aim of this pro&ect is to automate the manual processin% such that it runs on every system. There is no such provisionof license.Talkin% in terms of performance There will be fast result computin% and the software should be less error!prone.Students can attend the e(amination with the lo%in username and the password. The username and password is %iven by the administrator. The authentication of the software is done usin% the username and password. The username and password is passin% throu%h the network to the server system and the authori)ation is done on that system. The architecture followed is *atabase Server Architecture which is also called two!tier architecture or +lient Server Architecture.In this system the client workstation is responsible for mana%in% the user interfaceincludin% presentation lo%ic data processin% lo%ic and business rules lo%ic.The database server is responsible for database stora%e access and processin%. The admin provides questions alon% with positive and ne%ative marks. Institute also enters the list of eli%ible students. All the information entered can be later edited by the institute. Automated Test , 1.1.1 Purpose The specification document describes the capabilities and efficiency that will be provided by the S-'T.AR/ application 0The Inte%rated System1. It also states the various required constraints by which the system will be abide. The intended audience for this document is the development ! term testin% team and end users of the product. The online test created for takin% online test has followin% features2 In comparison to the present system the proposed system will be less time consumin% and is more efficient. Analysis will be very easy in proposed system as it is automated. Result will be very precise and accurate and will be declared in very short span of time because calculation and evaluations are done by the simulator itself. The proposed system is very secure as no chances of leaka%e of question paper as it is dependent on the administrator only. The lo%s of appeared candidates and their marks are stored and can be backup for future use 1.1.2 Project Scope The ob&ective of this software is to completely automate the followin% processes2 Automated Test System fulfills the requirements of the institutes to conduct the e(ams.They do not have to %o to any software developer to make a separate site for bein% able to conduct e(ams . They &ust have to re%ister and choose one sub&ect in which they want to test their skills.Students can %ive e(am without the need of %oin% to any physical destination. They can view the result at the same time. Thus the purpose of the test is to provide a system that saves the efforts and time of both the vinstitutes and the students. $o ma&or trainin% and new skills are required as it is based on *34S model. It will help in the time savin% and fast processin% and dispersal of user request and applications. $ew product will provide all the benefits of present system with better performance. Improved information better mana%ement and collection of the reports. Automated Test 5 User support 2 User involvement in the buildin% of present system is sou%ht to keep in mind the user specific requirement and needs. All information can be mana%ed easily usin% simple window forms. Information can also be modified easily if there is any need arises in the future. Institutes can enter and edit the questions alon% with havin% a look to the students list who have attempted the e(amination. 1.1.3 peratin! En"ironment -peratin% System2 .indows 67 7rof. or above. 7rocessor2 7entium 8 1., 9:) or above. :ard *isk2 8; 93 or above RA42 <1, 43 or above. 1.1.# $et%odo&o!' PHASES( a. Initiation P%ase The initiation of a system "or pro&ect# be%ins when a business need or opportunity is identified. A 7ro&ect 4ana%er should be appointed to mana%e the pro&ect. This business need is documented in a +oncept 7roposal. After the +oncept 7roposal is approved the System +oncept *evelopment 7hase be%ins. ). S'stem Concept *e"e&opment P%ase -nce a business need is approved the approaches for accomplishin% the concept are reviewed for feasibility and appropriateness. The Systems 3oundary *ocument identifies the scope of the system and requires Senior -fficial approval and fundin% before be%innin% the 7lannin% 7hase. Automated Test 8 c. P&annin! P%ase The concept is further developed to describe how the business will operate once the approved system is implemented and to assess how the system will impact employee and customer privacy. To ensure the products and =or services provide the required capability on!time and within bud%et pro&ect resources activities schedules tools and reviews are defined. Additionally security certification and accreditation activities be%in with the identification of system security requirements and the completion of a hi%h level vulnerability assessment. d. Requirements Ana&'sis P%ase 'unctional user requirements are formally defined and delineate the requirements in terms of data system performance security and maintainability requirements for the system. All requirements are defined to a level of detail sufficient for systems desi%n to proceed. All requirements need to be measurable and testable and relate to the business need or opportunity identified in the Initiation 7hase. e. *esi!n P%ase The physical characteristics of the system are desi%ned durin% this phase. The operatin% environment is established ma&or subsystems and their inputs and outputs are defined and processes are allocated to resources. /verythin% requirin% user input or approval must be documented and reviewed by the user. The physical characteristics of the system are specified and a detailed desi%n is prepared. Subsystems identified durin% desi%n are used to create a detailed structure of the system. /ach subsystem is partitioned into one or more desi%n units or modules. *etailed lo%ic specifications are prepared for each software module. f. *e"e&opment P%ase The detailed specifications produced durin% the desi%n phase are translated into hardware communications and e(ecutable software. Software shall be unit tested inte%rated and retested in a systematic manner. :ardware is assembled and tested. Automated Test < !. Inte!ration and Test P%ase The various components of the system are inte%rated and systematically tested. The user tests the system to ensure that the functional requirements as defined in the functional requirements document are satisfied by the developed or modified system. 7rior to installin% and operatin% the system in a production environment the system must under%o certification and accreditation activities. %. Imp&ementation P%ase The system or system modifications are installed and made operational in a production environment. The phase is initiated after the system has been tested and accepted by the user. This phase continues until the system is operatin% in production in accordance with the defined user requirements. i. perations and $aintenance P%ase The system operation is on%oin%. The system is monitored for continued performance in accordance with user requirements and needed system modifications are incorporated. The operational system is periodically assessed throu%h In!7rocess Reviews to determine how the system can be made more efficient and effective. -perations continue as lon% as the system can be effectively adapted to respond to an or%ani)ation>s needs. .hen modifications or chan%es are identified as necessary the system may reenter the plannin% phase. 1.1.+ *esi!n , Imp&ementation Constraints 1. This -nline Test /n%ine fires a series of ob&ective type questions and stores the markes scored in the server. It is simple to use and easy to setup. 3esides it requires no additional 7erl modules and uses the least system resources. ,. In the recent version you have a presettable time limit to answer the question !about ?; seconds. At the end of this time limit you will be taken to the ne(t question without awardin% any mark. 5. The questions need to be of the ob&ective type and can have 8 or , options. Automated Test @ 8. Alon% with the lo%in script this can form the basic screenin% test before you invite your likely candidates for an interview. -r +onduct an online test for education too. Aust set your questions and answers in a sheet and you are ready for an online test. <. It is essential that the user clicks at one option as otherwise the script will present the same question a%ain. @. It calculates the score and the total marks scored at any point of time will always be visible at the top. B. If the user %ets above B< C marks there will be an additional messa%e to indicate the %rowin% C of marks. D. In version , of this online test en%ine you are presented with a predefined time limit for answerin% each question. If you have successfully completed this test you can move on to another test. ?. The e(it button at the end of the pa%e takes you out to a feedback pa%e abortin% the test. 7lease complete the form at the end of the test which will enable us to serve you better. 1.2 S'stem -eatures 1.2.1 Simp&icit'2 Althou%h it may seem old!fashioned the aphorism 0all thin%s in moderation1 applies to window apps. There is tendency amon% some desi%ners to provide the end!user with 0too much1!e(haustive content e(treme visuals intrusive animation enormous web pa%es. 1.2.2 Consistenc'2 This desi%n %oal applies to virtually every element of the desi%n model. +ontent should be constructed consistently. 9raphic desi%n should present a consistent look across all parts of the window app. Architectural *esi%n should establish templates that led to consistent hypermedia structures. 1.2.3 Identit'2 The aesthetic interface and navi%ational desi%n of a window app must be consistent with the application domain for which it is to be built. The window app architecture will be entirely different interfaces will be constructed to accommodate different cate%ories of usersE navi%ation will be or%ani)ed to accomplish different ob&ectives. Automated Test B 1.2.# Ro)ustness2 3ased on the identity that has been established a window app often makes an implicit 0promise1 to a user. The user e(pects robust content and functions that are relevant to the user>s need. 1.2.+ Compati)i&it'2 A window app will be used in a variety of environment "e.%. different hardware operatin% System# and must be desi%ned to be compatible with each. 1.3 E.terna& Interface Requirements 1.3.1 /ser Interfaces The application will have a user friendly and menu based interface.'ollowin% screens will be provided2 0o!in(1 There is a quality lo%in window because this is more secure than other lo%in forms as in a normal lo%in window .4oreover there are multiple lo%ins available so that more than one person can access to test with there individual lo%in. 3ut in this pro&ect there is only one lo%in id i.e. administrator id and password which a person cannot use to access . :ence it is more secure and reliable than previously used methods of takin% test . Test2! Test pa%e is the most creative and important pa%e in this pro&ect. It consists of , modules namely2 Sub&ect selection Utilities Su)ject se&ection(1 'rom the %iven choices the candidate can select his field "like + +FF and AAGA etc# for takin% on with the test. /ti&ities(1 Skip but cannot come back to the question afterwards if needed. Automated Test D 9ives the list of attempted and unattempted questions and can %o to any question directly and can either attempt or chan%e the answer of the already attempted question. 1.3.2 Hardware Interfaces 7rocessor !!!!!!!! 7entium 8 1., 9:) or above. :ard *isk2 !!!!!!!! 8; 93 or above. RA42 !!!!!!!! <1, 43 or above. 1.3.3 Software Interfaces -peratin% System !!!!!!!! .indows 67 prof. or above *atabase Server !!!!!!!! 4S Access *atabase +onnectivity !!!!!!!! A*3+ 1.# -unctiona& Requirements System must have Aava to run the pro&ect. System also have 4S Access to mana%e database. 1.+ 2on1 -unctiona& Requirements 1.+.1 Performance requirements The accountability is a vital feature and this could only be assured if the system is workin% in full capability. So uninterrupted power supply is needed. 1.+.2 Safet' requirements The data handled is very vital. The data are saved to the database at consecutive intervals. 7ower is a si%nificant feature and the power supply should be always taken care of. An uninterrupted 7ower Supply is always recommended. 1.+.3 Software qua&it' attri)utes The source code can be easily modified and the system can be updated easily.This system is fle(ible. $ecessary chan%es can be done when needed.
Automated Test ? 1.+.# /ser Trainin! The user must be provided proper trainin% to use the software so that no problems should be faced by the user.
C%apter 2( Ana&'sis And *esi!n Automated Test 1; 2.1 E.aminin! T%e E.istin! Practices The e(istin% system work manually. The e(istin% system has %ot lot of intricacies within itself and need lot of human effort and paper works. All above the data need to be maintained on led%ers and maintainin% this is a tedious and risky process. As the customers increases so the data too. So the task of maintainin% them increases e(ponentially. To view a data may need lot of paper to be searched. 2.2 Pro)&ems Identification Some of the ne%ative aspects of the e(istin% system are as follows2 +ourse of action is time consumin%. .herever a need for search arises the process evolves search throu%h paper records. Readability of records is constrained. All the records may not be handled or written by the same person. So the format and style of records differ and hence it is difficult to understand. 7aper records are easily dama%ed in course of time. The life time of paper record is unreliable less that it easily %ets spoiled. /(penditure is hi%h. 4anual system needs added man power. Securin% of manual system is not fully %uaranteed. Inaccuracy can be e(pected. *ata can %et easily scratched. Techniques used are more complicated. 7roper techniques are not e(posed so the functionin% is intricate. Automated Test 11 2.3 PR3ECT *ICTI2AR4 a. *ATA-05 *IA6RA$S A %raphic tool used to describe and analy)e the moment of data throu%h a system H manual or automated H includin% the processes stores of data and delays in the system. *ata flow dia%rams are the central tools and the basis from which other components are developed. The transformation of data from input to output throu%h processes may be described lo%ically and independently of the physical components associated with the system. 'i%ure ,.12 +-$T/6T A$AIJSIS *IA9RA4 Automated Test 1, 'i%ure ,.,2 *'* H "Ievel ;# Automated Test 15 'i%ure ,.52 *'* H "Ievel 1# Automated Test 18 'i%ure ,.82 *'* Top levelH "Ievel ,# Automated Test 1< ). *ATA *ICTI2AR4 A data dictionary is a catalo%ue H a repository H of the elements in a system. As the name su%%ests these elements center around data the way they are structured to meet user requirements and or%ani)ation needs. In a data dictionary you will find a list of all the elements composin% the data flow throu%h a system. Student &ist( contain the list of students Ta)&e 2.1( Student 0ist Ta)&e 2.2( Su)ject 0ist Automated Test 1@ Ta)&e 2.3( Ru&es f Test Ta)&e 2.#( Record f Test Ta)&e 2.+( Student7s Test Record Automated Test 1B C%apter 3( Codin! , Imp&ementation Automated Test 1D 3.1 Start Pa!e Codin! inc&udin! aut%entication 3.1.1 0o!in.ja"a( import &ava.io.KE import &ava.awt.KE import &ava(.swin%.KE import &ava.awt.event.KE import &ava.sql.KE public class Io%in e(tends A'rame implements ActionIistener L +onnect conE private AIabel lbl3ck%rndE private AIabel lblUser$ameE private AIabel lblpwdE private AIabel lblspace1E private AIabel lblspace,E private AIabel lblspace5E private ATe(t'ield t(tUser$ameE private A7assword'ield pwdE private A3utton btnRe%isterE private A3utton btnSi%nInE A7anel &pE A'rame frameE 9rid3a%Iayout %bE 9rid3a%+onstraints %cE +ontainer content7aneE public Io%in"Strin% s# L super"s#E content7ane M %et+ontent7ane"#E content7ane.setIayout"new 'lowIayout"##E %bMnew 9rid3a%Iayout"#E %cMnew 9rid3a%+onstraints"#E Automated Test 1? Ima%e icon M Toolkit.%et*efaultToolkit"#.%etIma%e"NIma%es=key.&p%N#E setIconIma%e"icon#E Ima%eIcon bu%1 M new Ima%eIcon"NIma%es=3ck%nd1.&p%N#E lbl3ck%rnd M new AIabel"bu%1#E content7ane.add"lbl3ck%rnd#E lbl3ck%rnd.setIayout"%b#E lblUser$ame M new AIabel"NUser$ameN#E lblUser$ame.set'ore%round"+olor..:IT/#E lblUser$ame.set'ont"new 'ont" NArialN 'ont.3-I*1D ##E lblpwd M new AIabel"N7asswordN#E lblpwd.set'ore%round"+olor..:IT/#E lblpwd.set'ont"new 'ont" NArialN'ont.3-I*1D ##E lblspace1 M new AIabel"N N#E lblspace, M new AIabel"N N#E lblspace5 M new AIabel"N N#E t(tUser$ame M new ATe(t'ield"1;#E pwd M new A7assword'ield"1;#E pwd.addOeyIistener"new OeyAdapter"#L public void key7ressed"Oey/vent /GT# L Strin% value M pwd.%etTe(t"#E Strin% %% M pwd.%etTe(t"#E int %%1 M %%.len%th"#E int l M value.len%th"#E if "/GT.%etOey+har"# PM QAQ RR /GT.%etOey+har"# SM QTQ# L pwd.set/ditable"false#E A-ption7ane.show4essa%e*ialo%"nullN4ake sure capslock is not onN#E U else if"%%1 PM<# L A-ption7ane.show4essa%e*ialo%"nullNyou went over < pl) try a%ainN#E t(tUser$ame.setTe(t"NN#E pwd.setTe(t"NN#E U else L pwd.set/ditable"true#E U UU#E Automated Test ,; Ima%eIcon bu%5 M new Ima%eIcon"NIma%es=Re%.pn%N#E btnRe%ister M new A3utton"NRe%isterNbu%5#E btnRe%ister.set4nemonic"QRQ#E btnRe%ister.addActionIistener"this#E btnRe%ister.set7referredSi)e"new *imension"1185;##E Ima%eIcon bu%, M new Ima%eIcon"NIma%es=Si%n.&pe%N#E btnSi%nIn M new A3utton"NSi%n inNbu%,#E btnSi%nIn.set4nemonic"QSQ#E btnSi%nIn.addActionIistener"this#E btnSi%nIn.set7referredSi)e"new *imension"11;5;##E try L conMnew +onnect"#E U catch"/(ception e(cep#L System.out.println"N:ellothere is an e(ceptionN#E U %c.%rid(M;E %c.%ridyM;E %b.set+onstraints"lblUser$ame%c#E lbl3ck%rnd.add"lblUser$ame#E %c.%rid(M1E %c.%ridyM;E %b.set+onstraints"t(tUser$ame%c#E lbl3ck%rnd.add"t(tUser$ame#E %c.%rid(M;E %c.%ridyM1E %b.set+onstraints"lblspace1%c#E lbl3ck%rnd.add"lblspace1#E %c.%rid(M;E %c.%ridyM,E %b.set+onstraints"lblpwd%c#E lbl3ck%rnd.add"lblpwd#E %c.%rid(M1E %c.%ridyM,E %b.set+onstraints"pwd%c#E Automated Test ,1 lbl3ck%rnd.add"pwd#E %c.%rid(M;E %c.%ridyM5E %b.set+onstraints"lblspace,%c#E lbl3ck%rnd.add"lblspace,#E %c.%rid(M;E %c.%ridyM8E %b.set+onstraints"lblspace5%c#E lbl3ck%rnd.add"lblspace5#E %c.%rid(M;E %c.%ridyM<E %b.set+onstraints"btnRe%ister%c#E lbl3ck%rnd.add"btnRe%ister#E %c.%rid(M1E %c.%ridyM<E %b.set+onstraints"btnSi%nIn%c#E lbl3ck%rnd.add"btnSi%nIn#E set3ounds"@;;,<;?;;888#E setSi)e",B@1?B#E setGisible"true#E setResi)able"false#E U public static void main"Strin% ar%sVW#L Io%in ll M new Io%in"NIo%in 'ormN#E ll.set*efault+lose-peration"A'rame./6ITX-$X+I-S/#E U public void action7erformed"Action/vent e#L -b&ect o M e.%etSource"#E if"o MM btnRe%ister#L tryL if"t(tUser$ame.%etTe(t"#.equals"NN#YYpwd.%etTe(t"#.equals"NN##L A-ption7ane.show4essa%e*ialo%"nullN7lease /nter username=7asswordN#E U Automated Test ,, else if"t(tUser$ame.%etTe(t"#.equals"NadminN#YYpwd.%etTe(t"#.equals"NadminN## L A-ption7ane.show4essa%e*ialo%"nullNSorrythis username=password is not validN#E t(tUser$ame.setTe(t"NN#E pwd.setTe(t"NN#E U elseL int statusMcon.savelo%in"t(tUser$ame.%etTe(t"#pwd.%etTe(t"##E if"status MM 1#L A-ption7ane.show4essa%e*ialo%"nullN+on%ratulationsZZZ Jou are re%istered...N#E t(tUser$ame.setTe(t"NN#E pwd.setTe(t"NN#E U elseL A-ption7ane.show4essa%e*ialo%"nullNSorryJou 'ailedZ This username already e(istN#E t(tUser$ame.setTe(t"NN#E pwd.setTe(t"NN#E UU Ucatch"/(ception ec#L System.out.println"N:ey there is an e(ceptionNFec#E UU =='or Si%n in 3utton if"o MM btnSi%nIn# L tryL if"t(tUser$ame.%etTe(t"#.equals"NadminN# RR pwd.%etTe(t"#.equals"NadminN## L Admin ap M new Admin"#E dispose"#E U else if"t(tUser$ame.%etTe(t"#.equals"NN#YYpwd.%etTe(t"#.equals"NN##L A-ption7ane.show4essa%e*ialo%"nullN7lease /nter username=7asswordN#E U elseL int status1 M con.si%nlo%in"t(tUser$ame.%etTe(t"#pwd.%etTe(t"##E if"status1 MM 1#L Automated Test ,5 int status, M con.collectSerial"t(tUser$ame.%etTe(t"#pwd.%etTe(t"##E Sub&ectsIist sl M new Sub&ectsIist"status,t(tUser$ame.%etTe(t"##E dispose"#E U elseL A-ption7ane.show4essa%e*ialo%"frameN7lease Re%ister yourself firstNNRe%ister 7roblemNA-ption7ane./RR-RX4/SSA9/#E t(tUser$ame.setTe(t"NN#E pwd.setTe(t"NN#E UU Ucatch"/(ception e(#L System.out.println"NAnother /(ception NFe(#E UUUU 3.1.2 Connect.ja"a import &ava.sql.KE import &ava(.swin%.KE import &ava.util.KE import &ava.sql.*ateE import &ava.sql.TimestampE import &ava(.swin%.table.KE import &ava.awt.KE class +onnect L static +onnection concon1E static Statement stE static 7reparedStatement psE static ResultSet rsMnullE static int snoE +onnect"# L tryL +lass.for$ame"Nsun.&dbc.odbc.Adbc-dbc*riverN#E conM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E Automated Test ,8 con1M*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E U catch"/(ception e(# L System.out.println"N.ron% dsnnameNFe(#E U U int savelo%in"Strin% unameStrin% upwd# L int varM;E Strin% str7wdMnullE try L con.close"#E con1.close"#E conM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E ps M con.prepareStatement"NS/I/+T K from userXlo%inN#E rsMps.e(ecute[uery"#E while" rs.ne(t"##L str7wd M rs.%etStrin%"NuserXpwdN#.trim"#E if"str7wd.equalsI%nore+ase"upwd##L varM1E return";#E UU if"varMM;# L con.close"#E con1.close"#E con1M*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E psMcon1.prepareStatement"Ninsert into userXlo%in values"\\#N#E ps.setStrin%"1uname#E ps.setStrin%",upwd#E ps.e(ecuteUpdate"#E return "1#E U elseL return";#E UU Automated Test ,< catch"/(ception e# L System.out.println"Ndeepak callin%NFe#E return";#E U U int si%nlo%in" Strin% uname1Strin% upwd1 # L Strin% str7wdMnullE tryL con.close"#E con1.close"#E conM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E ps M con.prepareStatement"NS/I/+T K from userXlo%in where userXnameM\N#E ps.setStrin%"1uname1#E rsMps.e(ecute[uery"#E while" rs.ne(t"## L str7wd M rs.%etStrin%"NuserXpwdN#.trim"#E if"str7wd.equalsI%nore+ase"upwd1## L return"1#E U U return ";#E U catch"/(ception e#L System.out.println"N/(ception +au%ht in %ettin% password NFe#E return";#E UU int collectSerial" Strin% uname,Strin% upwd, #L tryL con.close"#E conM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E ps M con.prepareStatement"NS/I/+T K from userXlo%in where userXpwd M \ N#E ps.setStrin%"1upwd,#E rsMps.e(ecute[uery"#E while" rs.ne(t"## L sno M rs.%etInt"NsnoN#E Automated Test ,@ U return snoE U catch"/(ception e#L System.out.println"N/(ception +au%ht in %ettin% serial no. NFe#E return";#E UU int viewRecord"#L try L psMcon.prepareStatement"NSelect K from userXlo%inN#E rsMps.e(ecute[uery"#E return "1#E U catch"/(ception e# L System.out.println"e#E return";# E UU public ATable Table"Strin% sql# throws /(ception L psMcon.prepareStatement"sql#E rsMps.e(ecute[uery"#E ResultSet4eta*ata rmMrs.%et4eta*ata"#E Strin% headerVWMnew Strin%Vrm.%et+olumn+ount"#WE int dataMrm.%et+olumn+ount"#E int iE for"iM1EiSMdataEiFF# L headerVi!1WMrm.%et+olumn$ame"i#E U int countM1E while"rs.ne(t"## L countFFE U Strin% table*ataVWVWMnew Strin% VcountWVdataWE Automated Test ,B rsMps.e(ecute[uery"#E int &M;E while"rs.ne(t"## L for"iM;EiSdataEiFF# L table*ataV&WViWMrs.%etStrin%"iF1#E U &FFE U *efaultTable4odel model M new *efaultTable4odel"table*ataheader#E ==Settin% the saddin% in rows ATable &t M new ATable"model#L public +omponent prepareRenderer "Table+ellRenderer rendererint Inde(Xrow int Inde(Xcol# L +omponent comp M super.prepareRenderer"renderer Inde(Xrow Inde(Xcol#E ==even inde( selected or not selected if "Inde(Xrow C , MM ; RR Zis+ellSelected"Inde(Xrow Inde(Xcol## L comp.set3ack%round"new +olor"1<;,5;,8;##E U else L comp.set3ack%round"+olor.white#E U return compE U UE &t.%et+olumn4odel"#.%et+olumn";#.set:eaderGalue"NSerial $umberN#E &t.%et+olumn4odel"#.%et+olumn"1#.set:eaderGalue"NUser $ameN#E &t.%et+olumn4odel"#.%et+olumn",#.set:eaderGalue"NTest $ameN#E &t.%et+olumn4odel"#.%et+olumn"5#.set:eaderGalue"NTotal [uestionsN#E &t.%et+olumn4odel"#.%et+olumn"8#.set:eaderGalue"NAttempted [uestions N#E &t.%et+olumn4odel"#.%et+olumn"<#.set:eaderGalue"NSkipped [uestionsN#E &t.%et+olumn4odel"#.%et+olumn"@#.set:eaderGalue"NTotal 4arksN#E &t.%et+olumn4odel"#.%et+olumn"B#.set:eaderGalue"N4arks -btainedN#E &t.%et+olumn4odel"#.%et+olumn"D#.set:eaderGalue"N*ate R TimeN#E return "&t#E Automated Test ,D U Gector %etsub&ectslist"#L Gector v M new Gector"#E tryL ResultSet rs1E ps M con.prepareStatement"NS/I/+T K from sub&ectXlistN#E rs1Mps.e(ecute[uery"#E while"rs1.ne(t"## L v.add/lement"rs1.%etStrin%"NsubXnameN##E U return vE U catch"/(ception e# L return vE UU int deleteRecord"Strin% sno#L int varM;E try L psMcon.prepareStatement"N*elete from userXlo%in .:/R/ sno M \N#E ps.setStrin%"1sno#E varMps.e(ecuteUpdate"#E if"varMM1# L psMcon.prepareStatement"N*elete from tblTestResult .:/R/ Sr$o M \N#E ps.setStrin%"1sno#E ps.e(ecuteUpdate"#E return "1#E U else L return";#E U U catch"/(ception e# L System.out.println"e#E return";# E Automated Test ,? U U int remove[ues"Strin% tStrin% q# L System.out.println"Nremove calledN#E tryL psMcon.prepareStatement"Ndelete from tblTest where Test$ame M \ A$* [uestion \N#E ps.setStrin%"1t#E ps.setStrin%",q#E ps.e(ecuteUpdate"#E System.out.println"Nremove endedN#E return"1#E Ucatch"/(ception e#L System.out.println"e#E return";#E U U int update[ues"Strin% nameStrin% quesint ansStrin% op1Strin% op,Strin% op5Strin% op8 # L nameMname.trim"#E quesM ques.trim"#E tryL psMcon.prepareStatement"Nupdate tblTest set Test$ameMQN F name F NQ [uestionMQN F ques F NQ +orrectAnswerMN Fans F N -ption1MQN F op1 F NQ -ption,MQN F op, F NQ -ption5MQN F op5 F NQ -ption8MQN F op8 F NQ where Test$ameMQN F name F NQ and [uestionMQN F ques F NQN#E ps.e(ecuteUpdate"#E return "1#E Ucatch"/(ception e# L System.out.println"NhereN#E System.out.println"eFNerrorN#E return";# E UU int edit[ues"Strin% nmStrin% qsint asStrin% opaStrin% opbStrin% opcStrin% opd # L Automated Test 5; tryL ps M con.prepareStatement"Ninsert into tblTest values"\\\\\\\#N#E ps.setStrin%"1nm#E ps.setStrin%",qs#E ps.setInt"5as#E ps.setStrin%"8opa#E ps.setStrin%"<opb#E ps.setStrin%"@opc#E ps.setStrin%"Bopd#E ps.e(ecuteUpdate"#E return "1#E U catch"/(ception ea#L System.out.println"Ncheck here NFea#E return";# E U U void select[ues"Strin% nmeStrin% qs#L tryL psMcon.prepareStatement"NSelect K from tblTest where Test$ameM\ and [uestionM\ N#E ps.setStrin%"1nme#E ps.setStrin%",qs#E rsMps.e(ecute[uery"#E U catch"/(ception ew#L System.out.println"ew#E UU int sete(am"Strin% e1Strin% e,Strin% e5Strin% d1#L int varM;E int var,M;E Strin% simMNsimpleNE Timestamp d Mnew &ava.sql.Timestamp "new &ava.util.*ate "#.%etTime "##E tryL psMcon.prepareStatement"Ninsert into e(amrule values"\\\#N#E ps.setStrin%"1e1#E Automated Test 51 ps.setStrin%",sim#E ps.setTimestamp "5d#E varM ps.e(ecuteUpdate"#E if"varMM1#L psMcon.prepareStatement"Ninsert into e(amrule values"\\\#N#E ps.setStrin%"1e,#E ps.setStrin%",sim#E ps.setTimestamp "5d#E var,M ps.e(ecuteUpdate"#E U else L return ";#E U if"var,MM1# L psMcon.prepareStatement"Ninsert into e(amrule values"\\\#N#E ps.setStrin%"1e5#E ps.setStrin%",sim#E ps.setTimestamp "5d#E ps.e(ecuteUpdate"#E return "1#E U elseL return ";#E U U catch"/(ception e#L System.out.println"e#E return";#E U U int setmarkin%"Strin% simStrin% e1Strin% d#L try L psMcon.prepareStatement"Ninsert into e(amrule values"\\\#N#E ps.setStrin%"1e1#E ps.setStrin%",sim#E ps.setTimestamp "5 new &ava.sql.Timestamp "new &ava.util.*ate "#.%etTime "###E Automated Test 5, ps.e(ecuteUpdate"#E return"1#E U catch"/(ception e# L System.out.println"e#E return";#E UU int settimin%"Strin% e1Strin% d#L Strin% simMNTime2NE try L psMcon.prepareStatement"Ninsert into e(amrule values"\\\#N#E ps.setStrin%"1e1#E ps.setStrin%",sim#E ps.setTimestamp "5 new &ava.sql.Timestamp "new &ava.util.*ate "#.%etTime "###E ps.e(ecuteUpdate"#E return"1#E U catch"/(ception e#L System.out.println"e#E return";#E U U void sete(amrule"#L tryL con.close"#E conM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E psMcon.prepareStatement"Nselect K from e(amrule where dor M "select ma("dor# from e(amrule %roup by ruleXtype havin% ruleXtypeMQsimpleQ#N#E rsMps.e(ecute[uery"#E Ucatch"/(ception e# L System.out.println"e#E U U void sete(amtime"# L Automated Test 55 tryL con.close"#E conM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E psMcon.prepareStatement"Nselect K from e(amrule where dor M "select ma("dor# from e(amrule where ruleXtype M QTime2Q#N#E rsMps.e(ecute[uery"#E U catch"/(ception e#L System.out.println"e#E UU void sete(ammark"#L tryL con.close"#E conM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E psMcon.prepareStatement"Nselect K from e(amrule where dor M "select ma("dor# from e(amrule where ruleXtype M QyesQ or ruleXtype M QnoQ #N#E rsMps.e(ecute[uery"#E U catch"/(ception e#L System.out.println"e#E UU void setresult"int snumber#L tryL psMcon.prepareStatement"Nselect K from tblTestResult where Sr$o MNFsnumberFN N#E rsMps.e(ecute[uery"#E Ucatch"/(ception e#L System.out.println"e#E U U int setfeedback"Strin% fnmStrin% lnmint rStrin% mailStrin% cmn# L tryL ps M con.prepareStatement"Ninsert into feedback values"\\\\\#N#E ps.setStrin%"1fnm#E ps.setStrin%",lnm#E ps.setStrin%"5mail#E Automated Test 58 ps.setInt"8r#E ps.setStrin%"<cmn#E ps.e(ecuteUpdate"#E return "1#E Ucatch"/(ception e(c#L System.out.println"Ncheck here NFe(c#E return";# E U U public ATable Table1"Strin% sql# throws /(ception L psMcon.prepareStatement"sql#E rsMps.e(ecute[uery"#E ResultSet4eta*ata rmMrs.%et4eta*ata"#E Strin% headerVWMnew Strin%Vrm.%et+olumn+ount"#WE int dataMrm.%et+olumn+ount"#E int iE for"iM1EiSMdataEiFF# L headerVi!1WMrm.%et+olumn$ame"i#E U int countM1E while"rs.ne(t"## L countFFE U Strin% table*ataVWVWMnew Strin% VcountWVdataWE rsMps.e(ecute[uery"#E int &M;E while"rs.ne(t"## L for"iM;EiSdataEiFF# L table*ataV&WViWMrs.%etStrin%"iF1#E U &FFE U *efaultTable4odel model M new *efaultTable4odel"table*ataheader#E ATable &t1 M new ATable"model#L public +omponent prepareRenderer Automated Test 5< "Table+ellRenderer rendererint Inde(Xrow int Inde(Xcol# L +omponent comp M super.prepareRenderer"renderer Inde(Xrow Inde(Xcol#E if "Inde(Xrow C , MM ; RR Zis+ellSelected"Inde(Xrow Inde(Xcol## L comp.set3ack%round"new +olor"1<;,5;,8;##E U else L comp.set3ack%round"+olor.white#E U return compE U UE &t1.%et+olumn4odel"#.%et+olumn";#.set:eaderGalue"NsnoN#E &t1.%et+olumn4odel"#.%et+olumn"1#.set:eaderGalue"NUser $ameN#E &t1.%et+olumn4odel"#.%et+olumn",#.set:eaderGalue"N7asswordN#E return"&t1#E UU 3.2 Admin windows inc&ude a&& contro&s of admin 3.2.1. Admin.ja"a import &ava.io.KE import &ava.awt.KE import &ava.awt.event.KE import &ava(.swin%.KE import &ava(.swin%.event.KE public class Admin e(tends A'rame implements ActionIistener L private AIabel lbl3ck%rndE private AIabel lblTitleE private AIabel lblspace1E private AIabel lblspace,E private AIabel lblspace5E private AIabel lblspace8E private AIabel lblspace<E Automated Test 5@ private A3utton btnSet/(amE private A3utton btnStd*etailsE private A3utton btnSet[uestionE private A3utton btn3ackE +ontainer content7aneE public Admin"# L super"NAdministrator +onsoleN#E content7ane M %et+ontent7ane"#E content7ane.setIayout"new 'lowIayout"##E Ima%e icon M Toolkit.%et*efaultToolkit"#.%etIma%e"NIma%es=Admin.&p%N#E setIconIma%e"icon#E Ima%eIcon bu%1 M new Ima%eIcon"NIma%es=3ck%nd,.&pe%N#E lbl3ck%rnd M new AIabel"bu%1#E lbl3ck%rnd.setIayout"null#E content7ane.add"lbl3ck%rnd#E lblTitle M new AIabel"N.elcome AdministratorN#E lblTitle.set'ont"new 'ont"N9eor%iaN'ont.3-I*F'ont.ITAII+5;##E lblTitle.set'ore%round"+olor.3IU/#E lblTitle.set3ounds"?D;<;;B;#E lbl3ck%rnd.add"lblTitle#E Ima%eIcon bu%, M new Ima%eIcon"NIma%es=/(am.&pe%N#E btnSet/(am M new A3utton"NSettin% e(amNbu%,#E btnSet/(am.set4nemonic"QSQ#E btnSet/(am.setToolTipTe(t"NTo chan%e the settin%s for todays e(amN#E btnSet/(am.set3ounds"1<;@;,8<?<#E btnSet/(am.addActionIistener"this#E lbl3ck%rnd.add"btnSet/(am#E Ima%eIcon bu%5 M new Ima%eIcon"NIma%es=Std*etails.&pe%N#E btnStd*etails M new A3utton"NStudent *etailNbu%5#E btnStd*etails.set4nemonic"QtQ#E btnStd*etails.setToolTipTe(t"NTo chan%e the settin%s in student accountN#E btnStd*etails.set3ounds"1<;1@<,8<1;<#E Automated Test 5B lbl3ck%rnd.add"btnStd*etails#E btnStd*etails.addActionIistener"this#E Ima%eIcon bu%8 M new Ima%eIcon"NIma%es=[uestion.&pe%N#E btnSet[uestion M new A3utton"N[uestion 3ankNbu%8#E btnSet[uestion.set4nemonic"Q[Q#E btnSet[uestion.setToolTipTe(t"NTo chan%e and update the questions in question bankN#E btnSet[uestion.set3ounds"1<;,D;,8<1;<#E btnSet[uestion.addActionIistener"this#E lbl3ck%rnd.add"btnSet[uestion#E Ima%eIcon bu%< M new Ima%eIcon"NIma%es=3ack.pn%N#E btn3ack M new A3utton"bu%<#E btn3ack.set7referredSi)e"new *imension"8<8<##E btn3ack.addActionIistener"this#E btn3ack.setToolTipTe(t"NAllows you to %o back to Io%inN#E btn3ack.set3ounds",<;8;;8<8<#E lbl3ck%rnd.add"btn3ack#E set3ounds",;;1;;8B;8D;#E setGisible"true#E setResi)able"false#E U public static void main"Strin% ar%sVW# L Admin ad M new Admin"#E ad.set*efault+lose-peration"A'rame./6ITX-$X+I-S/#E U public void action7erformed"Action/vent e# L -b&ect o M e.%etSource"#E if"o MM btnSet/(am# L new /(am"#E U if"o MM btnStd*etails# L new Student*etails"#E U if"o MM btnSet[uestion# Automated Test 5D L new frm4akeTest"#E U if"o MM btn3ack# L new Io%in"NIo%in 'ormN#E UUU 3.2.2 frm$a8eTest.ja"a import &ava(.swin%.KE import &ava(.swin%.event.KE import &ava.awt.KE import &ava.awt.event.KE import &ava.sql.KE public class frm4akeTest e(tends A'rame implements ActionIistener L +onnect conE boolean editMfalseE public Strin% usernameMNNE *imension screen M Toolkit.%et*efaultToolkit"#.%etScreenSi)e"#E +ontainer content7aneE private AIabel l1E AIabel &lblTest$ameMnew AIabel"NTest $ame 2 N#E AIabel &lbl[uestionMnew AIabel"N[uestion 2 N#E AIabel &lbl+orrectMnew AIabel"N+orrect Answer 2 N#E AIabel &lbl-ption1Mnew AIabel"N-ption 1 2 N#E AIabel &lbl-ption,Mnew AIabel"N-ption , 2 N#E AIabel &lbl-ption5Mnew AIabel"N-ption 5 2 N#E AIabel &lbl-ption8Mnew AIabel"N-ption 8 2 N#E ATe(t'ield &t(tTest$ameMnew ATe(t'ield"#E ATe(t'ield &t(t[uestionMnew ATe(t'ield"#E ATe(t'ield &t(t-ption1Mnew ATe(t'ield"#E ATe(t'ield &t(t-ption,Mnew ATe(t'ield"#E ATe(t'ield &t(t-ption5Mnew ATe(t'ield"#E ATe(t'ield &t(t-ption8Mnew ATe(t'ield"#E 3utton9roup cb%-ptionMnew 3utton9roup"#E Automated Test 5? ARadio3utton &rb-ption1Mnew ARadio3utton"N-pt1N#E ARadio3utton &rb-ption,Mnew ARadio3utton"N-pt,N#E ARadio3utton &rb-ption5Mnew ARadio3utton"N-pt5N#E ARadio3utton &rb-ption8Mnew ARadio3utton"N-pt8N#E A3utton bttnAdd$ew M new A3utton"NAdd $ewNnew Ima%eIcon"NIma%es=new1.pn%N##E A3utton bttn/dit M new A3utton"N/ditN new Ima%eIcon"NIma%es=op.&pe%N##E A3utton bttnRemove M new A3utton"NRemoveN new Ima%eIcon"NIma%es=kl.pn%N##E A3utton bttnSearch M new A3utton"NSearchN new Ima%eIcon"NIma%es=search1.&pe%N##E A3utton bttnUpdateM new A3utton"NUpdateNnew Ima%eIcon"NIma%es=up.pn%N##E A3utton bttn+lose M new A3utton"N+loseNnew Ima%eIcon"NIma%es=uio.pn%N##E public frm4akeTest"# L setTitle"NAdmin is lo%%ed on R chan%in% [uestion 3ankN#E Ima%e icon M Toolkit.%et*efaultToolkit"#.%etIma%e"NIma%es=test.pn%N#E setIconIma%e"icon#E content7ane M %et+ontent7ane"#E content7ane.setIayout"new 'lowIayout"##E tryL conMnew +onnect"#E U catch"/(ception e(cep#L System.out.println"N:ellothere is an e(ceptionN#E U Ima%eIcon bu%1 M new Ima%eIcon"NIma%es=3ck%nd,.&pe%N#E l1 M new AIabel"bu%1#E content7ane.add"l1#E l1.setIayout"null#E &lblTest$ame.set3ounds",;5B1B;,;#E l1.add"&lblTest$ame#E &t(tTest$ame.set3ounds"1@;5B,5;,;#E l1.add"&t(tTest$ame#E &lbl[uestion.set3ounds",;@B1,;5;#E l1.add"&lbl[uestion#E Automated Test 8; &t(t[uestion.set3ounds"1@;@B,5;,;#E l1.add"&t(t[uestion#E cb%-ption.add"&rb-ption1#E cb%-ption.add"&rb-ption,#E cb%-ption.add"&rb-ption5#E cb%-ption.add"&rb-ption8#E &lbl+orrect.set3ounds",;?B1,;5;#E l1.add"&lbl+orrect#E &rb-ption1.set3ack%round"+olor.white#E &rb-ption1.set3ounds"1@;?B<B,;#E l1.add"&rb-ption1#E &rb-ption,.set3ack%round"+olor.white#E &rb-ption,.set3ounds",1B?B<B,;#E l1.add"&rb-ption,#E &rb-ption5.set3ack%round"+olor.white#E &rb-ption5.set3ounds",B8?B<B,;#E l1.add"&rb-ption5#E &rb-ption8.set3ack%round"+olor.white#E &rb-ption8.set3ounds"551?B<B,;#E l1.add"&rb-ption8#E &rb-ption1.setSelected"true#E &lbl-ption1.set3ounds",;1,B1,;5;#E l1.add"&lbl-ption1#E &t(t-ption1.set3ounds"1@;1,B,5;,;#E l1.add"&t(t-ption1#E &lbl-ption,.set3ounds",;1<B1,;5;#E l1.add"&lbl-ption,#E &t(t-ption,.set3ounds"1@;1<B,5;,;#E l1.add"&t(t-ption,#E &lbl-ption5.set3ounds",;1DB1,;5;#E l1.add"&lbl-ption5#E &t(t-ption5.set3ounds"1@;1DB,5;,;#E l1.add"&t(t-ption5#E Automated Test 81 &lbl-ption8.set3ounds",;,1B1,;5;#E l1.add"&lbl-ption8#E &t(t-ption8.set3ounds"1@;,1B,5;,;#E l1.add"&t(t-ption8#E bttnAdd$ew.set4nemonic"QAQ#E bttnAdd$ew.setToolTipTe(t"NAltFAN#E bttnAdd$ew.set3ounds"8<;5B1,;55#E l1.add"bttnAdd$ew#E bttn/dit.set4nemonic"Q/Q#E bttn/dit.setToolTipTe(t"NAltF/N#E bttn/dit.set3ounds"8<;1;?11<55#E l1.add"bttn/dit#E bttnRemove.set4nemonic"QRQ#E bttnRemove.setToolTipTe(t"NAltFRN#E bttnRemove.set3ounds"8<;1D111B55#E l1.add"bttnRemove#E bttnSearch.set4nemonic"QSQ#E bttnSearch.setToolTipTe(t"NAltFSN#E bttnSearch.set3ounds"8<;,<511<5@#E l1.add"bttnSearch#E bttnUpdate.set4nemonic"QUQ#E bttnUpdate.setToolTipTe(t"NAltFUN#E bttnUpdate.set3ounds"51;,<51,;5<#E l1.add"bttnUpdate#E bttn+lose.set4nemonic"Q+Q#E bttn+lose.setToolTipTe(t"NAltF+N#E bttn+lose.set3ounds"1B;,<511<55#E l1.add"bttn+lose#E disableAll"#E bttn/dit.set/nabled"false#E bttnRemove.set/nabled"false#E bttnUpdate.set/nabled"false#E bttnAdd$ew.addActionIistener"this#E Automated Test 8, bttn/dit.addActionIistener"this#E bttn+lose.addActionIistener"this#E bttnRemove.addActionIistener"this#E bttnUpdate.addActionIistener"this#E &t(t[uestion.addActionIistener"this#E &t(tTest$ame.addActionIistener"this#E set3ounds"@;;1<;@;;8;;#E set3ack%round"+olor.white#E setGisible"true#E setResi)able"false#E U public void action7erformed"Action/vent ae#L Strin% strMae.%etAction+ommand"#E if"str.equals"NAdd $ewN##L enableAll"#E set3lankAll"#E bttnUpdate.set/nabled"true#E bttnAdd$ew.set/nabled"false#E bttnSearch.set/nabled"false#E bttn/dit.set/nabled"false#E bttnRemove.set/nabled"false#E &t(tTest$ame.request'ocus"#E editMfalseE U else if"str.equals"N+loseN## L dispose"#E U else if"str.equals"NRemoveN##L tryL int status M con.remove[ues"&t(tTest$ame.%etTe(t"#&t(t[uestion.%etTe(t"##E set3lankAll"#E disableAll"#E bttnAdd$ew.set/nabled"true#E bttnSearch.set/nabled"true#E bttnUpdate.set/nabled"false#E Automated Test 85 bttnRemove.set/nabled"false#E bttnAdd$ew.request'ocus"#E A-ption7ane.show4essa%e*ialo%"nullNThe question is deleted.N N$++/+R4S! *eleteN A-ption7ane.7IAI$X4/SSA9/#E U catch"/(ception e#L A-ption7ane.show4essa%e*ialo%"nullN/(ception in delete 2 NFe N$++/+R4S! /(ceptionN A-ption7ane.7IAI$X4/SSA9/#E System.out.println"N/(ception in Update after edit 2 NFe#E UU else if"str.equals"N/ditN## L editMtrueE enableAll"#E bttnUpdate.set/nabled"true#E bttn/dit.set/nabled"false#E bttnRemove.set/nabled"false#E &t(tTest$ame.request'ocus"#E &t(tTest$ame.set/ditable"false#E &t(t[uestion.set/ditable"false#E U else if"str.equals"NUpdateN## L &t(tTest$ame.set/ditable"true#E &t(t[uestion.set/ditable"true#E int oM1E if"&rb-ption1.isSelected"#MMtrue# L oM1E U else if"&rb-ption,.isSelected"#MMtrue# L oM,E U else if"&rb-ption5.isSelected"#MMtrue# L oM5E U else if"&rb-ption8.isSelected"#MMtrue# L oM8E U if"&t(tTest$ame.%etTe(t"#.trim"#.equals"NN## L Automated Test 88 A-ption7ane.show4essa%e*ialo%"nullN7lease enter nameN N$++/+R4S!Galidation .arnin%ZN A-ption7ane.7IAI$X4/SSA9/#E &t(tTest$ame.request'ocus"#E U else if"&t(t[uestion.%etTe(t"#.trim"#.equals"NN## L A-ption7ane.show4essa%e*ialo%"nullN7lease enter father nameN N$++/+R4S! Galidation .arnin%ZN A-ption7ane.7IAI$X4/SSA9/#E &t(t[uestion.request'ocus"#E U else if"&t(t-ption1.%etTe(t"#.trim"#.equals"NN## L A-ption7ane.show4essa%e*ialo%"nullN7lease enter addressN N$++/+R4S!Galidation .arnin%ZN A-ption7ane.7IAI$X4/SSA9/#E &t(t-ption1.request'ocus"#E U else if"&t(t-ption,.%etTe(t"#.trim"#.equals"NN## L A-ption7ane.show4essa%e*ialo%"nullN7lease enter cityN N$++/+R4S!Galidation .arnin%ZN A-ption7ane.7IAI$X4/SSA9/#E &t(t-ption,.request'ocus"#E U else if"&t(t-ption5.%etTe(t"#.trim"#.equals"NN## L A-ption7ane.show4essa%e*ialo%"nullN7lease enter stateN N$++/+R4S!Galidation .arnin%ZN A-ption7ane.7IAI$X4/SSA9/#E &t(t-ption5.request'ocus"#E U else if"&t(t-ption8.%etTe(t"#.trim"#.equals"NN## L A-ption7ane.show4essa%e*ialo%"nullN7lease enter nationalityN N$++/+R4S! Galidation .arnin%ZN A-ption7ane.7IAI$X4/SSA9/#E &t(t-ption8.request'ocus"#E U elseL if"edit# L tryL intstatus1Mcon.update[ues"&t(tTest$ame.%etTe(t"#&t(t[uestion.%etTe(t"#o&t(t-ption1.% etTe(t"#&t(t-ption,.%etTe(t"#&t(t-ption5.%etTe(t"#&t(t-ption8.%etTe(t"##E Automated Test 8< set3lankAll"#E disableAll"#E bttnAdd$ew.set/nabled"true#E bttnSearch.set/nabled"true#E bttnUpdate.set/nabled"false#E bttnAdd$ew.request'ocus"#E A-ption7ane.show4essa%e*ialo%"nullNThe edited information of question is updated.N N$++/+R4S!UpdateN A-ption7ane.7IAI$X4/SSA9/#E U catch"/(ception e#L A-ption7ane.show4essa%e*ialo%"nullN/(ception in Update after edit 2 NFe N$++/+R4S!Galidation .arnin%ZN A-ption7ane.7IAI$X4/SSA9/#E System.out.println"N/(ception in Update after edit 2 NFe#E UU elseL tryL intstatus,Mcon.edit[ues"&t(tTest$ame.%etTe(t"#&t(t[uestion.%etTe(t"#o&t(t-ption1.%etT e(t"#&t(t-ption,.%etTe(t"#&t(t-ption5.%etTe(t"#&t(t-ption8.%etTe(t"##E A-ption7ane.show4essa%e*ialo%"nullNThe question of entered information is saved.N N$++/+R4S!UpdateZN A-ption7ane.7IAI$X4/SSA9/#E set3lankAll"#E disableAll"#E bttnAdd$ew.set/nabled"true#E bttnSearch.set/nabled"true#E bttnUpdate.set/nabled"false#E bttnAdd$ew.request'ocus"#E U catch"/(ception e#L A-ption7ane.show4essa%e*ialo%"nullN/(ception in Update after add 2 NFe N$++/+R4S!/(ceptionZN A-ption7ane.7IAI$X4/SSA9/#E System.out.println"N/(ception in Update after add 2 NFe#E UUUU else if"str.equals"NSearchN##L Automated Test 8@ if"Z"&t(tTest$ame.is/nabled"#RR&t(t[uestion.is/nabled"###L &t(tTest$ame.set/nabled"true#E &t(t[uestion.set/nabled"true#E &t(tTest$ame.request'ocus"#E U elseL tryL con.select[ues"&t(tTest$ame.%etTe(t"#&t(t[uestion.%etTe(t"##E if"+onnect.rs.ne(t"##L displayAll"#E bttnRemove.set/nabled"true#E U elseL A-ption7ane.show4essa%e*ialo%"nullNRecord $ot 'oundN null A-ption7ane.7IAI$X4/SSA9/#E set3lankAll"#E UU catch"/(ception e#L System.out.println"N/(ception in Search N Fe#E U bttn/dit.set/nabled"true#E UU else if"&t(tTest$ameMMae.%etSource"## L if"&t(t[uestion.%etTe(t"#.equals"NN## L &t(t[uestion.request'ocus"#E U elseL bttnSearch.do+lick"#E UU else if"&t(t[uestionMMae.%etSource"## L if"&t(tTest$ame.%etTe(t"#.equals"NN## L &t(t[uestion.request'ocus"#E U elseL bttnSearch.do+lick"#E Automated Test 8B UUU void displayAll"# L lon% oE tryL &t(tTest$ame.setTe(t"+onnect.rs.%etStrin%"1##E &t(t[uestion.setTe(t"+onnect.rs.%etStrin%",##E oM+onnect.rs.%etIon%"5#E if"oMM1# L &rb-ption1.setSelected"true#E U else if"oMM,# L &rb-ption,.setSelected"true#E U else if"oMM5# L &rb-ption5.setSelected"true#E U else if"oMM8# L &rb-ption8.setSelected"true#E U &t(t-ption1.setTe(t"+onnect.rs.%etStrin%"8##E &t(t-ption,.setTe(t"+onnect.rs.%etStrin%"<##E &t(t-ption5.setTe(t"+onnect.rs.%etStrin%"@##E &t(t-ption8.setTe(t"+onnect.rs.%etStrin%"B##E U catch"/(ception e#L System.out.println"N/(ception in displayAll N Fe#E UU void set3lankAll"# L &t(tTest$ame.setTe(t"NN#E &t(t[uestion.setTe(t"NN#E &t(t-ption1.setTe(t"NN#E &t(t-ption,.setTe(t"NN#E &t(t-ption5.setTe(t"NN#E &t(t-ption8.setTe(t"NN#E &rb-ption1.setSelected"true#E U void disableAll"# L Automated Test 8D &t(tTest$ame.set/nabled"false#E &t(t[uestion.set/nabled"false#E &t(t-ption1.set/nabled"false#E &t(t-ption,.set/nabled"false#E &t(t-ption5.set/nabled"false#E &t(t-ption8.set/nabled"false#E &rb-ption1.set/nabled"false#E &rb-ption,.set/nabled"false#E &rb-ption5.set/nabled"false#E &rb-ption8.set/nabled"false#E U void enableAll"# L &t(tTest$ame.set/nabled"true#E &t(t[uestion.set/nabled"true#E &t(t-ption1.set/nabled"true#E &t(t-ption,.set/nabled"true#E &t(t-ption5.set/nabled"true#E &t(t-ption8.set/nabled"true#E &rb-ption1.set/nabled"true#E &rb-ption,.set/nabled"true#E &rb-ption5.set/nabled"true#E &rb-ption8.set/nabled"true#E UU 3.3 Student window contains su)ject&ist and test for t%e student 3.3.1 -rmp&a'test.ja"a import &ava(.swin%.KE import &ava(.swin%.event.KE import &ava.awt.KE import &ava.awt.event.KE import &ava.sql.KE Automated Test 8? import &ava.util.*ateE import &ava.te(t.Simple*ate'ormatE import &ava.te(t.*ate'ormatE import &ava.util.+alendarE import &ava.util.TimeToneE public class frm7layTest e(tends A'rame implements ActionIistener L +onnection connconn1conn,E Statement ststtst,E ResultSet rsE boolean editMfalseE Strin% usernameMNNE double totalmarkstmM;.;nmE int qnocountqtfinE int osrnoattptM;skippedM;E Strin% topic1time11E int snumberE lon% startTimeE *imension screen M Toolkit.%et*efaultToolkit"#.%etScreenSi)e"#E AIabel time M new AIabel"NN#E Ima%eIcon bu%1 M new Ima%eIcon"NIma%es=opi.%ifN#E AIabel &lblMnew AIabel"bu%1#E Ima%eIcon bu%, M new Ima%eIcon"NIma%es=beat.pn%N#E AIabel &lbl1Mnew AIabel"bu%,#E AIabel &lblspace1Mnew AIabel"NN#E AIabel &lbl[uestion$oMnew AIabel"N[uestion $o 2 N#E AIabel &lbl[uestionMnew AIabel"N[uestionN#E 3utton9roup %rpMnew 3utton9roup"#E ARadio3utton &rb-ption1Mnew ARadio3utton"N-ption 12N#E ARadio3utton &rb-ption,Mnew ARadio3utton"N-ption ,2N#E ARadio3utton &rb-ption5Mnew ARadio3utton"N-ption 52N#E ARadio3utton &rb-ption8Mnew ARadio3utton"N-ption 82N#E A3utton bttnStartMnew A3utton"NStartN#E Automated Test <; A3utton bttnSkipMnew A3utton"NSkipN#E A3utton bttn$e(tMnew A3utton"N$e(tN#E A3utton bttn+loseMnew A3utton"N+loseN#E A7anel firstMnew A7anel"#E A7anel secondMnew A7anel"#E A7anel thirdMnew A7anel"#E public frm7layTest"int snoStrin% unStrin% topStrin% nStrin% t # L nm M *ouble.parse*ouble"n#E &lbl[uestion.set'ont"new 'ont"N9eor%iaN'ont.3-I*,5##E &lbl[uestion$o.set'ont"new 'ont"N9eor%iaN'ont.3-I*,5##E &lbl[uestion$o.setGisible"false#E &lbl[uestion.setGisible"false#E &rb-ption1.set'ont"new 'ont"NArialN'ont.3-I*,5##E &rb-ption1.setGisible"false#E &rb-ption,.set'ont"new 'ont"NArialN'ont.3-I*,5##E &rb-ption,.setGisible"false#E &rb-ption5.set'ont"new 'ont"NArialN'ont.3-I*,5##E &rb-ption5.setGisible"false#E &rb-ption8.set'ont"new 'ont"NArialN'ont.3-I*,5##E &rb-ption8.setGisible"false#E time.set'ont"new 'ont"NSansSerifN'ont.3-I* 5@##E time.setGisible"false#E &lbl.set3ack%round"+olor..:IT/#E topic1 M topE usernameMunE snumberMsnoE time11MtE Strin% ss1Mtime11.substrin%";1#E int t1MInte%er.parseInt"ss1#E Strin% ss,Mtime11.substrin%",5#E int t,MInte%er.parseInt"ss,#E int inde( M time11.inde(-f"N2N5#E Automated Test <1 char particular M time11.charAt"8#E Strin% ss5Mtime11.substrin%"8<#E int t5MInte%er.parseInt"ss5#E tfinM"t1K5@;;#F"t,K@;#Ft5E tryL *ate'ormat formatter M new Simple*ate'ormat"Nhh2mm2ssN#E *ate dt M "*ate#formatter.parse"time11#E U catch"/(ception e# L System.out.println"NerrorN#E U tryL +lass.for$ame"Nsun.&dbc.odbc.Adbc-dbc*riverN#E connM*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E U catch"/(ception e(# L System.out.println"N.ron% dsnnameNFe(#E U setSi)e"screen.widthscreen.hei%ht#E setTitle"username F N is playin% test.N#E setIayout"null#E 9rid3a%Iayout %lMnew 9rid3a%Iayout"#E 9rid3a%+onstraints %bcMnew 9rid3a%+onstraints"#E first.setIayout"null#E first.set3ack%round"new +olor";,5<?;##E first.set3ounds"11screen.width!1;screen.hei%ht=5#E add"first#E time.set'ore%round"+olor.4A9/$TA#E time.set3ounds"1;;;5;<;;5;;#E first.add"time#E &lbl1.set3ounds"8;;D;<8D?<#E first.add"&lbl1#E &lbl[uestion$o.set3ounds"8;;<;5;;1;;#E first.add"&lbl[uestion$o#E &lbl[uestion.set3ounds"8;;?;@;;1;;#E Automated Test <, first.add"&lbl[uestion#E second.setIayout"null#E second.set3ack%round"+olor.white#E second.set3ounds"11F"screen.hei%ht=5#screen.width!1;screen.hei%ht=5#E add"second#E &rb-ption1.set3ack%round"+olor.white#E &rb-ption,.set3ack%round"+olor.white#E &rb-ption5.set3ack%round"+olor.white#E &rb-ption8.set3ack%round"+olor.white#E %rp.add"&rb-ption1#E %rp.add"&rb-ption,#E %rp.add"&rb-ption5#E %rp.add"&rb-ption8#E &rb-ption1.set3ounds"<;;@;5;;D;#E second.add"&rb-ption1%bc#E &rb-ption,.set3ounds"D;;@;5;;D;#E second.add"&rb-ption,%bc#E &rb-ption5.set3ounds"<;;1555;;D;#E second.add"&rb-ption5%bc#E &rb-ption8.set3ounds"D;;1555;;D;#E second.add"&rb-ption8%bc#E &lbl.set3ounds"<;;1;5;;,5B#E &lbl.set'ore%round"+olor..:IT/#E second.add"&lbl%bc#E third.setIayout"null#E third.set3ack%round"new +olor",5<1?;<;##E third.set3ounds"11F"screen.hei%ht=5#K,screen.width!1;screen.hei%ht=5#E add"third#E bttnStart.set3ounds"<;;D;B;8;#E third.add"bttnStart#E bttnSkip.set3ounds"@;;D;B;8;#E third.add"bttnSkip#E bttn$e(t.set3ounds"B;;D;B;8;#E Automated Test <5 third.add"bttn$e(t#E bttn+lose.set3ounds"D;;D;B;8;#E third.add"bttn+lose#E tryL stMconn.createStatement"#E sttMconn.createStatement"#E U catch"/(ception e# L System.out.println"Nplay test NFe#E U set3ack%round"+olor.white#E setGisible"true#E bttnSkip.set/nabled"false#E bttn$e(t.set/nabled"false#E bttnStart.addActionIistener"this#E bttnSkip.addActionIistener"this#E bttn$e(t.addActionIistener"this#E bttn+lose.addActionIistener"this#E U public void action7erformed"Action/vent ae# L Strin% strMae.%etAction+ommand"#E if"str.equals"NStartN##L &lbl.setGisible"false#E &lbl1.setGisible"false#E &lbl[uestion$o.setGisible"true#E &lbl[uestion.setGisible"true#E &rb-ption1.setGisible"true#E &rb-ption,.setGisible"true#E &rb-ption5.setGisible"true#E &rb-ption8.setGisible"true#E time.setGisible"true#E tryL Automated Test <8 rsMst.e(ecute[uery"Nselect count"Test$ame# from tblTest where Test$ameMQNF topic1 F NQN#E if"rs.ne(t"## L countqMrs.%etInt"1#E U /lse L countqM;E U startTime M System.currentTime4illis"#E new Thread"new Runnable"# L public void run"# L try L updateTime"tfin#E U catch "/(ception ie# L U UU#.start"#E rsMst.e(ecute[uery"Nselect K from tblTest where Test$ameMQNF topic1 F NQN#E if"rs.ne(t"## L qnoM1E totalmarksM;E &lbl[uestion$o.setTe(t"N[uestion $umber 2 N F qno#E &lbl[uestion.setTe(t"NShtmlPNFN[uestion 2 NFrs.%etStrin%",#.trim"#FNS=htmlPN#E oMrs.%etInt"5#E &rb-ption1.setTe(t"NShtmlPNFrs.%etStrin%"8#.trim"#FNS=htmlPN#E &rb-ption,.setTe(t"NShtmlPNFrs.%etStrin%"<#.trim"#FNS=htmlPN#E &rb-ption5.setTe(t"NShtmlPNFrs.%etStrin%"@#.trim"#FNS=htmlPN#E &rb-ption8.setTe(t"NShtmlPNFrs.%etStrin%"B#.trim"#FNS=htmlPN#E tmFFE bttnSkip.set/nabled"true#E bttn$e(t.set/nabled"true#E bttnStart.set/nabled"false#E U elseL A-ption7ane.show4essa%e*ialo%"nullN$o [uestion foundZZZN N$++/+R4S!7layin% TestN A-ption7ane.7IAI$X4/SSA9/#E UU Automated Test << catch"/(ception e#L A-ption7ane.show4essa%e*ialo%"nullN/(ception cau%ht 2 NFe N$++/+R4S! /(ceptionN A-ption7ane.7IAI$X4/SSA9/#E UU else if"str.equals"N$e(tN##L if"&rb-ption1.isSelected"#MMfalse RR &rb-ption,.isSelected"#MMfalse RR &rb-ption5.isSelected"#MMfalse RR &rb-ption8.isSelected"#MMfalse# A-ption7ane.show4essa%e*ialo%"nullN:ey u will lose scratch ur mindelse press skipN#E elseL attptFFE tryL int caM;E if"&rb-ption1.isSelected"#MMtrue# L caM1E U else if"&rb-ption,.isSelected"#MMtrue# L caM,E U else if"&rb-ption5.isSelected"#MMtrue# L caM5E U else if"&rb-ption8.isSelected"#MMtrue# L caM8E U Strin% sqM&lbl[uestion.%etTe(t"#E int endqMsq.inde(-f"QSQ,#E sqMsq.substrin%"1Bendq#E Strin% s1M&rb-ption1.%etTe(t"#E int end1Ms1.inde(-f"QSQ,#E s1Ms1.substrin%"@end1#E Strin% s,M&rb-ption,.%etTe(t"#E int end,Ms,.inde(-f"QSQ,#E s,Ms,.substrin%"@end,#E Strin% s5M&rb-ption5.%etTe(t"#E int end5Ms5.inde(-f"QSQ,#E s5Ms5.substrin%"@end5#E Strin% s8M&rb-ption8.%etTe(t"#E Automated Test <@ int end8Ms8.inde(-f"QSQ,#E s8Ms8.substrin%"@end8#E conn1M*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E sttMconn1.createStatement"#E stt.e(ecuteUpdate"Ninsert into tblTestResultTran values"N F snumber F NQNFsqFNQN F o F NQN F s1 F NQQN F s, F NQQN F s5 F NQQN F s8 F NQN F ca F N#N#E if"""oMM1#RR"&rb-ption1.isSelected"###YY""oMM,#RR"&rb-ption,.isSelected"###YY ""oMM5#RR"&rb-ption5.isSelected"###YY""oMM8#RR"&rb-ption8.isSelected"#### L totalmarksFFE U else L totalmarksMtotalmarks!nm E U %rp.clearSelection"#E if"rs.ne(t"##L &rb-ption1.setSelected"false#E &rb-ption,.setSelected"false#E &rb-ption5.setSelected"false#E &rb-ption8.setSelected"false#E qnoFFE &lbl[uestion$o.setTe(t"N[uestion $umber 2 N F qno#E &lbl[uestion.setTe(t"NShtmlPNFN[uestion 2 NF rs.%etStrin%",#.trim"#FNS=htmlPN#E oMrs.%etInt"5#E &rb-ption1.setTe(t"NShtmlPNFrs.%etStrin%"8#.trim"#FNS=htmlPN#E &rb-ption,.setTe(t"NShtmlPNFrs.%etStrin%"<#.trim"#FNS=htmlPN#E &rb-ption5.setTe(t"NShtmlPNFrs.%etStrin%"@#.trim"#FNS=htmlPN#E &rb-ption8.setTe(t"NShtmlPNFrs.%etStrin%"B#.trim"#FNS=htmlPN#E tmFFE U elseL conn,M*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E st,Mconn,.createStatement"#E *ate d M new *ate"#E Automated Test <B st,.e(ecuteUpdate"Ninsert into tblTestResult GAIU/S"N F snumber F NQN F username F NQQN Ftopic1F NQN FcountqF NN F attptF NN F skipped F NN F tm F NN F totalmarks FNQNFdFNQ#N#E new Report"snumber#E dispose"#E bttnSkip.set/nabled"false#E bttn$e(t.set/nabled"false#E U &rb-ption1.setSelected"false#E &rb-ption,.setSelected"false#E &rb-ption5.setSelected"false#E &rb-ption8.setSelected"false#E U catch"/(ception e#L A-ption7ane.show4essa%e*ialo%"nullN/(ception cau%ht 2 NFe N$++/+R4S! /(ceptionN A-ption7ane.7IAI$X4/SSA9/#E UUU else if"str.equals"NSkipN##L skippedFFE tryL int caM;E if"&rb-ption1.isSelected"#MMtrue# L caM1E U else if"&rb-ption,.isSelected"#MMtrue# L caM,E U else if"&rb-ption5.isSelected"#MMtrue# L caM5E U else if"&rb-ption8.isSelected"#MMtrue# L caM8E U Strin% sqM&lbl[uestion.%etTe(t"#E int endqMsq.inde(-f"QSQ,#E sqMsq.substrin%"1Bendq#E Strin% s1M&rb-ption1.%etTe(t"#E Automated Test <D int end1Ms1.inde(-f"QSQ,#E s1Ms1.substrin%"@end1#E Strin% s,M&rb-ption,.%etTe(t"#E int end,Ms,.inde(-f"QSQ,#E s,Ms,.substrin%"@end,#E Strin% s5M&rb-ption5.%etTe(t"#E int end5Ms5.inde(-f"QSQ,#E s5Ms5.substrin%"@end5#E Strin% s8M&rb-ption8.%etTe(t"#E int end8Ms8.inde(-f"QSQ,#E s8Ms8.substrin%"@end8#E %rp.clearSelection"#E conn1M*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E sttMconn1.createStatement"#E stt.e(ecuteUpdate"Ninsert into tblTestResultTran values"N F snumber F NQNFsqFNQN F o F NQN F s1F NQQN F s, F NQQN F s5 F NQQN F s8 F NQN F ca F N#N#E if"rs.ne(t"##L &rb-ption1.setSelected"false#E &rb-ption,.setSelected"false#E &rb-ption5.setSelected"false#E &rb-ption8.setSelected"false#E qnoFFE &lbl[uestion$o.setTe(t"N[uestion $umber 2 N F qno#E &lbl[uestion.setTe(t"NShtmlPNFN[uestion 2 N Frs.%etStrin%",#FNS=htmlPN#E &rb-ption1.setTe(t"NShtmlPNFrs.%etStrin%"8#.trim"#FNS=htmlPN#E &rb-ption,.setTe(t"NShtmlPNFrs.%etStrin%"<#.trim"#FNS=htmlPN#E &rb-ption5.setTe(t"NShtmlPNFrs.%etStrin%"@#.trim"#FNS=htmlPN#E &rb-ption8.setTe(t"NShtmlPNFrs.%etStrin%"B#.trim"#FNS=htmlPN#E tmFFE U elseL *ate d M new *ate"#E conn,M*river4ana%er.%et+onnection"N&dbc2odbc2onlineNNsaNNpasswordN#E Automated Test <? st,Mconn,.createStatement"#E st,.e(ecuteUpdate"Ninsert into tblTestResult GAIU/S"N F snumber F NQN F username F NQQN Ftopic1F NQN FcountqF NN F attptF NN F skipped F NN F tm F NN F totalmarks FNQNFdFNQ#N#E new Report"snumber#E dispose"#E bttnSkip.set/nabled"false#E bttn$e(t.set/nabled"false#E UU catch"/(ception e#L A-ption7ane.show4essa%e*ialo%"nullN/(ception cau%ht 2 NFe N$++/+R4S! /(ceptionN A-ption7ane.7IAI$X4/SSA9/#E UU else if"str.equals"N+loseN##L dispose"#E UU public void updateTime"int c#L tryL int countq1McE while"countq1P;#L time.setTe(t"%etTime/lapsed"##E Thread.currentThread"#.sleep"1;;;#E countq1!!E U time.setTe(t"NTime -ver...N#E while"bttnSkip.is/nabled"## L bttnSkip.do+lick"#E UU catch "/(ception e#L System.out.println"N/(ception in Thread Sleep 2 NFe#E UU public Strin% %etTime/lapsed"#L lon% elapsedTime M System.currentTime4illis"# ! startTimeE Automated Test @; elapsedTime M elapsedTime = 1;;;E Strin% seconds M Inte%er.toStrin%""int#"elapsedTime C @;##E Strin% minutes M Inte%er.toStrin%""int#""elapsedTime C 5@;;# = @;##E Strin% hours M Inte%er.toStrin%""int#"elapsedTime = 5@;;##E if "seconds.len%th"# S ,# seconds M N;N F secondsE if "minutes.len%th"# S ,# minutes M N;N F minutesE if "hours.len%th"# S ,# hours M N;N F hoursE return hoursFN2NFminutesFN2NFsecondsE UU 3.3.2 Report.ja"a import &ava.awt.KE import &ava.awt.event.KE import &ava(.swin%.KE import &ava(.swin%.event.KE public class Report e(tends A'rame implements ActionIistener L private AIabel lbl3ck%rndE private AIabel l1l,l5l8l<l@lBlDl?l1;l11l1,l15E A3utton b1 M new A3utton"N-ON#E +ontainer content7aneE int snE double aE +onnect connE Strin% s1 M new Strin%"#E Strin% s, M new Strin%"#E Strin% s5 M new Strin%"#E Strin% s8 M new Strin%"#E Strin% s< M new Strin%"#E Strin% s@ M new Strin%"#E Automated Test @1 Strin% s? M new Strin%"#E *ouble sBE *ouble sDE public Report"int n#L super"NResults TimeN#E snMnE content7ane M %et+ontent7ane"#E content7ane.setIayout"new 'lowIayout"##E try L connMnew +onnect"#E U catch"/(ception e(cep# L System.out.println"N:ellothere is an e(ceptionN#E U tryL conn.setresult"sn#E while"+onnect.rs.ne(t"## L s1M+onnect.rs.%etStrin%"NSr$oN#E s,M+onnect.rs.%etStrin%"NUserX$ameN#E s5M+onnect.rs.%etStrin%"NTestX$ameN#E s8M+onnect.rs.%etStrin%"NTotalX[uestionsN#E s<M+onnect.rs.%etStrin%"NAttemptN#E s@M+onnect.rs.%etStrin%"NSkippedN#E sBM+onnect.rs.%et*ouble"NTotalX4arksN#E sDM+onnect.rs.%et*ouble"N4arksX-btainedN#E U U catch"/(ception ec# L System.out.println"N:ey there is an e(ceptionNFec#E U Ima%eIcon bu%1 M new Ima%eIcon"NIma%es=3ck%nd<.pn%N#E lbl3ck%rnd M new AIabel"bu%1#E lbl3ck%rnd.setIayout"null#E content7ane.add"lbl3ck%rnd#E Ima%eIcon bu%, M new Ima%eIcon"NIma%es=cry1.pn%N#E l11 M new AIabel"bu%,#E l11.setGisible"false#E Automated Test @, lbl3ck%rnd.add"l11#E l11.set3ounds"D;5@;1@81@8#E Ima%eIcon bu%5 M new Ima%eIcon"NIma%es=smile1.&pe%N#E l1, M new AIabel"bu%5#E l1,.setGisible"false#E lbl3ck%rnd.add"l1,#E l1,.set3ounds"D;5@;1@81@8#E Ima%eIcon bu%8 M new Ima%eIcon"NIma%es=av%.&pe%N#E l15 M new AIabel"bu%8#E l15.setGisible"false#E lbl3ck%rnd.add"l15#E l15.set3ounds"D;5@;1@81@8#E l1 M new AIabel"NResult Time ZZZN#E l1.set'ont"new 'ont"N9eor%iaN'ont.3-I*5;##E l1.set3ounds",;;;8;;B;#E lbl3ck%rnd.add"l1#E l, M new AIabel"NK User $ame 2NFN N Fs,#E l,.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E l,.set3ounds"5;B;<;;B;#E lbl3ck%rnd.add"l,#E l5 M new AIabel"NK Serial $umber 2N F N NFs1#E l5.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E l5.set3ounds"5;1;;8;;B;#E lbl3ck%rnd.add"l5#E l8 M new AIabel"NK Sub&ect +hosen 2NFN NFs5#E l8.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E l8.set3ounds"5;15;<;;B;#E lbl3ck%rnd.add"l8#E l< M new AIabel"NK Total $umber of [uestions 2NFN NFs8#E l<.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E l<.set3ounds"5;1@;8;;B;#E lbl3ck%rnd.add"l<#E l@ M new AIabel"NK $umber of [uestions Attempted 2NFN NFs<#E Automated Test @5 l@.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E l@.set3ounds"5;1?;8;;B;#E lbl3ck%rnd.add"l@#E lB M new AIabel"NK $umber of [uestions Skipped 2NFN NFs@#E lB.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E lB.set3ounds"5;,,;8;;B;#E lbl3ck%rnd.add"lB#E lD M new AIabel"NK Total 4arks 2NFN NFsB#E lD.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E lD.set3ounds"5;,<;8;;B;#E lbl3ck%rnd.add"lD#E l? M new AIabel"NK 4arks -btained 2NFN NFsD#E l?.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E l?.set3ounds"5;,D;8;;B;#E lbl3ck%rnd.add"l?#E a M "sD=sB#K1;;E if"aP<;# L s? M N7assNE l1,.setGisible"true#E U else if"a MM <;# L s? M NAvera%eNE l15.setGisible"true#E U else if"aS<;# L s? M N'ailNE l11.setGisible"true#E U l1; M new AIabel"NK Result 2NF N NFs? #E l1;.set'ont"new 'ont"N9eor%iaN'ont.3-I*1@##E l1;.set3ounds"5;51;8;;B;#E lbl3ck%rnd.add"l1;#E b1.set3ounds"1,<<5;@;,5#E lbl3ck%rnd.add"b1#E b1.addActionIistener"this#E setResi)able"true#E Automated Test @8 set3ounds",B< @; D,; @5;#E setGisible"true#E U public void action7erformed"Action/vent e# L -b&ect o M e.%etSource"#E if"o MM b1#L tryL int selected-ption M A-ption7ane.show+onfirm*ialo%"null N*o you wanna %ive any feedback\N N+hooseN A-ption7ane.J/SX$-X-7TI-$#E if "selected-ption MM A-ption7ane.$-X-7TI-$# L dispose"#E U if "selected-ption MM A-ption7ane.J/SX-7TI-$# L new 'eedback"#E dispose"#E UU catch"/(ception e(c#L System.out.println"N/(ceptionNFe(c#E UUUU
Automated Test @<
C%apter # Testin! , *e)u!!in!
#.1 Introduction to Testin! Testin% presents an interestin% anomaly for the software en%ineer. *urin% earlier software en%ineerin% activities the en%ineer attempts to build software from an abstract concept to a tan%ible product. $ow comes testin%. The en%ineer creates a series of test cases that are intended to 0demolish1 the software that has been built. In fact testin% is the one step in the software process that could be viewed "psycholo%ically at least# as destructive rather than constructive. Software en%ineers are by their nature constructive people. Testin% requires that the developer discard preconceived notions of the 0correctness1 of software &ust developed and overcome a conflict of interest that occurs when errors are uncovered. Automated Test @@ If testin% is conducted successfully "accordin% to the ob&ectives stated previously# it will uncover errors in the software .As a secondary benefit testin% demonstrates that software functions appear to be workin% accordin% to specification that behavioral and performance requirements appear to have been met. In addition data collected as testin% is conducted provide a %ood indication of software reliability and some indication of software quality as a whole. 3ut testin% cannot show the absence of errors and defects it can show only that software errors and defects are present. It is important to keep this "rather %loomy# statement in mind as testin% is bein% conducted. #.2 Testin! princip&es 3efore applyin% methods to desi%n effective test cases a software en%ineer must understand the basic principle that %uide software testin%2 All tests should be traceable to customer requirements.Tests should be planned lon% before testin% be%ins D; percent of all errors uncovered durin% testin% will likely be traceable to ,; percent of all pro%ram components. The problem of course is to isolate these suspect components and to thorou%hly test them. Testin% should bein% 0in the small1 and pro%ress toward testin% 0in the lar%e1. /(haustive testin% is not possible.To be most effective an independent third party should conduct testin%.A rich variety of test case desi%n methods have evolved for software. These methods provide the developer with a systematic approach to testin%. 4ore important methods provide a mechanism that can help to ensure the completeness of tests and provide the hi%hest likelihood for uncoverin% errors in software. Any en%ineered product "and most other thin%s# can be tested in one of two ways2 Onowin% the specified function that a product has been desi%ned to perform tests can be conducted that demonstrate each function is fully operational..hile at the same time searchin% for errors in each functionE ",# knowin% the internal ..orkin% of a product tests can be conducted to ensure that 0all %ears mesh1 that is internal operations are performed accordin% to specifications and all internal components have been adequately e(ercised. The first test approach is called black bo( testin% and the second white!bo( testin%. #.3 -unctiona& testin! Automated Test @B #.3.1 /2IT TESTI26 In unit testin% I have testin% a sin%le pro%ram module in an isolated environment. Testin% of the processin% procedures is the main focus. Inte%ration Testin% 3ecause of interfaces amon% the system modules we use inte%ration testin%. In other word>s it ensures that the data movin% between the modules is handled as intended. #.3.2 S4STE$ TESTI26 *urin% system testin% the system is used e(perimentally to ensure that the software does not fail i.e. it will run accordin% to its specifications and in the way users e(pect. Special test data are input for the processin% and the results e(amine. A limited number of users try to use it in unforeseen ways. It is preferable to discover any surprise before the or%ani)ation implements the system and depend upon it. In many or%ani)ations persons other than those who wrote the ori%inal pro%rams to ensure more complete and unbiased testin% and more reliable testin% perform testin%. The norms that were followed durin% the phase were that after the developer of the software has satisfied re%ardin% every aspect of the software under consideration he is required to release the pro%ram source code. A setup name release is used to copy the name file from the developers> user area to a pro&ect area in the directory named with developer user name. :ere the entire final testin% used to be done by persons other than the developer himself .if some chan%es were desired in the pro%ram the developer were required to use another setup. Retrieve which copied back the latest version of the pro%ram to developer areas. As in this system data is entered at different levels I considered providin% various types of checks like ran%e check validity check completeness check etc. in different data entry screens accordin% to the requirements. Since the user is not familiar to the new system the data screens were desi%ned in such a way that were2 +onsistent /asy to use :as a fast response time System testin% is the testin% of the system a%ainst its initial ob&ective. It is done either in a simulated environment or in live environment. Automated Test @D #.# T4PES - TESTI26 TECH2I9/ES .hite bo( testin% 3lack bo( testin% #.#.1 5HITE :; TESTI26 .hite bo( testin% focus on the pro%ram control structure .Test cases are derived to ensure that all statement in the pro%ram has been e(ecuted at least once durin% testin% and that all lo%ical condition has been e(ercised. 3asic path testin% a white bo( testin% makes use of pro%ram %raph to derive the set of linearly independent test that will ensure covera%e. #.#.2 :0AC< :; TESTI26 3lack bo( testin% focuses on the functional requirements of the software. That is black! bo( testin% enable the software en%ineer to derive set of input conditions that will fully e(ercise all functional requirements for a pro%ram. #.+ TEST CASE Automated Test @? Automated Test B;
Automated Test B1
C%apter +( Snaps%ots and Resu&t +.1 Start Pa!e inc&udin! pro!ress )ar screen and aut%entication window <.1.1 Start Screen Automated Test B, <.1., 7ro%ress 3ar <.1.5 Authentication .indow +.2 Admin windows inc&ude a&& contro&s of admin <.,.1 Admin control window <.,., Settin% the e(am Automated Test B5 <.,.5 Student details <.,.8 [uestion bank +.3 Student window contains su)ject&ist and test for t%e student Automated Test B8 <.5.1 Sub&ect Iist <.5., Rules of Test Automated Test B< <.5.5 /(am window <.5.8 [uestion paper Automated Test B@ <.5.< Result window <.5.@ 'eedback form Automated Test BB
C%apter =( Conc&usion and -uture wor8 Automated Test BD @.1 Conc&usion , -uture wor8 It has been a %reat pleasure for me to work on this e(citin% and challen%in% pro&ect. This pro&ect proved %ood for me as it provided practical knowled%e of not only pro%rammin% in AAGA a Standalone based application and 4JS[I but also about all handlin% procedure related with >Automated Test?. It also provides knowled%e about the latest technolo%y used in developin% standalone application. This will provide better opportunities and %uidance in future in developin% pro&ects independently. The pro&ect is identified by the merits of the system offered to the user. The merits of this pro&ect are as follows2 ! It>s a standalone application pro&ect. This pro&ect offers user to test himself throu%h simple and interactive forms. This is very helpful for the user to check his knowled%e with so much simplicity. Sometimes the Admin finds in the later sta%es of usin% pro&ect that he needs to update some of the information that he entered earlier. There are options for him by which he can update the records. Admin is provided the option of monitorin% the records he entered earlier. :e can see the desired records. 'rom every part of the pro&ect the user is provided with the links throu%h framin% so that he can %o from one option of the pro&ect to other as per the requirement. This is bound to be simple and very friendly as per the user is concerned. That is we can sat that the pro&ect is user friendly which is one of the primary concerns of any %ood pro&ect. *ata stora%e and retrieval will become faster and easier to maintain because data is stored in a systematic manner and in a sin%le database. *ecision makin% process would be %reatly enhanced because of faster processin% of information since data collection from information available on computer takes much less time then manual system. Throu%h these features it will increase the efficiency accuracy and transparency Automated Test B? C%apter @( References Automated Test D; @.1 RE-ERE2CES @.1.1 3AAA( V1W Aava The +omplete Reference D th /dition 7atrick $au%hton and :erbert Schildt -sborne=4c9raw!:ill 7ublication ,;;< V,W A.T 7ro%rammin% for Aava , nd /dition 4iles -Q$eal and Tom Stewart 4 R T 3ooks 7ublication ,;;; V5W Aava *atabase 7ro%rammin% 1 st /dition 3rian Aepson Aohn .iley R Sons 7ublication 1??@ V8W :ead 'irst Aava , nd /dition Oathy Sierra and 3ert 3ates .ro( 7ublication ,;;8 @.1.2 S'stem *e"e&opment( V<W Aerry 'it) 9erald 'undamentals of System +oncepts V@W /lias 4 Awad System Analysis and *esi%n VBW Ro%er 7 7ressman Software /n%ineerin%2 Automated Test D1