Post on 11-Nov-2021
California State University San Bernardino California State University San Bernardino
CSUSB ScholarWorks CSUSB ScholarWorks
Theses Digitization Project John M Pfau Library
2002
Web-based interactive self-evaluation system for computer Web-based interactive self-evaluation system for computer
science in generic tutorial system for the sciences project science in generic tutorial system for the sciences project
Supachai Praritsantik
Follow this and additional works at httpsscholarworkslibcsusbeduetd-project
Part of the Computer Engineering Commons
Recommended Citation Recommended Citation Praritsantik Supachai Web-based interactive self-evaluation system for computer science in generic tutorial system for the sciences project (2002) Theses Digitization Project 2273 httpsscholarworkslibcsusbeduetd-project2273
This Project is brought to you for free and open access by the John M Pfau Library at CSUSB ScholarWorks It has been accepted for inclusion in Theses Digitization Project by an authorized administrator of CSUSB ScholarWorks For more information please contact scholarworkscsusbedu
WEB-BASED INTERACTIVE SELF-EVALUATION SYSTEM FOR COMPUTER
SCIENCE IN GENERIC TUTORIAL SYSTEM FOR THESCIENCES PROJECT
A Project Presented to the
Faculty ofCalifornia State University
San Bernardino
In Partial Fulfillmentof the Requirements for the Degree
Master of Science
inComputer Science
by
Supachai Praritsantik
March 2002
WEB-BASED INTERACTIVE SELF-EVALUATION SYSTEM FOR COMPUTER
SCIENCE IN GENERIC TUTORIAL SYSTEM FOR THE
SCIENCES PROJECT
A Project
Presented to the
Faculty ofCalifornia State University
San Bernardino
by ISupachai Praritsantik
March 2002i
Date
ABSTRACT
The goal of this master project Web-basedIInteractive Self-evaluated System (WISE) is to promote
and facilitate the use of new Java-based and Web-based
technologies in the development of teaching materials for
Computer Science in particular analysis of sorting
algorithms This project is built as part of the GenericTutorial System for the Sciences (GTSS) project WISEpromotes Web-based interactive exercises by providing
educators with the tools to create interactive exerciseImaterials 1
As part of GTSS project WISE provides both tutorialsand exercises Students can study the interactivetutorials and test the self-evaluation exercisesSelf-evaluation result indicates students understanding
WISE provides tools such as EZ question creator forIcreating question database and automatic exercises andknowledge base creator for creating new intelligent javaIprograms filled with how to createautomatic answer with prevented cheating policy (
WISE uses object oriented and unified modeling
language to design the system To implement WISE system
Java Server Pages (JSP) and MySQL are used JSP technology
makes WISE system possible to run over the Internet
iii
ACKNOWLEDGMENTS
I would like to thank Dr Concepcion my advisor for
guiding me in the steps I needed to take to get this master project done Also thanks to Dr Zemoudeh and
DrGeorgiou for the time they invested guiding me tocreate the question database
And thanks to the Associated studies Incorporated (ASI) for their grant to provide partial funding supportfor this project
Supachai Praritsantik
iv
TABLE OF CONTENTS
iiiviix
1122258
101313133637
37
47535960
ABSTRACT iACKNOWLEDGMENTS LIST OF TABLES viLIST OF FIGURES CHAPTER ONE SOFTWARE REQUIREMENT SPECIFICATION
11 Introduction 111 Purpose of Project 112 Scope of Project
12 Overall Project Description 121 Project Product 122 Functionality of Project I123 System Analysis and Requirements 124 Hardware and Software Requirement 125 User Characteristics
13 Software Specific Requirements 131 External Interface^
CHAPTER TWO DESIGN21 Architecture Design i
221 Sorting Algorithm Tutorials Design rsquo
i212 Interactive Self-Evaluation System Design
i213 Database Design 22 Detailed Design
221 Connect Database C)_ass
v
2222
222222222222222222222 22222222222
CHAPTER THREE
2 Query Bean Class 3 Data ManipulationClass
I4 Connect File Class-5 File Bean Class 1 6 Read File Bean Class I7 Score Bean Class I8 Create Choice Class (9 Shuffle Class 10 Random Number Class
I11 Add Question General Class i12 Add Question Java Class
i13 Question Retrieval Manager Class 14 Question GeneralClass 15 Question Java Class
I16 Table of ContentiCheck Class 17 Knowledge Base Check Class 18 Knowledge Base Deletion Class 19 User Information|Class
iTESTING
616365666768697071727476787983858889
33333
12345-
The Testing Process bull iUnit Testing I
Subsystem Testing tiSystem Testing I
Sample Session I
351 Demonstration of Tutorial
9595
100101102102
vi
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
WEB-BASED INTERACTIVE SELF-EVALUATION SYSTEM FOR COMPUTER
SCIENCE IN GENERIC TUTORIAL SYSTEM FOR THESCIENCES PROJECT
A Project Presented to the
Faculty ofCalifornia State University
San Bernardino
In Partial Fulfillmentof the Requirements for the Degree
Master of Science
inComputer Science
by
Supachai Praritsantik
March 2002
WEB-BASED INTERACTIVE SELF-EVALUATION SYSTEM FOR COMPUTER
SCIENCE IN GENERIC TUTORIAL SYSTEM FOR THE
SCIENCES PROJECT
A Project
Presented to the
Faculty ofCalifornia State University
San Bernardino
by ISupachai Praritsantik
March 2002i
Date
ABSTRACT
The goal of this master project Web-basedIInteractive Self-evaluated System (WISE) is to promote
and facilitate the use of new Java-based and Web-based
technologies in the development of teaching materials for
Computer Science in particular analysis of sorting
algorithms This project is built as part of the GenericTutorial System for the Sciences (GTSS) project WISEpromotes Web-based interactive exercises by providing
educators with the tools to create interactive exerciseImaterials 1
As part of GTSS project WISE provides both tutorialsand exercises Students can study the interactivetutorials and test the self-evaluation exercisesSelf-evaluation result indicates students understanding
WISE provides tools such as EZ question creator forIcreating question database and automatic exercises andknowledge base creator for creating new intelligent javaIprograms filled with how to createautomatic answer with prevented cheating policy (
WISE uses object oriented and unified modeling
language to design the system To implement WISE system
Java Server Pages (JSP) and MySQL are used JSP technology
makes WISE system possible to run over the Internet
iii
ACKNOWLEDGMENTS
I would like to thank Dr Concepcion my advisor for
guiding me in the steps I needed to take to get this master project done Also thanks to Dr Zemoudeh and
DrGeorgiou for the time they invested guiding me tocreate the question database
And thanks to the Associated studies Incorporated (ASI) for their grant to provide partial funding supportfor this project
Supachai Praritsantik
iv
TABLE OF CONTENTS
iiiviix
1122258
101313133637
37
47535960
ABSTRACT iACKNOWLEDGMENTS LIST OF TABLES viLIST OF FIGURES CHAPTER ONE SOFTWARE REQUIREMENT SPECIFICATION
11 Introduction 111 Purpose of Project 112 Scope of Project
12 Overall Project Description 121 Project Product 122 Functionality of Project I123 System Analysis and Requirements 124 Hardware and Software Requirement 125 User Characteristics
13 Software Specific Requirements 131 External Interface^
CHAPTER TWO DESIGN21 Architecture Design i
221 Sorting Algorithm Tutorials Design rsquo
i212 Interactive Self-Evaluation System Design
i213 Database Design 22 Detailed Design
221 Connect Database C)_ass
v
2222
222222222222222222222 22222222222
CHAPTER THREE
2 Query Bean Class 3 Data ManipulationClass
I4 Connect File Class-5 File Bean Class 1 6 Read File Bean Class I7 Score Bean Class I8 Create Choice Class (9 Shuffle Class 10 Random Number Class
I11 Add Question General Class i12 Add Question Java Class
i13 Question Retrieval Manager Class 14 Question GeneralClass 15 Question Java Class
I16 Table of ContentiCheck Class 17 Knowledge Base Check Class 18 Knowledge Base Deletion Class 19 User Information|Class
iTESTING
616365666768697071727476787983858889
33333
12345-
The Testing Process bull iUnit Testing I
Subsystem Testing tiSystem Testing I
Sample Session I
351 Demonstration of Tutorial
9595
100101102102
vi
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
WEB-BASED INTERACTIVE SELF-EVALUATION SYSTEM FOR COMPUTER
SCIENCE IN GENERIC TUTORIAL SYSTEM FOR THE
SCIENCES PROJECT
A Project
Presented to the
Faculty ofCalifornia State University
San Bernardino
by ISupachai Praritsantik
March 2002i
Date
ABSTRACT
The goal of this master project Web-basedIInteractive Self-evaluated System (WISE) is to promote
and facilitate the use of new Java-based and Web-based
technologies in the development of teaching materials for
Computer Science in particular analysis of sorting
algorithms This project is built as part of the GenericTutorial System for the Sciences (GTSS) project WISEpromotes Web-based interactive exercises by providing
educators with the tools to create interactive exerciseImaterials 1
As part of GTSS project WISE provides both tutorialsand exercises Students can study the interactivetutorials and test the self-evaluation exercisesSelf-evaluation result indicates students understanding
WISE provides tools such as EZ question creator forIcreating question database and automatic exercises andknowledge base creator for creating new intelligent javaIprograms filled with how to createautomatic answer with prevented cheating policy (
WISE uses object oriented and unified modeling
language to design the system To implement WISE system
Java Server Pages (JSP) and MySQL are used JSP technology
makes WISE system possible to run over the Internet
iii
ACKNOWLEDGMENTS
I would like to thank Dr Concepcion my advisor for
guiding me in the steps I needed to take to get this master project done Also thanks to Dr Zemoudeh and
DrGeorgiou for the time they invested guiding me tocreate the question database
And thanks to the Associated studies Incorporated (ASI) for their grant to provide partial funding supportfor this project
Supachai Praritsantik
iv
TABLE OF CONTENTS
iiiviix
1122258
101313133637
37
47535960
ABSTRACT iACKNOWLEDGMENTS LIST OF TABLES viLIST OF FIGURES CHAPTER ONE SOFTWARE REQUIREMENT SPECIFICATION
11 Introduction 111 Purpose of Project 112 Scope of Project
12 Overall Project Description 121 Project Product 122 Functionality of Project I123 System Analysis and Requirements 124 Hardware and Software Requirement 125 User Characteristics
13 Software Specific Requirements 131 External Interface^
CHAPTER TWO DESIGN21 Architecture Design i
221 Sorting Algorithm Tutorials Design rsquo
i212 Interactive Self-Evaluation System Design
i213 Database Design 22 Detailed Design
221 Connect Database C)_ass
v
2222
222222222222222222222 22222222222
CHAPTER THREE
2 Query Bean Class 3 Data ManipulationClass
I4 Connect File Class-5 File Bean Class 1 6 Read File Bean Class I7 Score Bean Class I8 Create Choice Class (9 Shuffle Class 10 Random Number Class
I11 Add Question General Class i12 Add Question Java Class
i13 Question Retrieval Manager Class 14 Question GeneralClass 15 Question Java Class
I16 Table of ContentiCheck Class 17 Knowledge Base Check Class 18 Knowledge Base Deletion Class 19 User Information|Class
iTESTING
616365666768697071727476787983858889
33333
12345-
The Testing Process bull iUnit Testing I
Subsystem Testing tiSystem Testing I
Sample Session I
351 Demonstration of Tutorial
9595
100101102102
vi
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
ABSTRACT
The goal of this master project Web-basedIInteractive Self-evaluated System (WISE) is to promote
and facilitate the use of new Java-based and Web-based
technologies in the development of teaching materials for
Computer Science in particular analysis of sorting
algorithms This project is built as part of the GenericTutorial System for the Sciences (GTSS) project WISEpromotes Web-based interactive exercises by providing
educators with the tools to create interactive exerciseImaterials 1
As part of GTSS project WISE provides both tutorialsand exercises Students can study the interactivetutorials and test the self-evaluation exercisesSelf-evaluation result indicates students understanding
WISE provides tools such as EZ question creator forIcreating question database and automatic exercises andknowledge base creator for creating new intelligent javaIprograms filled with how to createautomatic answer with prevented cheating policy (
WISE uses object oriented and unified modeling
language to design the system To implement WISE system
Java Server Pages (JSP) and MySQL are used JSP technology
makes WISE system possible to run over the Internet
iii
ACKNOWLEDGMENTS
I would like to thank Dr Concepcion my advisor for
guiding me in the steps I needed to take to get this master project done Also thanks to Dr Zemoudeh and
DrGeorgiou for the time they invested guiding me tocreate the question database
And thanks to the Associated studies Incorporated (ASI) for their grant to provide partial funding supportfor this project
Supachai Praritsantik
iv
TABLE OF CONTENTS
iiiviix
1122258
101313133637
37
47535960
ABSTRACT iACKNOWLEDGMENTS LIST OF TABLES viLIST OF FIGURES CHAPTER ONE SOFTWARE REQUIREMENT SPECIFICATION
11 Introduction 111 Purpose of Project 112 Scope of Project
12 Overall Project Description 121 Project Product 122 Functionality of Project I123 System Analysis and Requirements 124 Hardware and Software Requirement 125 User Characteristics
13 Software Specific Requirements 131 External Interface^
CHAPTER TWO DESIGN21 Architecture Design i
221 Sorting Algorithm Tutorials Design rsquo
i212 Interactive Self-Evaluation System Design
i213 Database Design 22 Detailed Design
221 Connect Database C)_ass
v
2222
222222222222222222222 22222222222
CHAPTER THREE
2 Query Bean Class 3 Data ManipulationClass
I4 Connect File Class-5 File Bean Class 1 6 Read File Bean Class I7 Score Bean Class I8 Create Choice Class (9 Shuffle Class 10 Random Number Class
I11 Add Question General Class i12 Add Question Java Class
i13 Question Retrieval Manager Class 14 Question GeneralClass 15 Question Java Class
I16 Table of ContentiCheck Class 17 Knowledge Base Check Class 18 Knowledge Base Deletion Class 19 User Information|Class
iTESTING
616365666768697071727476787983858889
33333
12345-
The Testing Process bull iUnit Testing I
Subsystem Testing tiSystem Testing I
Sample Session I
351 Demonstration of Tutorial
9595
100101102102
vi
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
ACKNOWLEDGMENTS
I would like to thank Dr Concepcion my advisor for
guiding me in the steps I needed to take to get this master project done Also thanks to Dr Zemoudeh and
DrGeorgiou for the time they invested guiding me tocreate the question database
And thanks to the Associated studies Incorporated (ASI) for their grant to provide partial funding supportfor this project
Supachai Praritsantik
iv
TABLE OF CONTENTS
iiiviix
1122258
101313133637
37
47535960
ABSTRACT iACKNOWLEDGMENTS LIST OF TABLES viLIST OF FIGURES CHAPTER ONE SOFTWARE REQUIREMENT SPECIFICATION
11 Introduction 111 Purpose of Project 112 Scope of Project
12 Overall Project Description 121 Project Product 122 Functionality of Project I123 System Analysis and Requirements 124 Hardware and Software Requirement 125 User Characteristics
13 Software Specific Requirements 131 External Interface^
CHAPTER TWO DESIGN21 Architecture Design i
221 Sorting Algorithm Tutorials Design rsquo
i212 Interactive Self-Evaluation System Design
i213 Database Design 22 Detailed Design
221 Connect Database C)_ass
v
2222
222222222222222222222 22222222222
CHAPTER THREE
2 Query Bean Class 3 Data ManipulationClass
I4 Connect File Class-5 File Bean Class 1 6 Read File Bean Class I7 Score Bean Class I8 Create Choice Class (9 Shuffle Class 10 Random Number Class
I11 Add Question General Class i12 Add Question Java Class
i13 Question Retrieval Manager Class 14 Question GeneralClass 15 Question Java Class
I16 Table of ContentiCheck Class 17 Knowledge Base Check Class 18 Knowledge Base Deletion Class 19 User Information|Class
iTESTING
616365666768697071727476787983858889
33333
12345-
The Testing Process bull iUnit Testing I
Subsystem Testing tiSystem Testing I
Sample Session I
351 Demonstration of Tutorial
9595
100101102102
vi
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
TABLE OF CONTENTS
iiiviix
1122258
101313133637
37
47535960
ABSTRACT iACKNOWLEDGMENTS LIST OF TABLES viLIST OF FIGURES CHAPTER ONE SOFTWARE REQUIREMENT SPECIFICATION
11 Introduction 111 Purpose of Project 112 Scope of Project
12 Overall Project Description 121 Project Product 122 Functionality of Project I123 System Analysis and Requirements 124 Hardware and Software Requirement 125 User Characteristics
13 Software Specific Requirements 131 External Interface^
CHAPTER TWO DESIGN21 Architecture Design i
221 Sorting Algorithm Tutorials Design rsquo
i212 Interactive Self-Evaluation System Design
i213 Database Design 22 Detailed Design
221 Connect Database C)_ass
v
2222
222222222222222222222 22222222222
CHAPTER THREE
2 Query Bean Class 3 Data ManipulationClass
I4 Connect File Class-5 File Bean Class 1 6 Read File Bean Class I7 Score Bean Class I8 Create Choice Class (9 Shuffle Class 10 Random Number Class
I11 Add Question General Class i12 Add Question Java Class
i13 Question Retrieval Manager Class 14 Question GeneralClass 15 Question Java Class
I16 Table of ContentiCheck Class 17 Knowledge Base Check Class 18 Knowledge Base Deletion Class 19 User Information|Class
iTESTING
616365666768697071727476787983858889
33333
12345-
The Testing Process bull iUnit Testing I
Subsystem Testing tiSystem Testing I
Sample Session I
351 Demonstration of Tutorial
9595
100101102102
vi
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
2222
222222222222222222222 22222222222
CHAPTER THREE
2 Query Bean Class 3 Data ManipulationClass
I4 Connect File Class-5 File Bean Class 1 6 Read File Bean Class I7 Score Bean Class I8 Create Choice Class (9 Shuffle Class 10 Random Number Class
I11 Add Question General Class i12 Add Question Java Class
i13 Question Retrieval Manager Class 14 Question GeneralClass 15 Question Java Class
I16 Table of ContentiCheck Class 17 Knowledge Base Check Class 18 Knowledge Base Deletion Class 19 User Information|Class
iTESTING
616365666768697071727476787983858889
33333
12345-
The Testing Process bull iUnit Testing I
Subsystem Testing tiSystem Testing I
Sample Session I
351 Demonstration of Tutorial
9595
100101102102
vi
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
352 General Question Creator 353 Knowledge Base Creator 354 Easy Question Creator
CHAPTER FOUR MAINTENANCE MANUAL4 1 Files and Directories 42 Software Installation 43 System Migration 144 Database Maintenance 45 Recompilation
CHAPTER FIVE CONCLUSIONS AND FUTURE DIRECTIONS51 Conclusion52 Future Directions II
521 Adaptive Test i
522 Graphic Score Analyzer ]
APPENDIX GLOSSARY lI
REFERENCES
103104105
107108109110111
113114114
115116120
vii
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
LIST OF TABLES
Table 11
Table 12
Table 13
Table 14
Table 21Table 22Table 23Table 24Table 25Table 26Table 27Table 28Table 29Table 210Table 211Table 212Table 213Table 2141Table 215Table 216Table 217Table 218
Hardware Requirements for Development Phase 1 Software Requirements for Development PhaseHardware Requirements for Implement Phase Software Requirements for ImplementPhase Core Obj ects j
IComputer Science Engine Objects New Application Objects Core Classes |
iQuestion Manager Objects
ITest Taking Objects tTable of Content Manager Knowledge Base Manager User Manager iMiscellaneous Objects User Information
ITutorial Table of Content Exam Control IKnowledge Base
IQuestionQuestion General
iQuestion Java j
11
11
12
1238394147
4848494949505353545455565757
viii
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
Table 219Table 220Table 31Table 32Table 33Table 41
Parameter Score Table Unit Test Results Subsystem Test Results System Test Results Files in Main Directory
585996
101102107
11
Ii
I
II
ix
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
LIST OF FIGURESFigure 11 Figure 12 Figure 13 Figure 14Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 1 10 Figure 111Figure 112Figure 113Figure 114 Figure 115 Figure 116 Figure117
Project Integration Project Overview j
IOverview of Project Use Case Diagram Authorization Page iStudent Signup Page Forget Password Page Student Main Menu Test Selection PageTest Page iiUser Modification Page Instructor Main Menu Add Table of Conterjt
Table of Content Management Page Knowledge Base Creator Page IKnowledge Base Management
IAdding General Question Form
2346
141516171819
Figure 118 Easy Question Creator Step One Figure 119 Easy Question Creator Step Two Figure 120 Easy Question
1Creator Step Three
Figure 121 Easy Question Creator Step Four Figure122 Figure 123 Figure 124
Question Control Page Administrator Sign Up Page Tutorial Page
2021222324252627282930313233
x
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
Figure 125Figure 126Figure 21Figure 22Figure 23Figure 24Figure 25Figure 26Figure 27Figure 28Figure 29Figure 210Figure 211Figure 212Figure - 213Figure 214Figure 1 215Figure 216Figure 217Figure 218Figure 219
iFigure 2201
Figure 221Figure 222Figure 223
Insertion Sort Animation Heap Sort AnimationTutorial Applet Structure Insertion Sort Class Diagram
ISelection Sort Class Diagram Heap Sort Class Diagram
IQuick Sort Class Diagram Project Class Diagram Connect Database Class Query Bean Class i
bulliData Manipulation Class IConnect File Class 1File Bean Class 1iRead File Bean Class Score Bean Class i-Create Choice Class Shuffle ClassiRandom Number Class Add Question General Class Add Question Java Class iQuestion Retrieval Class Question General Class Question Java Class ITable of Content Check Class Knowledge Base Check Class
xi
34353743444546526061636566676869707172747678798385
I
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
FigureFigureFigureFigureFigureFigure
24 Knowledge Base Deletion Class 88
25 User Information Class 89I
1 Sorting Algorithms Tutorial 102
2 General Question Creator 103
3 Testing Knowledge Base Creator 104
4 Easy Question Creator 105
I
I
xii
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
CHAPTER ONESOFTWARE REQUIREMENT1 SPECIFICATIONI
I11 Introduction
111 Purpose of Project t
There are many Web sites that provide interactive
tutorials for students such as CBT GTSS and etc There is no evaluation of students understanding and learning
in these web sites In order to solve this problem the
idea of creating evaluation tool was proposed in Fall 2000iIas a master project called Web-based Interactive
Self-Evaluation System I
The goal of this master project is to promote andI
facilitate the use of new Web-based and Java-basedI
technologies in the development pf self-evaluation systemIfor computer science in particular analysis of sorting
Ialgorithms This project is built as part of the GTSS system (see figure 11) WISE will promote Web-based interactive exercises by providing educators with thetools to create interactive exercise materials Students
are able to evaluate their understanding though exercises
1
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
II
112 Scope of Project
WISE project will provide tools to create exercises 1and to evaluate students performance Evaluation topics
are limited to sorting algorithms that include Selection Sort Insertion sort Bubble Sort Quick Sort and Heap
ISort These are important topicsiin computer scienceStudents who understand sorting algorithms very well can
Idevelop efficiently software i
i
12 Overall Project Description i
121 Project Product 1WISE system is designed to fun on the Internet
Therefore students can access WISE system from anywhere
As an extension from the GTSS project WISE system makes
2
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
I
Ithe final product the complete tutorial system The
complete WISE project consists of two main parts GTSS tutorial and WISE application server (see figure 12)
Project Product with Deployment DiagramrFigure 12 Project Overview i
I1Sorting algorithm Tutorials These tutorials
iinclude the concept of each sorting algorithms and
analysis of sorting algorithms in term of Big Oh notationi2Interactive self-evaluation exercise system This
system includes interactive exercise creator tool
question management tool and score analysis These
easy-to-use tools will help instructors create interactive I
exercises in the area of sortingialgorithms Creating someI
of the exercises may require the programming to set rules
3
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
I
for WISE in order to generate multiple choices Thisinformation is kept in knowledge base which later on canIbe used to create more interactive questions
Figure 13 shows how WISE works The instructorcreates both tutorials and question exercises Then the
GTSS Applets IVew applets
Creat Applets
Students
Professoi
Choosecertain applet to student
Create modify questions
Answer questions
K
Sunlit the answersI
Test page
Question Database
Figure |13 Overview of Project
students are able to study and practice the
self-evaluation exercises whichare created from the WISE
4
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120
system The system will evaluate 1 the student scores withI
the passing scores set by the instructors If studentspass they can start the next chapter otherwise they
irepeat the current chapter is required
122 Functionality of Project
In WISE system all functions are categorized by
level of users which include student level instructorlevel and administrator level Figure 14 shows a Use Case
diagram which describes the functionalities provided byWISE system i
1221 Instructor Level The instructor is able toi
create edit and delete sorting algorithm questions by
using tools such as EZ question creator to create
questions and Question Manager to edit and deletequestions Question Manager engine handles all activitiesdescribed above The instructor can also access students
Irecord to view their score and evaluate studentsunderstanding
5
Send Comment or Feedback to instructor or system
Figure 14 Use Case Diagram
6
1222 Student Level After the student finished
their tutorial applets The Question Manager engine will
generate a set of questions Most questions automaticallygenerate answers Then they are shuffled them by theQuestion Manager engine The Answer Manager engine is
Iresponsible for counting score and recording it in the
student database If the student passes the exam the
student can start the next tutorial otherwise the Answer
Manager engine locks the current chapter until the studentpasses the exam
1223 Administrator Level) System administrator or SA has the major task to maintain all the tables in the
IWISE database and overall system) SA is able to create
instructor and student account Students and instructorsIIcannot delete their account unless the SA does The User
Manager engine will handle these tasks on the backgroundUser manager engine also checks user logins to ensure thatonly registered student access the system
SA has also to maintain the knowledge base With the
knowledge base engine SA can manage the knowledge base
that is used for creating new questions by the
instructors
1
7
123 System Analysis and Requirements
The WISE system consists of1 several components in sorder to work properly a)Java Server Pages (JSP) b)Java
Database Connectivity driver (JDBC) and c)MySQL database engine In this section each component will be described briefly In WISE system all information will be stored in MySQL databases The front-end applications will be
written by JSP All applications I will use JDBC to connect
to databases I(a) Java Server Pages consists of powerful JAVA
programming language integrated with the
server-side script language based on extra markupIlanguage or XML These itake JSP easy for dynamiciWeb programming Furthermore JSP uses graphicsfrom HTML As a result JSP applications run faster Compared to the(other server side language such as Active Server Pages (ASP) PERLor PHP JSP has the major advantages of real
object-oriented run faster and highly reusableIJSP is a language of choice for creating dynamicI
Web-based interaction
Since WISE contains many interactive forms to get data in or to display result out it is a igood idea to use JSP imWISE system Integration
8
of GTSS and WISE systemwill not slow the systemIdown because WISE system will optimize GTSSi
performance I
There are many advantages to use JSP in WISEIsystem
mdash WISE system is objett-oriented which is thesame as GTSS WISE can be very modular and
Ireadily adapted to new usesI
mdash As a teaching interactive material tool aI
well-written JSP program allows the
instructor to focus1attention precisely ont
the point at hand 1I
- With build-in templates it will be easy for
instructors of the computer sciences to[develop additional interactive exercises with
minimal requirement1 for programmingi
(b) Java Database Connectivity defines a structuredinterface to Standard Query Language (SQL)
Idatabase The JDBC API provides Java developers
Iwith consistent approach to accessing SQL
I I databases that is comparable to existing database I development techniques I The JDBC API includes
Iclasses for common SQL database constructs such
ias database connections SQL statements and
9
result sets JDBC database drivers can either be I Iwritten entirely in Java or they can be
implemented using nativg methods to bridge Java1
application to existingdatabase access
librariesI
(c) Databases are becoming a big part ofiapplications and one of the most popular products is MySQL fromMySQLcom MySQL is a
free product under General Public License MySQL
has many advantages over the other databaseIengine products such as 1 reliability speed andI
capacity
MySQL can run on ariy platforms such asIwindows 98 or NT UNIXLINUX and etc Using
IMySQL is also easy to use with simple SQLicommands
124 Hardware and Software RequirementIn order to successful develop WISE system the
ihardware and software are a major concern Minimumrequirements are specified here both a) development and b)
implementphasesI
(a) Development Phase is the phase that involvesIdesign coding and debugging of this project The following hardware and software specification are
10
used to develop and test WISE to work properly
when it is launched
Table 11 Hardware Requirements for Development Phase
Hardware SpecificationProcessor AMD Athlon 700 MhzMemory Micron 128 MB
Display card ATI rage fury 32 MBBIOS American Megatrend 20
Table 12 Software Requirements for Development Phase
Software SpecificationOperation system Windows ME Redhat Linux
71 serverBrowser Internet Explorer 55
JSP server Tomcat 321Java Compiler JSDK 131
Database MySQLText Editor Notepad
Other script language JavaScript
WISE is mainly developed under windows MEoperating system The main reasons developing it
in Windows is that it is easy to design code and
debug since windows ME provides more friendly
graphic user interface WISE is also tested on
11
Linux operating system to ensure that WISE system will run on any platform
(b) The final product will be tested and run on Linux
Operating System The GTSS server will include
all GTSS works WISE system and all futureextension projects
Table 13 Hardware Requirements for Implement Phase
Hardware SpecificationProcessor Pentium 1 GzMemory Micron 128 MB
Display card Gforce 32 MBBIOS Dell BIOS 20
Table 14 Software Requirements for Implement Phase
Software SpecificationOperation system Redhat Linux 71 server
Browser Netscape 47 for LinuxJSP server Tomcat 321 for Linux
Java Compiler JSDK 131 for LinuxDatabase MySQL for Linux
Text Editor VI
12
125 User CharacteristicsSince this project is about analysis of sorting
algorithms the intended users include both computer
science instructors and students Instructors need to have
some knowledge of Java programming since some intelligent
questions require logic solutions on how to solve thesequestions in the form of fragments of Java programStudents need to know how to use the Internet
13 Software Specific Requirements
131 External InterfaceIn this section we will continue our discussion of
WISEs basic interfaces and functionality expectations
13
1311 Authorization This is the main login page(see figure 15) There are two input text fields
username and password All users students instructorsand system administrator will use this login page
Successful logins will bring the user to their own main
page
Figure 15 Authorization Page
14
1312 New Student Sign Up This sign up page is designed for new students who want to sign up to use WISE
system (see figure 16) Student who provides all requiredinformation will be registered and will be able to access
the system
Eds pounddt View Favorite- Took -|iSAddfess|i^j httplocalhosl8080wisejigniiphliTj Pj prsquoiio jfjrbnksi^J isise
New User Signup For Student Only
( All fields ore required)
Login Information
iyDor-e ____ __ _ f 1 J1 iToedlaquonjfnel laquoFigure 16 Student Signup Page
15
1313 Forget Password Page The student or instructor who forget their password can use this page by
filling out his identification (see figure 17) WISE
system will send the password them through e-mail
Password Finder
Pelase put you username information in username box WISE server will send your password to your e-mail
Username (7 ]
Subrtrsquoil I
ii
Figure 17 Forget Password Page
16
1314 Student Main Menu This is the student mainmenu (see Figure 18) Student can use this menu to use
WISE system Start tutorial is to start all GTSS tutorial
Self-Test exercise will link to the exercise page to test students understanding Students can check their scores at the score and statistic page Students can also change
their password email at preference link The logoff linkwill end the students session
Firsquo3 Edt Ye Tech Hefj I Address [dip ccctiwl G083wiseloqp [p ~D RGo j LiV - Elasgj_______________________ ______________________ ____ _ ________
Figure 18 Student Main Menu
17
1315 Test Selection Page The student can choose
the chapter that heshe wants to test (see Figure 19) By clicking Create Exercise the exercise- for that chapterwill create and show on screen If the student clicks on
the Back to Main the students main menu page will be brought back
Editbdquo View Fdvc Tools Help | Addietss|i] httplcch3sl6C9CMHist)gtta[Lgt J Go ILinks ffl
WISEilmdash
-glsquoVctrsquo-in i rfSell Eriilt
llaquolist--ntr
Self Exercise Control Center
You are now studying tutorial chapter 3
Please select the following chapter to create exercise
Chapter [iTgJ
Please make sure you select chapter (bat you want to take a test After Clicking ldquocreate exercise You may not change chapter test until you finish (be test (hat you just selected
Create Exercise Sack to Main bull
BlBKiHi -i
Figure 19 Test Selection Page
18
1316 Testing Page Shown in Figure 110 is thetest page created by WISE system The student can answer
it at any time After the student answers all the
questions they will click submit Your Answer WISE willcheck the answers and print the score report
Please answer the question Induw MiliusuH Intrrnd Lyplon i [Wnihmi Ufllnu ]
File Edit View Favorites lootsHelp
gt rsquo 2 tSrI 3d 0 3 flaquo B [ search [
Please answer the question below
Question Give an analysis of running time (big oh) of the following program fragment
Sum=0
for(i=0iltni++)
Sum++
lt~ AO(N)
OBO(NA2)
OCO(N72)
OD O(NlogN)
ltbullrsquo E Non of Above
f Submit Your Answer
Done J [ My Computer ~
Figure 110 Test Page
19
1317 Change User Information Users who want to
change their user information or password can do it on
this page (see Figure 111) There are two separate buttons here Change User Info and Change PasswordThese buttons are self-explanatory Clicking Change User Info action button will update the user name or e-mail
Clicking Change Password will update password for the
current user
Flic Edit Vkw Favortes |(iAddfess|i^) httplocalhosl8080Hisechangeptef|sp i jbinfccijSS] wSSelt
HO Done AAA~ - - _____ _ __ 1 j ij localmltanet _ i
Figure 111 User Modification Page
20
1318 Instructor Main Menu The instructor main
page shows links to perform many tasks (see Figure 112)
Table of Content links to Table Of Content Manager to
create table of content of WISE system Knowledge Baselinks to knowledge base manager to create the knowledgebase EZ question creator links to Java question creator
Display question links to question manager Exam Control
links to exam control page to set the number of question
per test and percent pass Statistics links to scoremanager to monitor student score
poundJa
irsquoi Edit Vsew bull Fovciites iods Help |^T^JJ2^ocattTOst^8080vyiseioginjEp~ j Links
1Welcome Arturo Concepcion
aamamdashManage tutorial table of content for using in create question
View students score report of all tests sorted by chapter
HI
|2Knowledtio BaseX
Change your password and edit user information
create knowledge base for using in ez question creator
Create question modify exam control
JLocal intianet
Figure 112 Instructor Main Menu
21
1319 Add Table of Content Page This screen helps
the instructor handle the table of content in WISE system
(see Figure 113) After filling out all information andclicks submit the system will add new content to thedatabase Reset button will be used for clearing oldinformation TOC manager page will bring instructor back
to the table of content main menu
pounde jatlrt F^yoiites loots I i A^titess http7localhoslB080wiseTOCAddisp 7^0 | Links ^3 wise
Please Provide the following infonnation
Chapter No j ~
Section No j
Content Name [
Submit j j Reset j j TOC Main Menu j
ci
Dorie ___ __ ____ _ _lt__[ j^ LocalinUanetFigure 113 Add Table of Content
22
13110 Display Table of Content Display table of
content menu will help the instructor handle table of
content in the WISE system (see Figure 114) Edit
button links to edit page to modify content Deletebutton links to delete page to delete unwanted contentfrom WISE system
1ft
30 PoneFigure 114 Table of Content Management Page
23
13111 Knowledge Base Creator This screen will add
knowledge base to the database (see Figure 115)
Knowledge base helps the instructor create questions in
the future After filling out all the information andclicking submit the system will write all informationto the database
L pound1= Kt FjraJw Too Help | j Adass fpoundhi
Lu a-
73 Go jLlaquoualaquoe
I irowlriqu rtast ficntur
knowledge Base Question 1 Stiinformatiori is needed
Simone
Knowledge Base Question
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameters Setting
Parameter name 1
Parameter name 2
Parameter name 3
Parameter name 4
Parameter name 5
Function Call
lt Please Provide Parameter Setting
hl
JBM
a
Ahi
L i o Local mtanel ~
a33
Figure 115 Knowledge Base Creator Page
24
13112 Knowledge Base Display Page This is a
similar screen to the table of content Knowledge base
shows question in the question field (see Figure 116)Edit button links to modify the knowledge base Deletebutton links to delete page which will delete unwantedknowledge
File Edit Vteftt favorites Tools help j1 Addfessj^O httplocahoslB080wisekbaseViewBySeclmisp
^ - copy a u Q iS- safersquolt^Go lsquojl-wks
DispMvrrhhnplitr Knnwlidfjf1 rsquoBubble Sort
No Question Answer Edit Delete
1Given array of [54321] after second pass in bubble sort which of the following is correct
aaa i
Otoampalinaanel d
Figure 116 Knowledge Base Management
25
13113 General Question Creator General question
creator shows the way to create non-calculation type of
question (see Figure 117) After filling out all the
information and clicking submit button Wise system will
add this question to the database Reset button will clearall information in all fields
Fre Ec View Faverde Tocrrsquos Hep j AddresslsquodlllocaihllceOAdeadlqlstionGlp tj Rgo ki ks iS]use
- --A Q ^230 IW gl rdquo
Figure 117 Adding General Question Form
26
13114 Easy Question Creator Easy (EZ) question
creator is a tool to create calculation question by using the information from the knowledge base (see Figure 118)EZ question creator consists of 4 easy steps The first
step is show here After selecting all information and
clicking next button Wise will show the second step
J Fite poundd( Yaw Favorites Joofe fjefc _______ _______________ nj Search |raquo jfl ggj Yahotf Mail - [S] Photos tS8Recsee
EZ Question Creator For GTSS
j Step UPlease provide following information________ __ ________ _
| Pfeaseselect topic] j ^3rsquo j
[please select type of answer||[fej|
nexigtgt
Figure 118 Easy Question Creator Step One
27
13115 Easy Question Creator Step 2 The knowledgebase that was setup from the last screen will show here(see Figure 119) The instructor just chooses theinformation from the list and click next to go to next
step The instructor can click back to go back to the
previous screen
fie EeEJ yrew Favorites loots Help
-Q V| (SSi 0 iS IlW^tgR )saraquorrai|-|BYraquottradetWraquol bull jgPhotQ asriolcase______ gEZ Question Creator for GTSS
Step 2 Select Knowledge Base j M
No t Knowledge Base Select Sample
1given array[l2345] after second pass on bubble sort which of the following is true
C Sample j
] laquoBack [ ] Nextraquo |
UDonk i rdquo _ m m ~~~~~~ _ bdquo _ ____ [jisisumimtanet m)Figure 119 Easy Question Creator Step Two
28
13116 Easy Question Creator Step 3 This screen shows step three of EZ Question Creator (see Figure 120)
This screen shows the detail of the question the userintends to create based on selected knowledge base After
filling out all information and clicking on Next buttonWISE will proceed to step four The instructor clicks
Back button to go to the previous step page
29
13117 Easy Question Creator Step 4 This is the
last screen for the calculation type of questions (seeFigure 121) The instructor will choose Auto CreateAnswer or define his own answers The Next button willsave all information to database which later on be ready
for system to create tests for the student
Ble MI yew Favootes Iods Help EH - rsquo copy 2) reg Yi 0 amp j ffhl f^FI _ _J-------------------------------
Question Creator
CAuto5eate03Qicen$tronqlyRe^mrnended)lsquo~ LJ fl
ltgt laquoback I nextraquo I
Doge Lt JFT
Figure 121 Easy Question Creator Step Four
30
13118 Question Control Page After creating thequestion the instructor can control the number of
questions per exam per chapter (see Figure 122) The
instructors can also control how many percent to pass each
exam Save Change button will save all information to
database Back to Main button will go back to the mainmenu
jl Efe felt Miew Favorites Tools Help_______ JAddresshltplocalhosl 8080wiseques[ion_contfolisp 3 Frio junks
ia ia4- 77 7727 i ~~7 2
3^3 Done toco intranet
Figure 122 Question Control Page
31
13119 Sign Up Page This sign up page is
exclusively for administrator (see Figure 123) Userclassification includes student and instructor Instructor
account can be created here Signup button saves the
information to database Reset Form button will clear
all information from this form
Idit Filaquonraquoes Iwls Help htlpMccatoo5t8C80wiseusei_add[sp J Links 4) wise
Figure 123 Administrator Sign Up Page
32
13120 Tutorial Page This is an example of
tutorial All tutorials have standard layout Next button links to next tutorial pages
ge frit Yiew Eamites look hllp7tegjoatiqa[lwisechliiaoh1isp ____ zifBo |Lifc Kfrjl
1 Algorithm Analysis (Review)
X
An algorithm is a clearly specified set of instructions the computer will follow to slove a problem Once an algorithm is given for a problem and detemined to be correct an inportant next step is to determine the amount of resources such as time and space the algorithm will require This process is known as algorithm analysis
Algorithm analysis is mostly measuring of the computational time to run algorithm Because the behavior of an algorithm may be different for each possible set of data there needs to be a means for summarizing that behavior in simple easily understood formulas One way to derive these formulas is the big 0 notation Big O notation also called an efficiency indicator is used to describe the growth rate of a function The big O notation represents the running time needed to solve the computational steps
51 JL
Dona j 1 trAtanef
J
Figure 124 Tutorial Page
33
13121 Insertion Sort Animation This is an
insertion sort animation written in Java Forward button
shows next step of algorithm animation Back buttonshows backward step of algorithm Reset button startover applet Keyboard button accepts user input from keyboard Time complexity of insertion sort is 0(n2)
2isejArsquouiSoit (Int ltifj ini NiBEGIN
intt ij teiap-- FOR (i = 1 i lt N i++)BEGIN - bull
teiap=a ji]
TOILE (j gt=0 ampamp at j] gttemp) BEGIN
I al j+l)=a[jl
a[j+l]=tempEND
END
III
Forward Back Reset Keyboard
Figure 125 Insertion Sort Animation
34
13121 Heap Sort Animation This is an example page
of Heap Sort The time complexity of heap sort is0(nlogn)
run-shtic TOitf fteipTOf Hint vpoundJ jut raquo)
f or(i=n2igt=Gimdashgt(- adjust_heapltvin) _ irgt
for (xlaquon-lxgtOimdashgt bullsusp(vOi) - ad5ust_hoop(v0i) s fc
loop lsquo
public static void ad^usn^heapdnt vfl int position int heapSite whilepositionlthoapSise)(
mt ehrsquoildpos=position2+l -i fichildpos-ltheflpSise) -
if ( ltchplusmnldpos+lltheapSise) 44 (vchildpos+lJgtvtchildposB ) - ehildpoo++
if ltvfpositionjgtvf childpesl
swapltvpositionchiidposgt - bull bull bulllaquo statement- bullbullgtrsquo _ - v gt -
poGition=childpes bull -gtwhilersquoloop rsquo
Forward Rack Rnsnt Koylioard
Figure 126 Heap Sort Animation
lt__Position Childoos
1
35
CHAPTER TWO
DESIGN
After defining all software specification the next
step in software development life cycle isdesign Design is a creative process Software design guality is depended on understandability verification and adaptability To achieve this goal Unified Modeling Language (UML) is used
for software analysis and design It simplifies thecomplex process of software design making a blueprint for construction Use Case is one example of UML that
define functionality of software in the last chapter In this chapter other UML diagrams such as class diagram
will be used in the following section From the last
chapter (Figure 12) project product goals are to create sorting algorithm tutorials and complete interactive tutorial system in the GTSS system Therefore these twoproduct goals will be discussed
The GTSS Project is an on-going project in the
department of computer science mathematics physics and
chemistry at CSUSB We used the GTSS tools and built newones to implement WISE
36
21 Architecture Design
221 Sorting Algorithm Tutorials Design
The GTSS structure consists of 3 layers core
objects engine objects and application objects [1] For Sorting Algorithm GTSS applets WISE still use the same
structure Furthermore new applets add more classes to the engine objects and application objects to make new
sorting algorithm applets run correctly Figure 21 showsstructure of GTSS
From Figure 21 Core Objects are used for creatingprimitive graphics such as frames text canvases
buttons menus etc The Engine Objects are build on top
37
of the core objects and though inheritance and
polymorphism this engine supports the generation of
windows and graphics for the specified subject TheApplication Objects are a set of objects that is used togenerate windows and graphics for a specific topic in a subj ect
2111 Core Objects There are seven classes in the
Core Objects that are used to build new sorting algorithm
applet They are SGApplet SGFrame SGControlPanelSGMenu SplashPanel HsplitPanel and Vspiltpanel (SeeTable 21)
Table 21 Core Objects
Class Name FunctionSGApplet This is the superclass of all appletSGFrame Defines a FrameSGControlPanel Specifies button on panelSGMenu Specifies menus on menus barSplashPanel A panel used for demonstrationHspiltPanel Defines a two horizontally split
panelsVspiltPanel Defines a two vertically split panels
2112 Computer Science Engine Objects The Computer
Science Engines that are used in creating new sorting
algorithm tutorials contain six classes ScatterPanel
38
SortPanel Scatterlnterface Pseudocode Sortlnterface
and Sortnode (See Table 22)
Table 22 Computer Science Engine Objects
Class Name FunctionScatterPanel Panel that displays the scatter
graphScatterlnterface Class interface to ScatterPanelSortPanel Defines the base panel for sort
walkthroughsPseudocode Defines the base panel to display
algorithmSortlnterface Class interface for SortPanel amp
PseudocodeSortnode Defines graphical boxes for
sorting animation
The Computer Science Engine Objects are built using Core Objects Computer Science Objects define basic graphics about animations such as sorting pseudocode and rectangular boxes for sorting animation It rules also contains how to animate them such as swapping the boxes orhighlighting on lines in the pseudocode
2113 Application Objects The current GTSSstructure supports four applications Computer Science Physics Mathematics and Statistics We will continue ourdiscussion on computer science applets
39
The five new applets added to GTSS foe computer
science are the following(a) Selection Sort is a Selection Sort walkthrough-
of the steps by steps execution of thealgorithm
(b) Insertion Sort is an Insertion Sort walkthroughof the steps by steps execution of the
algorithm
(c) Quick Sort is a Quick Sort walkthrough of the
steps by steps execution of the algorithm(d) Heap Sort is a Heap Sort walkthrough of the
steps by steps execution of the algorithmIn Application Objects We define the rule how the
algorithms associate with the pseudocode and rectangularI1 boxes by adding actionlistener Every time the user clicks
on forward button We define two more classes for every sorting applet to handle this situation In insertion sort for example they are Iswalkjava andISControljava These two classes will tell the appletwhat animation should it do This method is applied to
every new sorting algorithm in GTSS Table 23 shows new
Application Objects built for new sorting tutorial
algorithms
40
Table 23 New Application Objects
Class name FunctionIswalk and ISControl Integrate all components objects
and Control Insertion sort animation applet
SSWalk and SSControl Integrate all components objects and Control Selection Sort animation applet
Hswalk and HSControl Integrate all components objects and Control Heap sort animation applet
Qswalk and QSControl Integrate all components objects and Control Quick sort animation applet
Using GTSS to create new applet is quite easy sincethere are preprogrammed classes available for instructors
to create a new applet But one major drawback is thatinstructors must know how to program in Java Using Javabean visual tools that help to eliminate the need of
programming in Java because Java bean allows the user tocreate applet in a visual programming environment cansolve this problem
Figure 22-25 shows the class diagrams of Insertion
sort Selection Sort Quick Sort and Heap Sort All fivesorting algorithm applets have the same class diagram
structures The class diagram shows all the Objects usednow integrated into one big picture showing the
41
relationships of all objects This class diagram alsoshows the detail of functions and variables for each class
that binds together to run this applet This is also the
standard pattern of all future animation applets unless
this rule will be customized by instructors to fit future0
applet requirements
42
How to renew your books from Home
1 Access to Library Homepage httpwwwlibcsusbedu
2 Select Renew Your Books bottom of page
3 Click My Account Tab4 Enter your barcode (on the
back of your Coyote OneCard)5 Click (Login)6 Click Checkout Oiit Tab7 Select item(s)for renewal by
clicking in box next to each each title Then click on bottom highlighted Renew box
8 After renewing your item(s) make a print out for your receipt The Library will make no fee adjustments unless you can show this proof of renewal
If you have any questions concerning renewals please call Circulation Desk at 880-5090
Problemsquestions with signing onto the Libraryrsquos web site or accessing the periodical indexes call Help Desk 880-5116 or 5107
SGApplet
anentjnent
---- gt
gt
g^menuLabel String g^menuitemLabel STring ^menuitemlndex int (^sG Frame SGFrame
ltjmenuAction()OcontrolPanelButtonActionOltjuseKeyBoard()
ISWalk^cp SGControlPanelpound^gtsc ISControl ^gtsp SortPanel ^gtpc Psedocode ^si sortinterface
ltgtinit()^controlButtonOlt3appiyKBdata()bull4gtapplydata()
A
SortPanela SortNode SortPointer
etdataOaint()
1V
INode
3 String ne String it11oolean
SGControlPanel
^applet SGApplet ^buttonLabel String]
SGMenu
^applet SGApplet ^MenuLabel String
gvjtem Label String] ^radio Boolean
ltHSplitPanel
^panell Jcomponentraquopanel2 Jcomponent
fkkeepEqual boolean
SGKeyboardFrame
SG Keyboardlnterface
applyKBDataO
SortPointer Label String
^coordinate_x int poundgtgtcoordinate_y int
tShowO
Figure 22 Insertion Sort Class Diagram
43
SGAppletSGFrame
^tite String^Component Jcomponent is^Component2 Jcomponent ^gtControlPaneI JPanel
gt
gVmenuLabel String ^menuitemLabel STring ^menuitemlndex int bullJsGFrame SGFrame
SGControlPanel^applet SGApplet i^buttonLabel String[]
ltbmenuAction()lt5gtcontrolPanelButtonAction()^useKeyBoard()
SGMenu
SSControllaquosp sortpaneiraquopc pseudocode
^SortForward()^SortBackO^SortReset()
SSWalk
^cp SGControlPanel ^sc ISControl xsp SortPanel gtpc Psedocode jsi sortinterface
^init()gtcontrolButton()ltgtapplyKBdata()^gtapplydata()
^applet SGApplet (^MenuLabel String g^item Label String[]
fiferadio Boolean
HSplitPanetImpanel 1 Jcomponent g^panel2 Jcomponent tWkeepE qual boolean
SGKeyboardFrame
SortPanelSortinterface^
ltgtSortforward() -^SortBack()^SortReset()
g^sn SortNode copyjsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()
ltgtshow()
^Setdata()ltgtpaint()
gt
TVSortNode
^Value Stringgj-gt_Name String
t int int boolean
SortPointer yLabel String jcoordinate_x int ^coordinate_y int
General Node
^General Node()
Figure 23 Selection Sort Class Diagram
44
SGAppletSGFrame
^tite String^Componentl Jcomponent ^Component2 Jcomponent i^ControlPanel JPanel
-------- gt
^bulljnenuLabel String ^menuitemLabel STring ^menuitemlndex int ^SGFrame SGFrame
^menuActionQltgtcontrolPanelButtonAction()ltgtuseKeyBoard()
HSControl HSWalk
SGControlPanel(bull^applet SGApplet t^buttonLabel String[]
SGMenu^applet SGApplet ^MenuLabel String gyjtemLabel String[] i^radio Boolean
S^sp sortpanel copypc pseudocode
^SortForwardO^SortBack()^SortReset()HSctrlO
~gt
^cp SGControlPanel g^sc ISControl f^raquosp SortPanel ^pc Psedocode ampgtsi sortinterface lt
HSplitPanel
Sortinterface
ltgtSortforvard() mdash gt lt^SortBack() ^SortResetO
ltgtcontrolButton()^applyKBdata()^applydataQ
SortPanel(Sjsn SortNode fampgtsp SortPointer
SG Keyboardlnterface
ltgtapplyKBData()ltgtSetdata()ltgtpaint()
~rv
SortNodeSpoundValue String ^_Name String f^gtX int ^gtY int copygtB boolean
Jl
SortPointer
^Label String ^coordinate_x int ^gtcoordinafe_y int
General Node
^GeneralNodeOltgtDrawNode()
impanel 1 Jcomponent ^pane2 Jcomponent ftfkeepEqual boolean
SGKeyboardFrame
-gt ltgtshow()
Figure 24 Heap Sort Class Diagram
45
SGFrame
^tite String^Component Jcompqnent gvComponent2 Jcomponent ^Control Panel JPanel
QS Control
^sp sortpanel dc pseudocode
ltgtSortForward() ^SortBack() ^SortReset()
SGAppiet^menuLabet String ^menuitemLabel STring ^menuitemlndex int t^jsGFrame SGFrame
ltgtmenuAction()^controlPanelButtonActionOltgtuseKeyBoard()
QSWaik^cp SGControlPanel vsc ISControl dgtsp SortPanel
- gt bull Psedocode^si sortinterface
ltgtcontrolButton() ^applyKBdata() ^applydata()
ltZz
lt
SGControlPanel
^applet SGAppiet ^buttoriLabel String[]
7^
SGMenu
^applet SGAppiet ^WlenuLabel String
g^itemLabel String[] ^radio Boolean
HSplitPanel
impanel 1 Jcomponent impanel 2 Jcomponent tampjkeepEqual boolean
SGKeyboardFrame
SortinterfaceSortPanel
ltgtSortforward() mdash ^SortBack() ^SortReset()
fd^sn SortNode^sp SortPointer
bullbSetdataO^gtpaint()
SG Keyboardlnterface
^applyKBDataQ
ltJshow()
____ VSortNode
devalue String digt_Name String ^X int ltgtY int ^B boolean
ASortPointer
^Label String d^coordinate_x int djcoordinate_y int
t__________
General Node
GeneralNode()ltgtDrawNode()
Figure 25 Quick Sort Class Diagram
46
212 Interactive Self-Evaluation System Design
As an extension project for GTSS WISE is added WISE
system design is based on object-oriented design WISE
architecture consists of two object layers core andapplication
The Core Object in WISE system consists of both mainclasses that connect to database and file and utility
classes that deploys superclasses to perform tasks that
help WISE run application object faster and with no error
Table 24 shows all classes in Core Objects
Table 24 Core Classes
Class Name Class FunctionConnectsql A super class for all objects To
define databaseConnectfile A Super class for file objectsQueryBean Control query statementInsDelUpdBean Control insert delete or update in
databaseFilebean Worked with connectfile contain detail
information to save to or read from identified filename
Shuffle Shuffle all choices by randomCreateChoice Base from correct answer system will
create almost the other four right answers before shuffle
RandomNumber Random number by specified rangesScorebean Control and manage students scoreReadFileBean Reading information from file and send
to display at screen
47
Application objects are classes that present all functionality provided by WISE system Functionalities of WISE system was explained in chapter one using casediagram The main functionalities that show in the
application objects can divided into five main groups
question manager user manager table of content manager test taking and miscellaneous The following tables show all Application Objects categorized by function
Table 25 Question Manager Objects
Class Name Class FunctionAddQuestionG Add new no-calculation question to the
databaseAddQuestionJ Add new calculate algorithm question to
the database
Table 26 Test Taking Objects
Class Name Class FunctionQmanager Manage and create exercises to show on
screenQuestionG Retrieve non-calculation question to
QmanagerQuestionJ Retrieve calculation question to
Qmanager
48
Table 27 Table of Content Manager
Class Name Class FunctionTOC check Checkaddmodify and delete table of
content
Table 28 Knowledge Base Manager
Class Name Class FunctionKbaseDelete Delete Knowledge baseKnowledgebaseCheck Check knowledge base parameter before
saving to database
Table 29 User Manager
Class Name Class FunctionUserlnfoBean Control and manage user login and
signup
49
Table 210 Miscellaneous Objects
Class Name Class FunctionEmail Provide forget password mailing serviceSortgen Acquire calculation question with
generated answers to QuestionJ
Figure 27 shows the WISE class diagram The
connectsql class and connectfile are superclasses of all
classes in WISE system Connectsql has the databaseconnection information Connectfile also has filenameconnection information which is useful when the systemloads the students exercise file
After the student logs on to WISE system the student
can browse student menu which includes GTSS test taking show score and personal information Test takingassociates with Qmanager which manages and creates tests for the student Userupdate UI has dependency withuserinfoBean Instructor can also browse the main menuwhich includes table of content manager score manager question manager and knowledge base manager Table ofcontent manager has direct association with TOCadd
TOCupdate and TOCdel Question manager also associates
with addQuesitonG and EZ question manager These two classes create new question to WISE system Knowledge base manager associates with kbase_creator kbase delete and
50
kbase_update Knowledge base system is very important for questions that use Java program to create question
Question manager will use knowledge base information to
create test Every class associates with connectsql to
access the database to update insert delete or query
51
52
213 Database Design
Based on the class diagram WISE database design uses
relational database model Relational database designdefines database as a series of related tables WISEdatabase has been normalized for performance and logical
error reduction The following physical WISE database
tables show the category detail entities for this project
Table 211 User Information
Field Name Data Type DescriptionUserid Varchar(9) User login idPassword Varchar(20) Password for userloginFirstname Varchar(30) Users firstnameLastname Varchar(30) Users lastnameEmail Varchar(30) Users email for contactLogin type Enum type of S
or PType of user login S for student and p for professor
Table 212 Tutorial
Field Name Data Type DescriptionTutorial ch Integer (2) Chapter to studyExam ready Enum ofY and
NStatus for examination creation
Exam selected Integer(2) Chapter for testing
53
Table 213 Table of Content
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter noSection id Integer(2) Assign section noContent Varchar(50) Name of that sectionNo of question Integer(3) Number of question in
that section
Table 214 Exam Control
Field Name Data Type DescriptionChapter id Integer(2) Chapter noTotal question Integer(3) Total question in that
chapterPercent pass Integer(3) Percent to pass exam in
this chapter
54
Table 215 Knowledge Base
Field Name Data Type DescriptionSample no Integer(9) Assign knowledge base
numberQuestion sample Varchar(200) Knowledge base questionParaml Varchar(50) Parameter nol that need
for calculate resultParam2 Varchar(50) Parameter no2 that need
for calculate resultParam3 Varchar(50) Parameter no3 that need
for calculate resultParam4 Varchar(50) Parameter no4 that need
for calculate resultParam5 Varchar(50) Parameter no5 that need
for calculate resultSample choicel Varchar(50)
1
Sample Choice A An example for instructor understanding what kind of answer for this question
Sample choice2 Varchar(50) Sample Choice B An example for instructor understanding what kind of answer for this question
Sample choice3 Varchar(50) Sample Choice C An example for instructor understanding what kind of answer for this question
Sample choice4 Varchar(50) Sample Choipe D An example for instructor understanding what kind of answer for this question
55
Field Name Data Type DescriptionSample choice5 Varchar(50) Sample Choice E An
example for instructor understanding what kind of answer for this question
Function call Varchar(50) Name of function to calculate and createanswer
Question topic Varchar(30) What sorting topic this question belong to
Table 216 Question
Field Name Data Type DescriptionChapter id Integer(2) Assign chapter number
for this questionSection id Integer(2) Assign section number
for this questionQuestion no Integer(5) Assign question number
based on how many question in that chapter and section now
Question id Varchar(6) Combination of the chapter id plus section id plus question id as foreign key
Question type Enum G or J Type of question G for general which means no calculation question or J for java question which must calculateanswer
56
Table 217 Question General
Field Name Data Type DescriptionQuestion id Integer(3) Question id that assign
in question tableQuestion Varchar(200) Question contentChoiceA Varchar(100) The correct answerChoiceB Varchar(100) Multiple choice BChoiceC Varchar(100) Multiple choice CChoiceD Varchar (100) Multiple choice DChoiceE Varchar(100) Multiple choice E
Table 218 Question Java
Field Name Data Type DescriptionQuestion id Varchar(6) Question id that
assigned in question table
Question Varchar(200) Question contentNo of parameter Integer(1) Number of parameter
used for calculate result
Function call Varchar(50) Function that use for calculate result which come from knowledge base table
Answer type Varchar(10) Show answer type of auto which let system autocalculate answer or define which let user defineanswers
57
Field Name Data Type DescriptionChoicel Varchar(100) If answer type is
define correct answer is defined here
Choice2 Varchar(100) If answer type is define second choice is defined here
Choice3 Varchar(100) If answer type is define third choice is defined here
Choice4 Varchar(100) If answer type is define forth choice is defined here
Choice5 Varchar(100) If answer type is define fifth choice is defined here
Table 219 Parameter
Field Name Data Type DescriptionQuestion id Varchar (6) Question id that assigned
in question tableParameter id Varchar ( 6) Assigned parameter numberParam name Varchar (20) Parameter nameParam define Varchar(20) Assign either auto
ramdom or user defineParam value Varchar(80) If param define set to
user define user define value is stored here
Min number Varchar(5) If param define set to autorandom minimum number must be set to random number
58
Field Name Data Type DescriptionMax number Varchar(5) If param define set to
autorandom minimum number must be set to random number
Show value Enum value ON or OFF
Choosing to show parameter value on screen and then used them for create answer(on) or not show on screen but use for create answer
Table 220 Score Table
Field Name Data Type DescriptionScore id Integer(9) Auto increment numberUserid Varchar(9) User idScore Varchar(10) Score that user gotStatus Enum type pass
or not passStudent pass or not pass based on percent pass of exam control table
Chapter test Integer(2) Chapter that student tested
Date test Varchar(30) Date and time stamp after taking test
22 Detailed Design
Detailed design shows the logical algorithms In
other words detailed design shows the program instruction
in plain English language The developer gets benefit from
59
detailed design since it is easier to read and detecterror As a result the developer who wants to extend WISE
system can enhance it faster saving time and saving
budget The next section shows the covering all the
classes that are listed in the class diagram on Figure26221 Connect Database Class
Class name connectsqlPurpose Connect to physical databaseBegin classMydriver=path of JDBC driver MyURL=path of physical database
Function Makeconnection no return value connect physical database Begin
Activate driverEstablish connection to physical database
End
Function shutdown no return value shutdown connection Begin
Close connectionEndEnd class
Figure 27 Connect Database Class
60
222 Query Bean Class
Class name queryBeanPurpose for query information from database
Class begin with extends connectsql class Resultset myresultset=null Statement stmt=null
Function setConnection no return value link to connectsql to connect database Begin
ConnectsqlmakeConnection()EndFunction getNextRecord return Boolean check next record in database begin
return if there is next recordend
function getColumnString return string get string value from specific column parameter in stringclmn begin
return string value of that columnEndfunction getColumnlnt return string get integer value from specific column parameter in stringclmnbegin
return integer value of that columnend
function isRecord return Boolean query database parameter in string query begin
set myResultset=null prepare statementcheck if that weather query get resultreturn weather query has result (not equal null)
endfunction moveFirst no return value move cursor to first record
Figure 28 Query Bean Class
61
beginreturn weather cursor already move to first record
endfunction moveLast no return value move cursor to last record begin
move cursor to the end of databasereturn if move cursor to last record(previous) is ok
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 28 Query Bean Class (continued)
62
223 Data Manipulation Class
Class name InsDelUpdBean extends connectsql Purpose to insert delete and update data to databaseClass begin Statement stmt=null Int rowaffect=0Function InsDelUpd a construction classFunction setConnection no return value connect database Begin
ConnectsqlmakeConnectionEndFunction setInsDelUpd return int prepare statement for insdel or upd parameter in querybegin
set myquery=queryprepare statement before queryexecute query statement get number of row effect return number of row that effect from query statement
end
function setlnsert return int prepare insertion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
endfunction setDelete return int prepare deletion parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
Figure 29 Data Manipulation Class
63
function setUpdate return int prepare update parameter in query begin
call setlnsDelUpd with query parameter return rowaffect
end
function cleanup no return value clear all statement values begin
close statementendfunction setShutDown no return value shutdown this connection begin
activate close statement disconnect database
end
class end
Figure 29 Data Manipulation Class (continued)
64
224 Connect File Class
Class name connectfilePurpose connect to read or write fileClass beginFunction connectfile a contruction class
Function openwritefile no return value write html heading to file Q and file A Paramter in String QABegin
Connect filename(Q)Connect filename(A)Write html heading to file QWrite test answer to file A
EndFunction closewritefile no return value write html ending to file Q and file A Paramter in String QABegin
Write html ending to file QClose file QWrite 0 to file A 0=end of file Close file A
EndFunction openReadfile no return value connect file A Paramter in String ABegin
Connect filename(A)End
Function closeReadfile no return value connect file A Paramter in String ABegin
Close connect filename(A)EndEnd class
Figure 210 Connect File Class
65
225 File Bean Class
Class name fileBean extends connectfile Purpose write data to fileFunction filebean a construction classFunction getRadioForm return string return radio html button with choice content Parameter in string choice
Int IBegin
Return radio html button with value=choiceEnd
Function makeHTML no return value Paramter inInt IString q abcdeans Begin
ConnectfileWrite test question and answer to file
EndEnd class
Figure 211 File Bean Class
66
226 Read File Bean Class
Class name readfileBean extends connectfile Purpose read answer from file AFunction readfilebean a construction class
Function readcorrectanswer return vector of answer Begin
Prepare file to readWhile not end of file (not equal to 6) do
Read answer and put it to vectorEnd while
End
End class
Figure 212 Read File Bean Class
67
227 Score Bean Class
Class name scoreBeanPurpose check score after student take testBegin class
Function scorebean a construction classFunction setAnswer no return value check answer Parameter inVector student_answer correct_answerInt percent_passBegin
Read student answers to vector student_answer Read correct answers to vector correct_answer For loop of size of vector
If (student answer= correct answer)Count score
End for loopFind passing score
End
Function getScore return int get score Begin
Return scoreEndFunction ispassChapter return Boolean check student pass exam or not begin
check score with passing score return true if pass else return false
endend class
Figure 213 Score Bean Class
68
228 Create Choice Class
Class name createchoice Purpose create multiple Begin classFunction createchoice a
choice base on correct answer
construction classFunction makechoiceArray no return value create choices from correct array answer Parameter inInt value[]String choice[]Begin
Int Ifirst halfsecond half
Get first half of array to first_half Get second half of array to second_half Create correct choiceCreate second choice Create third choice Create forth choice Create fifth choice
EndEnd class
Figure 214 Create Choice Class
69
229 Shuffle Class
Class name shufflePurpose shuffle multiple choices
Begin classFunction shuffle a construction classFunction makeShuffle return string Parameter in string choice[]Begin
Int k rand Int ans=0 Boolean flag=true
For k=l to 5While flag==true do
Random number with in 5 choices If random number never used then
Flag=false Switch (random number)If 1 a=choice[random-1]
Clear choice[random-1]If 2 b=choice[random-1]
Clear choice[random-1]If 3 c=choice[random-1]
Clear choice[random-1]If 4 d=choice[random-1]
Clear choice[random-1]If 5 e=choice[random-1] 1
Clear choice[random-1]End whileIf random=l find correct answer after shuffle Ans=k
Switch(ans)1 answer=choice a 2 answer=choice b 3 answer=choice c 4 answer=choice d 5 answer=choice e flag=true
end forrandom number between 1 to 3 if random=3 set choice e=none of above return answer
endend class
Figure 215 Shuffle Class
70
2210 Random Number Class
Class name randomnumberPurpose random number between given two numbers
Begin classFunction randomNumber a construction class
Function getNumber return int Parameter in Int minmaxBegin
Return random number between these two given numbersEnd
End class
Figure 216 Random Number Class
71
2211 Add Question General Class
Class name addquestionGPurpose add general question to databaseBegin classFunction addquestionG a construction class
Function checkVariable return Boolean check variable from addQuestionG form paramter instring q ab c d etopicbegin
if q has no value then error question foundif a has no value then error choice A foundif b has no value then error choice B foundif c has no value then error choice C foundif d has no value then error choice D foundif e has no value then error choice E foundif topic has no value then error topic found return error variable if error found
end
function setQuestionlretirn Boolean add new question to database parameter inString qabcdetopic Begin
SetQuestion_no(topic)Connect dbSet update to add 1 to question on that chapterUpdate information and check row affectSet insert of question number question type infoInsert statement to table questionSet insert question answer statementInsert statement to table question_generalDisconnect dbReturn true if success Else return false
End
Figure 217 Add Question General Class
72
Function setQuestion2 return Boolean delete question from database table Parameter inString qabcdetopicquestion_id Begin
Set delete statement SetQuestionl(qabcdetopic)Delete at row (questioned G)If successful delete return true Else return false
End
Function setQuestion_no no return value prepare question number for insert before insert into table parameter in string topic begin
string query string name connect to dbselect content chapter_id and section_id from topic
informationSelect total number of question in that chapter Set question number by concatenate
chapter_id+section_id +(total question+1)EndFunction getError return string Begin
Return error if anyEnd
End class
Figure 217 Add Question General Class (continued)
73
2212 Add Question Java Class
Class name addquestionJPurpose add JAVA question to database
Begin classFunction addquestionJ a construction class
Function setQuestionlnfo no return value Parameter inString sortname Begin
SortQuery= new queryBeanSet select statement from tableofcontent tableConnect to dbIf (query has record) the
Get chapter_id to chapter Get section_id to section Get number of question to total
End ifDisconnect db
EndFunction setQuestion return Boolean insert java question to db parameter instring question paramnofunction_callstring answerp[][]sortnamebegin
init value of roweffectl=0 init value of roweffect2=0 init value of roweffect3=0 init value of roweffect4=0 int number_of_question string question_id string addtoparametertable=setquestioninfo(sortname) number_of_question=total connect to db for addset update number of question+1 to tableofcontent table
set insert to question table (chaptersectionquestion id J)
Figure 218 Add Question Java Class
7 4
if error not true(=l) thenset insert to question_java table set insert to parameter table
disconnect database if no error return true else return false
end
function setQuestionEdit return Boolean parameter instring answerchoice[]p[][]sortnameold_question_id begin
add new edit question record to database delete the old question record from database
endend class
Figure 218 Add Question Java Class (continued)
75
2213 Question Retrieval Manager Class
Class name QmanagerPurpose this class manage and create question test for studentBegin classFunction Qmanager a constructor class
Function getQuestion return string random to get question either general question or
java question Parameter inInt ch sections String choicest]Begin
Int randlInt number_of_question=l String question_type=String question_number=String query_question_table=QueryBean db=new queryBean()QuestionG qg=new questionG()QuestionJ qj=new questionJ()Db set connectionFor()Query_number= select no_of_question If(dbisRecord(query_number))
Get no_of_question to number of_question If(number_of_question equal 0)
Random new section Else break
End forRandom number and put to randl 1Set query to select question from question_id that get from chapter+section+randl Set query to select type of that question either G or JIf (type=G)
Question=qggetQuestion(question_id choices)Else
Question=qjgetQuestion(question_idchoices)Shuffle sl=new shuffle()Answer=make shuffle answer(choices)Return question
Figure 219 Question Retrieval Class
76
Function getAnswer return String get answer Begin
Return answerEndFunction getdupinfo return string send question_id to check that this question is already in the test yes question duplicate or no question will be in the test Begin
Return (questioned)End
End class
Figure 219 Question Retrieval Class (continued)
77
2214 Question General Class
Class name questionGPurpose retrieve general question from database
(no calculation question)Begin classFunction questionG a constructor class
Function getQuestion stringfunction to get question and answer before shuffle begin
queryBean db=new queryBean() db sets database connection query= select question from question_id if (record found) then
get question to iquestionget choice[0] to choiceAget choice[1] to choiceBget choice[2] to choiceCget choice[3] to choiceDget choice[4] to choiceE
end ifdb set disconnectionreturn question
endend class
Figure 220 Question General Class
78
2215 Question Java Class
Class name questionJPurpose retrieve JAVA question from database
( the calculation question type)
Begin classFunction questionJ a constructor class
Function getQuestion return string value Parameter inString Question_idchoice[]Begin
QueryBean qj =qjqueryBean()Qj set db connection Query=select from question_java If (there is record)
Get question content to question variable Get no_of_param to no_of_param variable Get function_call to function_call variable Get answer_type toanswer_type variable If (answer_type not equal user define)
Choice[0]=get value from column choicel Choice[1]=get value from column choice2 Choice[2]=get value from column choice3 Choice[3]=get value from column choice4 Choice[4]=get value from column choice5
End ifQuery =select from paramter by question If (there is record)
While (nextRecord)Parameters[I][0]=get value from Parameters[I][l]=get value from Parameters[I][2]=get value from Parameters[I][3]=get value from Parameters[I][4]=get value from Parameters[I][5]=get value from Parameters[I][6]=get value from Increment I by 1
End ifDisconnect database If(answer_type=auto)
CreateAnswer(choices)Return question
id
param_id param_name param_define param_value min_number max_number show value
Figure 221 Question Java Class
79
Function createQuestionreturn String value create full question begin
for(1=0 to no_of_parameter-l)find position [p in question save postion in index2tempq= cut all question up to index2 position then select parameter read if temp_v=[pl] then
param__value=get paraml read if temp_v=[p2] then
param_value=get param2 read if temp_v=[p3] then
param_value=get param3 read if temp_v=[p4] then
param__value=get param4 read if temp_v=[p5] then
param_value=get param5 question_set=concat temp_q and param_value index2=indexl
end forquestion_set=concat question set+ substring indexl return full question
end
function getParameter return String prepare set parameter parameter instring temp_v begin
String value= if (temp_v equals([pi]) )
value=setParameter(1) if (temp_v equals([p2]))
value=setParameter(2) if (temp_v equals([p3]))
value=setParameter(3 ) if (temp_v equals([p4]))
value=setParameter(5) if (temp_v equals([p5]))
value=setParameter(5) return value
end
Figure 221 Question Java Class (continued)
8 0
function setParameter return string set parameter parameter in string idbegin
for (i=0 to iltno_of_parameter) doif(id equals(parameters[i][0])) then
if(parameters[i][2] equals(user define)) then if(parameters[i][1]equals(array)) then value=getArrayUserDefine(parameters[i][3])
end if else temp=parameters[i][3] p[i]=parselnt(temp) value=temp
else if(parameters[i][2]equals(auto random))
if(parameters[i][1]equals(array)) size=parameters[i][3]min=parameters[i][4] max=parameters[i][5] value=getArrayRandom(sizeminmax)
else min=parameters[i][4] max=parameters[i][5] p[i]=getValueRandom(minmax) value=+p[i]
if(parameters[i] [6] equals(OFF) ) value=return value
endfunction getarrayuserDefine return string value get array that user define parameter instring array_userdefine begin
add to array_userdefine to set end pointch=array__userdef ine charAt (i) hile (ch=)
if(CharacterisDigit(ch)) temp+=+ch
else
Figure 221 Question Java (continued)
81
if (tempequals())vaddElement(temp)
temp=i=i+lch=array_userdefinecharAt(i)
arrays=new int[vsize()] for(i=0iltvsize()i++)
temp=velementAt(i)toString() arrays[i]=Integerparselnt(temp) value+=temp+
return value
end
function getArrayRandom reutn string get array random parameter instring size_str min_str max_str begin
randomnumber=rnnew randomnumbermin=parselnt(min_str)max=parselnt(max_str)try size=parselnt(size_str)catch error if size=8arrays= new array [size]for (1=0 to size-1) do
array [I]=random number between min and max end forreturn array_value
endfunction getValueRandom return int get random value begin
min=parselnt(min_str) max=parselnt(max_str)return (get random number between min and max)
endfunction createAnswerno return value parameter inString choicest]Begin
Sortgensortmain(arrayspfunction_callchoices)EndEnd class
Figure 221 Question Java (continued)
82
2216 Table of Content Check Class
Class name TOCcheckPurpose check add modify and delete table of content information
Begin classFunction TOCcheck a constructor class
Function setChapter no return value Parameter inString chapter Begin
Thischapter = chapterEndFunction setSection no return value Parameter inString section Begin
Thissection = sectionEnd
Function setContent no return value Parameter inString content Begin
Thiscontent = contentEndFunction startCheck return Boolean value Begin
Try Chapter_id=parselnt(chapter)
catch (if number error found)found=trueerror_message=chapter must1 be integer
Try
section_id=parselnt(section)catch (if number error found)
found=trueerror_message=section must be integer
return found_error
End
Figure 222 Table of Content Check Class
83
Function geterror return string value Begin
Return error_messageEndFunction addContent return boolean value Begin
Set query= insert to table-of-content table values (chapter_idsection_idcontent)
InsDelUpd add=new InsDelUpdBean()Addsetconnection()Addsetlnsert(query)AdddisconnectIf error of duplicate record
Error_message=duplicateReturn true
If insert ok then Return true
End
Function delContentreturn Boolean valueBegintry
Set delete statement to delete by content value InsDelUpdBean del=new InsDelUpdBean()DelsetConnection()DelsetDelete(delete)Delsetshutdown()
Catch (error deletion)Error_message=error deletionReturn true
If deletion is ok then Return true
End
End class
Figure 222 Table of Content Check Class (continued)
84
2217 Knowledge Base Check Class
Class name KnowledgeBaseCheckPurpose check add modify for knowledge base Begin classFunction knowledgbaseCheck a constructor classFunction setQuestionno return value Parameter in string question Begin
Thisquestion=questionEnd
Function setChoiceAno return value Parameter in string choiceA Begin
ThischoiceA=choiceAEndFunction setChoiceBno return value Parameter in string choiceB Begin
ThischoiceB=choiceBEnd
Function setChoiceCno return value Parameter in string choiceC Begin
ThischoiceC=choiceCEndFunction setChoiceDno return value Parameter in string choiceD Begin
ThischoiceD=choiceDEnd
Function setChoiceEno return value Parameter in string choiceE Begin
ThischoiceE=choiceEEnd
Figure 223 Knowledge Base Check Class
85
Function setPlno return value Parameter in string Pl Begin
ThisP1=P1End
Function setP2no return value Parameter in string P2 Begin
ThisP2=P2EndFunction setP3no return value Parameter in string P3 Begin
ThisP3=P3End
Function setP4no return value Parameter in string P4 Begin
ThisP4=P4EndFunction setP5no return value Parameter in string P5 Begin
ThisP5=P5End
Function setfunction_callno return value Parameter in string function_call Begin
Thisfunction_call=function_allEndFunction setTopicno return value Parameter in string topic Begin
Thistopic=topicEnd
Figure 223 Knowledge Base Check Class (continued)
86
Function checkKnowledgeBase return boolean value Begin
if (questionlength()==0)found_error=trueerrors=Question field must have value
if (choiceAlength()==0)found_error=trueerrors=choiceA field must have value
if (choiceBlength()==0)found_error=trueerrors=choiceB field must have value
if (choiceClength()==0)found_error=trueerrors=choiceC field must have value
if (choiceDlength()==0)found_error=trueerrors=choiceD field must have value
if (choiceElength()==0)found_error=trueerrors=choiceE field must have value
if (function_calllength()==0)found_error=trueerrors=Function call field must have value
if (topiclength()==0)found_error=trueerrors=Topic Please choose topic
return found_error
End
Function addSample return Boolean add knowledgebase to database begin
InsDelUpdBean add=new InsDelUpdBean()Query= insert into knowledgebase
values(questionpip2p3p4p5choiceAchoiceB ChoiceCchoiceDchoiceE)AddsetConnection()Setinsert()Addshutdown()If no error then Return true Else return falseFunction getError return string value Begin
Return errorsEndEnd class
Figure 223 Knowledge Base Check Class (continued)
87
2218 Knowledge Base Deletion Class
Class name Kbase_delete Purpose delete for knowledge base
Begin classFunction kbase_delete a constructor classFunction delete_row return Boolean valueParameter in string questionBegin
QueryBean check=new queryBean()Thisquestion=questionDelete_query= delete from knowledgebase where
question_sample=questionDelsetConnection()Setdelete(delete)Delshutdown()If delete is ok then return true Else return false
End
End class
Figure 224 Knowledge Base Deletion Class
88
2219 User Information Class
Class name UserlnfoBeanPurpose check add delete update for usersBegin classFunction userinfobean a constructor classFunction serUsername no return valueParameter in string usernameBegin
Thisusername=usernameEnd
Function seroldpassword no return valueParameter in string oldpasswordBegin
Thisoldpassword=oldpasswordEndFunction serpasswordl no return valueParameter in string passwordlBegin
Thispasswordl=passwordlEndFunction serpassword2 no return valueParameter in string password2Begin
Thispassword2=password2EndFunction serUser no return value Parameter in string user Begin
Thisuser=userEndFunction serlast no return valueParameter in string lastBegin
Thislast=lastEndFunction serFirst no return value Parameter in string First Begin
Thisfirst=firstEnd
Figure 225 User Information Class
89
Function serEmail no return valueParameter in string emailBegin
Thisemail=emailEnd
Function startCheck no return valueParameter in string checkBegin
if (checkequals(upd))if (usernamelength()==0)
error_found=trueerror_message=Username field must have value
endifendif
if (checkequals(upd))if (oldpasswordlength()==0)
error_found=trueerror_message=01dpassword field must have value
endif endifif (passwordllength()==0) 1
error_found=trueerror_message=Password field must have value
endifif (password2length()==0) then error_found=true
error_message=Password field must have valueendifif (checkequals()) if (userlength()==0)
error_found=trueerror_message+=ltligtUser field must have value
endif endifif (firstlength()==0)
error_found=trueerror_messageFirstname field must have value
endifif (lastlength()==0)
error_found=trueerror_message=Lastname field must have value
endifif (emaillength()==0)
error_found=trueerror_message=Email field must have value
elseindex=emailindexOf()
if (index==-l)
Figure 225 User Information Class (continued)
90
error_message=Invalid Emailendifif (error_found==false) if (checkequals(S))
checkValidl() status=S
else if (userequals(Student)) checkValidl()
status=S endifelse if (userequals(Instructor))
checkValid2() status=P
endifendifreturn error_message
End
Function checkValidl no return value validate student account Begin
TrySsn_bound=parselnt(username)If((ssn is not between 1000000000-900000000)
Error_message=invalid SSNCatch (numberformatexception nfe)
Error__message=SSN contain 9 digitsEndFunction cehckvalid2 no return value validate professor account Begin
Try Ssn_bound=parselnt(username)If((ssn contains number)
Error_message=professor account should not allnumber
Catch (numberformatexception nfe)If(usernamelength gt 8)
Error=username contain 8 cahracterpasswordcheck()
EndFunction passwordcheck no return value
Figure 225 User Information Class (continued)
91
BeginIf(passwordl not equals password2) then
Error=password are not the sameEndFunction addUser no return value Begin
Stmt=insert all information to userinfo table InsUpdDelBean add=new InsupdDelBean Try
AddsetConnection()Setinsert(stmt)AddsetShutDown()
catch (sqlexception sql)error=username already taken error+=Please try again return false
if (add success) then return true else return false
EndFunction delUser no return value Begin
Stmt=delete from userinfo table by username InsupdDelBean del=new InsupdDelBean Try
AddsetConnection()Setdelete(stmt)AddsetShutDown()
catch (sqlexception sql) error=username does not exist error+=Please try again return false
if (del success) then return true else return false
EndFunction userChange return boolean value Begin
if (firstlength()==0) error_found=trueerror_message=Firstname field must have value
if (lastlength()==0)
error_found=trueerror message=Lastname field must have value
Figure 225 User Information Class (continued)
92
)if (emaillength()==0)
error_found=trueerror_message=Email field must have value
else index=emailindexOf()
if (index==-l)error_found=true error_message=Invalid Email
return error_found
End
Function passwordChange return boolean value Begin
if (oldpasswordlength()==0) error_found=trueerror_message=01dpassword field must have value
if (passwordllength()==0)
error_found=trueerror_message=Password field must have value
if (password2length()==0)
error_found=true error_message=Confirm Password field must have value
if (error_found==false)
passwordCheck()if (error_messagelength()=0)
error_found=truereturn error_found
EndFunction updateUser return boolean value Begin
if (userequals(Instructor ) ) status=P
else status=S stmtl=update userinfo set
firstname=+first+lastname=+last+email=+email+login_type=+status+
InsDelUpdBean upd=new InsDelUpdBean() try
updsetconnection()
Figure 225 User Information Class (continued)
93
upd setDelete (stmtl)rsquo updsetShutDown()
catch (SQLException sql) error_message=Database Error return false
if (update success) return true else return false
EndFunction updatepassword return boolean value Begin
if (userequals(Instructor)) status=P
else status=Sstmt2=update userinfo set password=+passwordl+ InsDelUpdBean upd=new InsDelUpdBean() try
updsetConnection() updsetDelete(stmt2 ) updsetShutDown()
catch (SQLException sql)error_message=Database Error return false
if (update success) return true else return false
EndFunction geterror return string value Begin
Return errorEnd
Figure 225 User Information Class (continued)
94
CHAPTER THREE
TESTING
Testing or software validation is the testing processto ensure that the program as implemented meets the
expectation of the user [3] The purpose of system
validation is to have assurance about the software quality
and functionalities This guarantees system performance and reliability also
31 The Testing Process
There are three testing processes that are used intesting WISE system unit testing subsystem testing andsystem testing
Except for small computer programs it is unrealisticto attempt to test systems using only unit testing Largesystems are built out of many small subsystems which may themselves be built out of procedures WISE system wastested by all three testing methods
32 Unit Testing
Unit testing is the basic level of testing where
individual components are tested to ensure that they
operate correctly These individual components can beobject class program and etc The following test rules
95
are defined to check that each component meets
specification
(a) Verify the handling of all valid input data type(b) Verify the handling of error condition(c) Check normal and abnormal program termination
(d) Check all buttons work as expected
Unit test offers the most effective way to detect
problems when comparing with the other testing methods On
the other hand this testing method cost more time and money to execute The later testing methods will show an
effective way to save time which will be discussed innext two sections The unit testing results of WISE system
are shown in Table 31
Table 31 Unit Test Results
Forms Tests Performed ResultsTutorial Applet bull Test all sorting algorithm
applets that describe in last section
Pass
Authorization bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
Student Sign Up bull Verify handling valid data input
bull Ensure all buttons and links work as expected
Pass
96
Forms Tests Performed ResultsPassword bull Verify handling valid data
inputbull Ensure all buttons and
links work as expected
Pass
Student MainMenu
bull Check all submit buttons Pass
TestingSelection
bull Check combo boxbull Check all buttons
Pass
Testing Page bull Check all text appearancebull Verify handling mouse inputbull Check submit button
Pass
Result ScorePage
bull Verify content appearancebull Check submit button
Pass
UserModification
bull Verify handling data inputbull Check button labels
appearancebull Check buttons work as
expected
Pass
Student feedback bull Verify handling data inputbull Check selection box
appearancebull Check all buttons work as
expected
Pass
Instructor Main Menu
bull Check all contentsbull Check all buttons and links
work as expected
Pass
General Question Creator
bull Verify handling data inputbull Verify selection box areabull Check all submit button
works as expected
Pass
97
Forms Tests Performed ResultsEZ question creator Page 1
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 2
bull Verify handling data selection
bull Check all buttons work as expected
Pass
EZ question creator Page 3
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question creator Page 4
bull Verify handling data inputbull Verify handling data
selectionbull Check all buttons work as
expected
Pass
EZ question management
bull Check handling edit buttonsbull Check handing delete
buttonsbull Check view content
apperance
Pass
Knowledge Base creator
bull Verify handling input databull Check retrieval selection
box information from database
bull Check all buttons work as expected
Pass
98
Forms Tests Performed ResultsKnowledge Base Management
bull Check response edit buttonbull Check response delete
buttonbull Check retrieval information
from databasebull Check confirm deletion
Pass
Score Management bull Check score retrieval by specific id
bull Check score retrieval by all id
bull Check All buttons work as expected
Pass
Preference Page bull Check instructors information retrieval from database
bull Verify handling data inputbull Check all submit buttons
work as expected
Pass
Content Creator bull Verify handling data inputbull Check all buttons work as
expected
Pass
Content Manager bull Verify table of content retrieval information from database
bull Check edit content responsebull Check delete content
response
Pass
SystemAdministratorMain Menu
bull Verify all menu contentsbull Check all links work as
expectedbull Check security feature
Pass
99
Forms Tests Performed ResultsUser Creator bull Verify handling all data
inputbull Check all buttons work
properly
Pass
User Manager bull Verify user information retrieval from database
bull Check edit content responsebull Check delete content
response
Pass
Log Off bull Check logoff link work properly
Pass
33 Subsystem Testing
Subsystem testing is the next step up in the testing
process where all related units form a subsystem to do a
certain task Thus the subsystem test process is useful
for detecting interface errors and specific functionsTable 32 shows subsystem test results in detail
100
Table 32 Subsystem Test Results
Subsystem Test performed ResultsGTSS tutorial system
bull Test all tutorial and applet of O(n2) and0 (nlogn)
Pass
Questionsubsystem
bull Test random guestion create answer and link statistic
Pass
Knowledge Base subsystem
bull Test create guestion manage question database
Pass
User subsystem bull Test user by create manage update user
bull Test security on user account
Pass
Score subsystem bull Check and test grade to pass chapter
bull Check score database and test score controller
Pass
34 System TestingSystem testing is the testing process that uses real
data which the system is intended to manipulate to testthe system First all subsystem will be integrated intoone system Then test the system by using a variety ofdata to see the overall result
System testing WISE system begins with the following steps (Table 33)
101
Table 33 System Test Results
System Testing Results1 Install WISE system into computer science
serverPass
2 Start up all services such as JSP engine MySQI database engine
Pass
3 Running testing by using real data on all forms and reports
Pass
35 Sample Session
The following section shows samples of how to use
WISE system in the demonstration of tutorials knowledge
base general question creator and EZ question creator
351 Demonstration of Tutorial- Ej m Ilaquo ilaquowtrvoi-t ltIoJgt Srdquo mdash n- ldquoltbull mdash gy aa
Oto of ths siinpiwst suiting algorithms is insertion suit Inseiliun sort leads eminent el a time in array Then it tries to rdort that elcrrent into its serted position of the reading array hy comparing (he prevail element one hy nne until the right position found
sequence of carts when the hist card it deeit there It nothing to de here tmae there is only one ceid ill the hand Second card is dealt we liave to cunoaiu and decide to place it before or after the first card For the third card wo also have to dacido to^placa cord before first cant nr before second card or after secord card
S 1 HOME J HELP NEXT i__ _ __ _ Z ldquo Tl _ J
(1)Flourcopy 21 intenionsortexomjlo
72)fie from tlaquob
Insertion Sort Analysis or algorithm [average case)
InerderteeoabseLueitoneert skerthoj I wffl ure KletBcntertiiC-i-t-re-rionajfstkrtctd
XurO-lr tJgt0| laquo ltraquo[J-l)gtlltuvl i J~) I etdl-efi-Ur
e[J] eterrpf
j gjtoedrttwet gt
(3) (4)Figure 31 Sorting Algorithms Tutorial
nL-tf=gt E3
102
The format of the tutorial consists of four Web pages
per sorting algorithms (see Figure 351) which includebasic operation sorting example sorting animation
applets and analysis of sorting algorithm Figure 351
(1) shows basic operation in plain text Figure 351(2)
explains more details of the algorithm Figure 351 (3)
shows the sorting animation Students just click on
forward buttons to start animation Figure 351 (4)shows analysis of algorithm Each analysis of algorithm
explains the average352 General Questi
case only
gtn Creator
ffc iv Vwrfjafs Ja E2Succosdul add to DB
Figure 32 General
__ i (a-2)
luestion Creator
General question creator (see Figure 352) tools
help to create general questions Figure 352 (1) shows the interface for creation of questions After filling outall the information The system saves it to the databaseand show the confirmation of the save operation
103
353 Knowledge Base Creator
hubSedass Buhb
public BiibhleflO
public void bubbleSortpnt cfl Ini al_p)(
Int l|Int le rap
lerplaquoOIltaJengthlraquolaquo][lor(j=l|lt(alengtM]jraquolaquoH
lemprsquolaquo|J-1JBWInrap)JH (I==al_p| IrsquoaJengih flelnp pmcasa
- rsquo raquofl HeCkolc tel-He
torpraquo0lltNJengthlraquoltJ(HMMll|nraquoO] nt-NftC else H(n2==tl] raquo2=ti(l] else tf(rraquo3O| b3rsquoN]I) else ll(igt4rdquo0] a4=hqij- else U|n5laquo-0] o5laquoN[IJ
Jdinlpoundes[H=ldquotIfrdquo Begin Select Java ProgramtradeD [luaotlao caUequalsftubbleTH
Bubble h1 = new Bubble) b1^ubbleSort(vsllaquoea1|Mluelaquoanayi nl oIraakeCholcesArrayfvalaechDlces)
Ielse II punrtlon cancqnalareetedlon1)[ Selection al new SctcdioaQ e1aeIeclloflSnftMtluenl]- cl jaakeCbalcesAiraytvaloccbolces)I
else II [function ullcqaaJsrioseRlenrsquolII losertlon IIraquo new Inaertloog11 JnaertlonSoft(valse^ilp clnakeChflleesAnayfsitlaechnleeB)
a ot pasting algorithm
(1) (2)Knowledge Base Creator
j flaquo I r4laquoilaquo j kSuccessful add to DB
flack To Main Monti
fffgsSS lsquo -E3-
Knowledge Base QuestionGvsn you etisy [5X3Z1] tHai 5 pastes in Bubble sort elgontim
Sample Choice A
Sample Choice B
Sample Choice C
Sample Choice D
Sample Choice E
Parameter name 13 i Ji-j
(3) (4)Figure 33 Testing Knowledge Base Creator
Figure 353 (1-2) shows fragments of the Javaprogram that the instructor has to1 do to find the answer It also shows another program fragment to define how to
create choices Figure 353 (3-4)rsquo shows the input question information which informother instructors that there is this question ready to create those exercises
104
354 Easy Question Creator
gtltrdquoraquo raquortgt _ EZ Quottion Creator For Q1B3
[mizw tdaottypo of antwo^l pM7MPiggtTPlj
jj-ifr- tiU-xampH-tfstctolVi rsquoBetj
EZ Quottion Creator lur CTS6----------
5tjgtit (Miu
pound
1 fvO Kfiowledqe Bote BclBtt Bomplu - -i t-1 lltlrven yon Array [S43) after S pawt mbuhbto || j|tort algorithm WNch of the fotowng choc it true 0 I Samoa i 1
H Hgyrraquo jiCZ
___ ______ ~ __
belaquoWlaquoirMMJWj C tgtpound FfOtu lMr
Question Creator
Stsp^Answpr 4_ ------------mdashmdashmdash_
PgtAwtelt5traquoatoCtlaquoJialaquorStraquoawkR8laquoilaquoraquoDWBllaquoKsss t
1lt id i I
L bdquo bullT 1
1 n bull i
CZZZ i J
ni 1
(4)Ffa tlaquo Xmdash frfHrtM lu -ngttgt
t tmfc|yBut5^5^ raquoj j
bdquo j
AgtMoay-jncyuoDJAtfOEyuraquoPl VarieBnorray Cetneet-gtOuMiandom West d64tts-gtNONE ArsySite-gt8 Jtendomnwlaquonuan-gt10 Jtand3miraquolaquoTraquoraquoiraquogt93 Siolaquovotoo-gtCN
P2 VaiitMraquogtparaquoi Potroet-aautoiendon) liter defce-tHONE ArraySUegtHONpound
rlaquogpoundq riampq
b-J fi
Hu (ltraquolaquolaquogt
(sFigure 34 Easy Question Creator
EZ question creator is shown in Figure 354 (1-5)
In step one the instructor has to choose which sortingquestion and type of answer to create Step two shows the knowledge base question based on step one After selecting
105
the type of question in step two the instructor can
modify the question in step three This question will
later be used in the interactive exercise after students
finished their tutorial In step four the instructor
chooses between letting program create answers or havingthe user defined them Step five shows all the question
information that WISE collected from step 1-4 Afterclicking finish button WISE saves all question
information to the database
106
CHAPTER FOUR
MAINTENANCE MANUAL
It is impossible to produce systems of any sizewhich do not need to be maintained System maintenance is
an important step to ensure that the system runs smoothly
and meets the customers expectation In WISE system
there are five major maintenance issues WISEs files and
directories WISE installation system migration anddatabase maintenance and program modification
41 Files and Directories
I have arranged related file and directories based onthe design in Chapter two There are seven main
directories see Tables 41-47 All directories are underusrlocaltomcatwebappswiseweb-infclasses
Table 41 Files in Main Directory
Java files under main classes directories1 Connectsqljava2 Connectfilej ava3 QueryBeanj ava4 InsDelUpdBeanj ava5 Shufflejava6 CreateChoicejava7 FileBeanj ava8 RandonNumberj ava
107
9 ScoreBeanj ava10 ReadFileBeanj ava11 AddQuestionGj ava12 AddQuestionJj ava13 Qmanagerj ava14 QuestionGjava15 QuestionJj ava16 TOC checkjava17 KbaseDeletej ava18 KnowledgebaseCheckj ava19 UserlnfoBeanjava20 Emailj ava21 SortGenj ava
42 Software Installation
This section shows how to install WISE to in theLinux operating system I assume that JSP Tomcat serverand mySQL are already installed in Linux system Thefollowing steps are needed for system migration
1 Download wisetargz file that is available atgtssiascsusbedu website
2 Copy the file to usrlocaltomcatwebapps3 extract the file by using this linux command
tar -xzvf wisetargz
4 Edit file usrlocaltomcatconfserverxml by adding the following line in the context manager section ltContext path=wise
108
docBase=webappswise debug=0
reloadable=true gt ltContextgt
5 Restart JSP tomcat server
WISE
43 System Migration
system is designed to run across platforms butif system administrator plans to move from one platform to
another there is nothing to do with WISE system except a
few check on configuration
When system administrator plan to move system to
different platform for example from Linux to windows The
following steps are needed for system migration
1 Make back up of the WISE system which is located
2
at usrlocaltomcatwebappsWISE
Make another backup of WISE database which is
3 located at usrlocalmysqldataWISESystem Administrator must download install and
4 configure JSP and MySQL windows versionDownload and install JDBC driver from
5
httpmmmysqlsourceforgenet
Copy back all backup files in Nol to both JSP
and MySQL directories
109
44 Database MaintenanceThe MySQL database locate at usrlocalMySQL in
Linux platform In order to perform maintanance process
system administrator has to log on to MySQL server to do
maintanance job Administrator can grants user to maintain
database by give permission in user table and db table of
mysql database Mysql database is located atusrlocalmysqldatamysql In user table there are a
variety of permissions such as grant user to modify tableor grant user to shut down server Db table is a table
that limit user to access databases
Example To add a user you must first logon to theMySQL database as administrator and use the mysqldatabase To do this perform the following steps
1 Change to mysql installation directorycd usrlocalmysql
2 Ensure that the mysqld is up and running binmysqladmin -p ping
3 You will be prompted for your root password
After you have entered it correctly you be able
to access mysql database by typing in thefollowing
use mysql
110
4 To create new user use the following command
insert into user(hostuserpassword)values
(gtssiascsusbeduscottpassword(test))5 To add select privileges to scott administrator
uses the following command
insert into db(hostuserdbselect_priv)
values(gtssiascsusbeduscottWISEY)
45 Recompilation
Usually Most of sixty-five percents of maintenancetask apply to modifying a program after it has been
delivered and is in use These modifications may involvesimple changes to correct code errors more extensivechanges to correct design errors or rewrite code to meetnew requirements
JSP keeps all compiled java programs (filenameclass)in usrlocaltomcatwebappswiseweb-infclassesModified java program must recompile by using javacfilenamejava command at Linux prompt After compiledJava will create filenameclass which will be moved to
the directory mentioned above
Alternative way is to create jar file The jar is theway to group all compiled Java program together as one
111
file The advantage is portable and easy to manage To
create jar file system administrator must compile all
Java program to get dot class files The next step is to group those files together by using the following command
jar cvf wisejar class Then using mv wisejar usrlocaltomcatlib to move the dot jar to the place
that Java program can link to
112
CHAPTER FIVECONCLUSIONS AND FUTURE DIRECTIONS
51 Conclusion
WISE system shows another successful project in GTSS
project which includes complete sorting algorithmtutorials system and interactive self-evaluation exercisesystem With Java object-oriented design and MYSQL
database design WISE system delivers fast reliable and
highly portable Web-based exercise management system
By using this master project students can evaluate
their understanding of Analysis of sorting algorithmthrough on interactive online system Also instructors areable to create and manage questions to evaluate students
performance via WISE self-evaluation tools Tools for creating self-evaluation exercises include EZ questioncreator for creating question database and automaticexercises and knowledge base creator for creating newintelligent Java programs for creating automatic answer toprevent cheating
WISE can be accessed anywhere by any Web browserJava runtime environment software version 11 or later isrequired to access the system A user can download this
free software from Sun Website or automatically download
113
on Windows platform By using session tracking technology
the user activity information can be kept securely on WISEserver This ensures the user privacy
Moreover the experiences in implementing this
project consist of using various technologies Java JDBC
MySQL and Web server which provided valuable knowledgefor myself
52 Future DirectionsWISE system shows a new way in implementing
interactive self-evaluation system on the Web WISEsfeatures were declared earlier in Chapter One Using theseas the starting point WISE may have additional and
improved features521 Adaptive Test
By using artificial intelligence concept newadaptive test can be developed Adaptive test is an intelligent tests that respond with the users answerWhen the user answers a question correctly the nextquestion will be harder otherwise easier question will be
asked Test engine will calculate the score based on the
weighted of the correct answers
114
522 Graphic Score Analyzer
With the current score representation WISE systemstill shows an individual score This analyzer tool will include for all the registered users in WISE system
Graphic score analyzer will help students compare their
score with others With graphic color bar chart or pie
charts the students can measure their abilities
115
APPENDIX
GLOSSARY
116
Terminology DefinitionInsertion Sort Sort by repeatedly taking the next
item and inserting it into the final data structure in its proper order with respect to items already inserted Run time is 0 (n2)
Heap Sort A sorting algorithm that works by first organizing the data to be sorted into a special type of binary tree called a heap The heap itself has by definition the largest value at the top of the tree so the heap sort algorithm must also reverse the order It does this with the following steps1 Remove the topmost item (the
largest) and replace it with the rightmost leaf The topmost item is stored in an array
2 Re-establish the heapRepeat steps 1 and 2 until there are no more items left in the heap
Merge Sort A sorting algorithm which splits the items to be sorted into two groups recursively sorts each group and merge them into a final sorted sequence Run time is 0(n log n)
Bubble Sort Sorting by comparing each adjacent pair of items in a list in turn swapping the items if necessary and repeating the pass through the list until no swaps are done
117
Terminology DefinitionQuick Sort An in-place sort algorithm that uses
the divide and conquer paradigm It picks an element from the array (the pivot) partitions the remaining elements into those greater than and less than this pivot andrecursively sorts the partitions There are many variants of the basic scheme above to select the pivot to partition the array to stop the recursion on small partitions etc
Java Applet Java Applet is a kind of mini-application design to be run by a Java-enabled Web Browser such as Internet Explorer or Netscape Navigator or in the context of some others applet viewer
Java 2 Development Kit
Java 2 SDK is Java development program from Sun Microsystems JSDK will be used to compile and run java program for this project
Java Server Pages JSP is a Java-based technology that simplifies the process of developing dynamic web sites JSP is also a type of server-side scripting language Although there are many server-side scripting languages such as ASP PHP Java Script JSP is the best choice for platformindependent
JAKARTA-TOMCAT Jakarta Project is to provide commercial-quality server solutions based on the Java Platform that is developed in an open and cooperative fashion Simply Tomcat is JSP server Tomcat will receive JSP file execute JSP command and response back to clientJakarta-Tomcat is free and availableon the Internet athttpjakartaapacheorg
118
Terminology DefinitionJava Database Connectivity
JDBC technology is an Application Programming Interface that lets you access virtually any tabular data source from the Java programming language In other words It helps java program to communicate query and update databases JDBC needsJDBC driver as a connector (pipe) between java program and database program There are many vendors provide these drivers
119
REFERENCES
1] Charles Standton Javier Toner Arturo Concepcion GTSS Generic Tutorial System for SciencesSymposium at California State University San Bernardino 1998
[2] HM Deitel PJ Deitel Java how to programPrentice Hall United States 1999
[3] Ian Sommerville Software Engineering ThirdEdition Addison Wesley 1989
[4] Karl Avendal and Danny Ayers Professional JSP WroxPress United States 2000
[5] Martin Hall Core servlets and JavaServer PagesPrentice Hall United States 2000
[6] Mark Maslakowski Tony Butcher MySQL in 21 DaysSAMS Press United States 2000
[7] Matthew Simple The complete Guild to Java DatabaseProgramming McGraw Hill Unites States 1998
[8] Mark Weiss Data Structures and Algorithm Analysis inC Addison Wesley United States 1997
[9] Robert Sedgewick Algorithms in C Addison WesleyUnited States 1998
[10] Software Engineering Standard Committee IEEE Recommended Practice for Software Requirements Specifications The Institute of Electrical and Electronics Engineers United States 1994
120