Home

Team Project: Specifications by Scott LaForge

image

Contents

1. gt lt php if empty errors display_errors errors gt lt form action login php method post gt lt table gt lt tr gt lt td gt Username lt td gt lt td gt lt input type text name username maxlength 30 value lt php echo htmlentities username gt gt lt td gt lt tr gt lt tr gt lt td gt Password lt td gt lt td gt lt input type password name password maxlength 30 value lt php echo htmlentities password gt gt lt td gt lt tr gt lt tr gt lt td colspan 2 gt lt input type submit name submit value Login gt lt td gt lt td gt lt a href new_user php gt Create An Account lt a gt lt td gt lt tr gt lt table gt lt form gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Logout php lt php require_once includes functions php gt lt php Four steps to closing a session i e logging out 1 Find the session session_start 2 Unset all the session variables _SESSION array 3 Destroy the session cookie if isset _COOKIE session_name setcookie session_name time 42000 4 Destroy the session session_destroy redirect_to login php logout 1 gt 58 Modifygame php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions p
2. lt table id structure gt lt tr gt lt td id page gt lt div id gamescontainer gt lt ul id gamesmenu gt lt lt echo lt a href siteaddress id _ SESSION user_id gt gt gt lt php if isset _REQUEST id uid _SESSION user_id id _REQUESTT id date date Y m d H i s time phpdate strtotime date checks to see if this is Andon s game If it is it sends the userid if id 6 query Andon Select siteaddress from game where id id 52 resultAndon mysql_query query Andon gaddress mysql_result resultAndon 0 siteaddress if resultAndon echo lt META HTTP EQUIV Refresh Content 0 URL gaddress uid uid gt exit result mysql_query INSERT INTO livegame userid gameid datetime numquestion numquestionsanswered ended numcorrect VALUES uid id FROM_UNIXTIME phpdate 0 0 0 0 query2 Select siteaddress from game where id id result2 mysql_query query2 siteaddress mysql_result result2 0 siteaddress query3 Select id UNIX_TIMESTAMP datetime from livegame where UNIX_TIMESTAMP datetime phpdate result3 mysql_query query3 lid mysql_result result3 0 id if result3 echo lt META HTTP EQUIV Refresh Content 0 URL siteaddress id lid gt exit else message There was a problem redirecting to the Game Site messag
3. border collapse collapse table fullsize table td padding 5px border solid 1px e8eef4 table th padding 6px Spx text align left background color e8eef4 border solid 1px e8eef4 MISC min width 900 clear both Crror color Red menucontainer margin top 40px min width 900 div title display block float center 94 text align center logindisplay font size 1 lem display block text align center margin 10px color White logindisplay a link color white text decoration underline logindisplay a visited color white text decoration underline logindisplay a hover color white text decoration none Styles for validation helpers field validation error color ff0000 field validation valid display none input validation error border 1px solid ff0000 background color ffeeee validation summary errors font weight bold color ff0000 validation summary valid 95 display none Styles for editor and display helpers display label editor label display field editor field margin 0 5em 0 text box width 30em text box multi line height 6 5em tri state width 6em 96 Appendiz B User Manual I Overview The purpose of th
4. id submit value Update gt lt td gt lt table gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt td gt First Name lt td gt lt td gt lt php echo lt input type text name firstname maxlength 100 echo value firstname gt lt td gt Last Name lt td gt lt php echo lt td gt lt input type text name lastname echo value lastname gt lt td gt gt lt td gt User Name lt td gt lt php echo lt td gt lt input type text name username echo value username gt lt td gt gt lt td gt Password lt td gt lt php echo lt td gt lt input type text name password echo value password gt lt td gt gt lt td gt Email lt td gt lt php echo lt td gt lt input type text name email maxlength 100 echo value email gt lt td gt lt tr gt lt tr gt lt td gt lt td gt gt lt td colspan 2 gt lt input type submit name submit 67 lt tr gt lt table gt lt table gt lt form gt lt td gt lt php include includes footer php gt Modifyuser php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm logged in gt lt php include includes head_admin php gt lt php
5. lt h3 gt The Genre has been successfully updated lt h3 gt else message The Genre could not be updated message lt br gt mysql_error else if count errors 1 message There was error in the form 61 else message There were count errors errors in the form else Form has not been submitted name 2 We description gt lt php if isset _REQUEST id id _REQUEST id query SELECT FROM genre WHERE id id result mysql_query query if result amp amp feed mysql_fetch_object result id feed gt id name feed gt name description feed gt description else id NULL name description msg msg Wrong access ID is null lt a href viewgenres php gt Try again lt a gt lt br gt ts lt php if empty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt n gt lt form name updated action modifygenre php method post gt lt php echo lt font color red gt msg lt font gt gt lt table border 1 gt lt tr gt lt td colspan 2 align center gt Update and save lt td gt lt tr gt lt tr gt lt php echo lt td gt lt input type hidden name id value id gt lt td gt gt lt tr gt lt tr gt lt td gt Name lt td gt lt php e
6. Form has not been submitted name is description gt lt div id main gt lt h2 gt Add A New Genre lt h2 gt lt a href viewgenres php gt Return to List lt a gt 49 lt table id structure gt lt tr gt lt td id page gt lt php if lempty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form action addgenre php method post gt lt table gt lt tr gt lt td gt Name lt td gt lt td gt lt input type text name name maxlength 100 value lt php echo htmlentities name gt gt lt td gt lt td gt Description lt td gt lt td gt lt textarea name description cols 40 rows 8 maxlength 250 value lt php echo htmlentities description gt lt td colspan 2 gt lt input type submit name submit value Add lt tr gt lt tr gt gt lt textarea gt lt td gt lt tr gt lt tr gt gt lt td gt lt tr gt lt table gt lt form gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Continue php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm logged in gt lt php include includes head php gt lt php include_once includes form_functions php gt lt di
7. gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt Modify Word Description Pairs lt h2 gt lt a href mydata php gt Back to list lt a gt lt php 71 if isset _POST submit Form has been submitted errors array perform validations on the form data reguired fields array word description errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array word gt 100 description gt 500 errors array_merge errors check_max_field_lengths fields_with_lengths _POST id _POST id word _POST word genreid _POST genre description _POST description if empty errors query UPDATE question SET word word genreid genreid description description WHERE id id result mysql_query query connection if result message lt h3 gt Your Word Description Pair has been successfully updated lt h3 gt else message Your Word Description Pair could not be updated message lt br gt mysql_error else if count errors 1 message There was error in the form else message There were count errors errors in the form else
8. lt checks to see if this is Andon s game and send appropriate variables if gid 6 echo lt a href siteaddress uid uid amp id lid gt gt Continue lt echo title gt lt a gt lt b gt lt td gt lt td gt lt td gt lt otherwise sends the standard variables else echo lt a href siteaddress id lid gt gt Continue lt echo title gt lt a gt lt b gt lt td gt lt td gt lt td gt lt gt lt td gt lt percent 100 d numcorrect numquestions percent gt lt echo numquestionsanswered gt out of lt echo numquestions gt questions answered lt td gt lt td gt Current Score lt echo number_format d 2 gt lt td gt lt b gt lt td gt 51 m lt echo lt a href continue php id lid gt gt Delete Game lt a gt lt b gt lt td gt lt tr gt lt b gt lt i gt lt td gt lt tr gt lt table gt lt ul gt lt div gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Games php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm logged in gt lt php include includes head php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt Choose a Game to Play lt h2 gt
9. 2 1 13 2 The interface shall display a form with the current data stored in the database 2 1 13 3 The program shall allow the administrator to change the word description and genre of the particular pair 2 1 13 4 The program shall update the database with the new information 13 2 1 13 5 2 1 13 6 2 1 13 7 when the save button is selected The program shall display a message stating that the pair was successfully updated when the save button is selected The interface shall display an error message when the program was unsuccessful at updating the database The interface shall contain a link that shall direct the administrator to the entire list of word description pairs Modify Word Description Pairs Back to list Name Description Genre Update and save Accretion The process by where dust and gas A accumulated into larger bodies such as stars and planets Astronomy x Save Figure 2 1 13 Admin Modify Data interface 2 1 14 Admin View Genre Screen Requirements 2 1 14 1 2 1 14 2 The interface shall allow administrators to view the genres that have been added into the database The interface shall have a link directing them to a page where they may modify each genre 14 2 1 14 3 The interface shall have a link allowing them to delete any genre 2 1 14 4 The interface shall provide a link to go to an add new genre page 2 1 14 5 The interface shall display the name and
10. FROM question WHERE id id result mysql_query query if result amp amp feed mysql_fetch_object result id feed gt id 42 word feed gt word description feed gt description genre feed gt genreid else id NULL word description genre msg msg Wrong access ID is null lt a href mydata php gt Try again lt a gt lt br gt gt lt php if lempty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt 43 5 Conclusion To reiterate this document provides insight into the structural layout of the online self learning software being developed by the Spring 2011 CNT 4104 Computer Network Programming students It follows a standard client server model containing a web interface server and database where users can log in insert data sets and play games related to memorization The functional reguirements specifications designate the reguirements necessary to support the site s accessibility navigation session states and data management Both the static and dynamic design diagrams and descriptions thoroughly incorporate these functional requirements and map how they fit together to package a complete software The implementation section describes in detail how the code work to create a complete user experience For future students who continue this projec
11. Form has not been submitted word description gt lt php if isset _REQUEST id id _REQUESTT id query SELECT FROM question WHERE id id result mysql_query query if result amp amp feed mysql_fetch_object result id feed gt id word feed gt word description feed gt description genre feed gt genreid else 72 id NULL word description genre msg msg Wrong access ID is null lt a href mydata php gt Try again lt a gt lt br gt gt lt php if lempty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form name updated action modifyuserpair php method post gt lt php echo lt font color red gt msg lt font gt gt lt table border 1 gt lt tr gt lt td colspan 2 align center gt Update and save lt td gt lt tr gt lt tr gt lt php echo lt td gt lt input type hidden name id value id gt lt td gt gt lt tr gt lt tr gt lt td gt Name lt td gt lt php echo lt td gt lt input type text name word value word gt lt td gt gt lt tr gt lt tr gt lt td gt Description lt td gt lt php echo lt td gt lt textarea name description cols 40 rows 8 gt description lt textarea gt lt td gt gt lt tr gt lt tr gt lt td gt Genre
12. III Logging in to the Site From the home page click either the tab at the top right that says Log In or the hyperlink in the center of the page that states Already a Member Please log in Until you sign in you will not have access to the site contents At the log in page enter your username and password and click the button titled Log In If you do not currently have an account click the hyperlink that states Create an Account next to the form and create an account 98 FGCU Computer Science Online Learning Game Welcome to the FGCU Online Learning Game Website Login Create An Account Figure B2 Log In Page IV User Site Navigation Once you are logged in you will be redirected to the home page where you will see a welcome message that includes your username You now have access to the site and may entertain yourself with all that the site has to offer Across the top of the screen are different tabs that lead you to the different pages of the site Those users with administrative privileges will see a hyperlink at the bottom of the page under the copyright titled Admin Panel where they may click and be directed to the administrative side of the site The following subheadings will explain what you may do on each page 99 FGCU Computer Science Online Learning Game Welcome slaforge Have fun playing games and uploading Word Description Pairs Click here to logout Up
13. Inputdata php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm logged in gt lt php include includes head php gt lt php include_once includes form_functions php START FORM PROCESSING if isset _POST submit Form has been submitted errors array perform validations on the form data reguired fields array word description errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array word gt 100 description gt 500 errors array_merge errors check_max_field_lengths fields_with_lengths _POST word trim mysql_prep _POST word description trim mysql_prep _POST description genre trim mysql_prep _POST genre if empty errors query INSERT INTO question word description genreid addedby VALUES word description genre _SESSION user_id 54 result mysql_query query connection if result message lt h3 gt The word pair has been successfully added lt h3 gt word description query UPDATE users SET rank rank 1 WHERE id _SESSION user_id result mysql_query query connection else message The word pair could not be added message lt br gt
14. include_once includes form_functions php gt lt div id main gt lt h2 gt Modify Users lt h2 gt lt a href viewusers php gt Back to list lt a gt lt php if isset _POST submit Form has been submitted _POST gt 100 _POST errors array perform validations on the form data reguired fields array id firstname lastname username password rank email active admin errors array_merge errors check_required_fields required_fields fields_with_lengths array firstname gt 100 lastname gt 100 username gt 100 password gt 40 email errors array_merge errors check_max_field_lengths fields_with_lengths id _POST id firstname trim mysql_prep _POST firstname lastname trim mysql_prep _POST lastname username trim mysql_prep _POST username password trim mysql_prep _POST password rank trim mysql_prep _POST rank email trim mysql_prep _POST email active trim mysql_prep _POST active admin trim mysql_prep _POST admin if empty errors query UPDATE users SET firstname firstname lastname lastname username username hashed_password password rank rank email email active active admin admin WHERE id id 68 result mysql_query query connection if
15. mysql_error else if count errors 1 message There was error in the form else message There were count errors errors in the form else Form has not been submitted word description gt lt div id main gt lt h2 gt Input word description pairs lt h2 gt lt a href mydata php gt View List lt a gt lt table id structure gt lt tr gt lt td id page gt lt php if lempty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form action inputdata php method post gt lt table gt lt tr gt lt td gt Word lt td gt lt td gt lt input type text name word maxlength 100 value lt php echo htmlentities word gt gt lt td gt lt tr gt lt tr gt lt td gt Description lt td gt lt td gt lt textarea name description cols 40 rows 8 maxlength 500 value lt php echo htmlentities description gt gt lt textarea gt lt td gt lt tr gt lt tr gt lt td gt Genre lt td gt lt td gt lt php query2 SELECT id name from genre order by name 55 result2 mysql_query query2 echo lt select name genre value gt Name lt option gt printing the list box select command while nt mysql_fetch_array result2 Array or records stored in nt if nt id 1 echo lt option value nt id
16. result message lt h3 gt The profile has been successfully updated lt h3 gt else message The profile could not be updated message lt br gt mysql_error else if count errors 1 message There was error in the form else message There were count errors errors in the form else Form has not been submitted n firstname n lastname n username n password n email gt lt php if isset _REQUEST id id _REQUESTT id query SELECT FROM users WHERE id id result mysql_query query if result amp amp feed mysql_fetch_object result uid feed gt id firstname feed gt firstname lastname feed gt lastname username feed gt username password feed gt hashed_password rank feed gt rank email feed gt email active feed gt active admin feed gt admin else uid NULL n firstname n lastname n username n password rank mz n email active nn admin msg msg Wrong access ID is null lt a href viewusers php gt Try again lt a gt lt br gt gt lt php if lempty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form n
17. 27 2 3 2 Site Registration Figure 2 3 1 portrays the sequencing of event for registering new users and user login Requirements 2 1 1 and 2 2 2 In this diagram a user views the website through a web browser The web browser connects through the Internet to the online self learning software consisting of a web server web pages and a database for controlling data population specific to the user The user types the web address of the game site This requests the home page from the web server In response the web server returns the home page screen The user then clicks on the registration link on the home page This sends a request to the web server Since the user is not logged in or registered a blank registration page is returned by the server This is then populated by the user and submitted Upon submission the request is sent to the web server the web server receives the filled out page and then prepares it for being rendered to the website s database The information is initialized user id and registration information is established as a new user and then this information is passed to the database for storage The registration information is then returned successfully The completed registration page is rendered and returned through the web server to the web browser client side displaying a completed registration page reiterating the sign up information The sequence diagram depicts the act of logging in as a simple block in the center
18. Modify Delete Name Description Modify Delete Astronomy e bra of physics that stu elestial bodies and the universe as a whole Modi Delete Biology ol sana e ed v study of life and living organisms including their structure function growth origin Modify Delete Computer T idy of the ndations of and station and al techniques for their implementation and Science ati Modify Delete Horticulture The industry nc c cess of preparing soil for planting of seeds tubers or cuttings Modify Delete Misc scella nc ns A perfect plac question when you are not certain where it should go or the Modify Delete Movies Film encomp ion pictures the field of film as an art form and the motion picture industr Modify Delete Video Games f ng a microcomputer with a keyboard and often joysticks to manipulate changes or respond to the Figure B12 View Genre Page C Add New Genre Page If you select the Add New Genre hyperlink on the Genre page you will be directed to a page where you may add new genres into the database Simply fill in the different sections of the form Add a new genre name up to 100 characters long in the Name text box Add its definition or description in the Description text box Then click the Add button A message at the top of the page above the form will inform you that the genre was successfully added to the database If there was an error an error message will display instead To view the genres
19. _SESSION user_id result mysql_query select g id g title g siteaddress lg numquestion lg numquestionsanswered lg ended lg numcorrect from game as g 77 inner join livegame as lg on lg gameid g id where lg userid id amp amp lg ended 1 num mysql_numrows result i 0 while i lt num title mysql_result result i g title numquestions mysql_result result i lg numquestion numanswered mysql_result result i Ig numquestionsanswered numcorrect mysql_result result i lg numcorrect gt lt tr gt lt b gt lt td gt lt echo lt a href siteaddress id _SESSION user_id gt gt lt echo title gt lt a gt lt b gt lt td gt lt td gt lt td gt lt td gt lt percent 100 d numcorrect numquestions percent gt lt echo numcorrect gt out of lt echo numquestions gt questions answered correctly lt td gt lt td gt Final Score lt echo number format d 2 gt lt td gt lt tr gt lt b gt lt i gt lt td gt lt tr gt lt table gt lt ul gt lt div gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Staff php lt php require_once includes session php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head_admin php gt lt div id main gt lt h2 gt Adm
20. id id _REQUEST id query DELETE FROM game WHERE id id result mysql_query query if result message lt h3 gt The Game has been successfully deleted lt h3 gt else message The Game could not be deleted message lt br gt mysql_error if lempty message echo lt p class message gt message lt p gt if empty errors display_errors errors echo lt table gt lt tr gt lt td gt lt b gt Modify lt b gt lt td gt lt td gt lt b gt Delete lt b gt lt td gt lt td gt lt b gt Title lt b gt lt td gt echo lt td gt lt b gt Description lt b gt lt td gt lt td gt lt b gt Site Address lt b gt lt td gt lt tr gt result mysql_query SELECT FROM game ORDER BY title asc num mysql_numrows result i 0 while i lt num id mysql_result result i id title mysql_result result i title description mysql_result result i description siteaddress mysql_result result i siteaddress 80 m gt lt tr gt lt b gt lt td gt lt echo lt a href modifygame php id id lt td gt lt td gt lt echo lt a href viewgames php id id lt echo title gt lt td gt lt b gt lt td gt lt echo description gt lt td gt lt td gt lt echo siteaddress gt lt td gt lt tr gt lt i gt gt Modify lt a gt gt mt gt Delete lt a gt gt lt td g
21. ie slaforge rslaforg eagle fgcu edu Figure B9 Update Profile Page IV Administrator Site Navigation FGCU Computer Science Online Learning Game Figure B10 Admin Navigation links A Data Page By clicking on the tab titled Data you will be directed to a page listing all of the word description pairs that have been added by users on the site Each line in the list will display a modify and delete button along with the word or group of words its description and the genre that it belongs to By selecting the modify button the administrator will be directed to a page where the pair may be edited By selecting the delete button the word description pair will be deleted from the database and removed from the list If the word description pair is 106 successfully deleted a message stating that the word description pair was successfully deleted will be displayed View Modify and Delete Word Description Pairs Modify Delete Word Modify Delete Accretion Modify Delete Algorithm Modify Delete Assembly Language Modify Delete AVL Tree Modify Delete Cache Modify Delete Computer Modify Delete Computer Science Modify Delete Constellation Modify Delete Critical Section Modify Delete Dijkstra Description Genre as accumulated into larger bodies such as stars and planets improves performance by transparently storing data such that future reguests for that data
22. padding 30px 30px 15px 30px background color fff margin bottom 30px _height 1px only IE6 applies CSS properties starting with an underscore footer color 999 padding 10px 0 text align center line height normal margin 0 font size 9em tab text indent lin TAB MENU ul menu border bottom 1px 5C87B2 solid padding 0 0 2px position relative margin 0 text align center ul menu li display inline list style none ul menu li greeting padding 10px 20px font weight bold text decoration none line height 2 8em color fff 92 ul menu li a padding 10px 20px font weight bold text decoration none line height 2 8em background color e8eef4 color 034af3 ul menu li a hover background color fff text decoration none ul menu li a active background color a6e2a6 text decoration none ul menu li selected a background color fff color 000 FORM LAYOUT ELEMENTS fieldset margin lem 0 padding lem border 1px solid CCC fieldset p margin 2px 12px 10px 10px legend font size 1 lem font weight 600 padding 2px 4px 8px 4px input type text width 200px border 1px solid CCC 93 input type password width 200px border 1px solid CCC TABLE table border solid 1px e8eef4
23. selected selected gt nt name lt option gt else Option values are added by looping through the array echo lt option value nt id gt nt name lt option gt Option values are added by looping through the array echo lt select gt Closing of list box gt lt tr gt lt tr gt lt td gt lt td gt lt td colspan 2 gt lt input type submit name submit value Add gt lt td gt lt tr gt lt table gt lt form gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Login php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php include includes head php gt lt php if logged_inQ redirect_to staff php include_once includes form_functions php START FORM PROCESSING if isset _POST submit Form has been submitted errors array perform validations on the form data 56 reguired fields array username password errors array_merge errors check_required_fields required_fields POST fields_with_lengths array username gt 30 password gt 30 errors array_merge errors check_max_field_lengths fields_with_lengths _POST username trim mysql_prep _POST username password trim mysql_prep _POST password if empty e
24. 1 result_set mysql_query query connection confirm_query result_set REMEMBER if no rows are returned fetch_array will return false if subject mysql_fetch_array result_set return subject else return NULL function get_page_by_id page_id global connection query SELECT query FROM pages query WHERE id page_id query LIMIT 1 result_set mysql_query query connection confirm_query result_set REMEMBER if no rows are returned fetch_array will return false if page mysql_fetch_array result_set return page else return NULL function get_default_page subject_id Get all visible pages 85 page set get pages for subject subject id true if first page mysql_fetch_array page_set return first_page else return NULL function find_selected_page global sel_subject global sel_page if isset _GET subj sel subject get_subject_by_id _GETT subj sel page get_default_page sel_subject id elseif isset _GET page sel_subject NULL sel page get page by id GETI page else sel_subject NULL sel_page NULL function navigation sel_subject sel_page public false output lt ul class subjects gt subject_set get_all_subjects public while subject mysql_fetch_array subject_set out
25. 2 1 22 2 The interface shall provide a log out button allowing the user to stop the current session 2 1 22 3 The interface shall display the title of the site 2 1 22 4 The program shall display a log in button if the user is currently not logged in FGCU Computer Science Online Learning Game Figure 2 1 22 User Header File Interface 22 2 1 23 Admin Header File Interface Reguirements 2 1 23 1 The interface shall provide buttons for users with administrative privileges to the different pages on the site 2 1 23 2 The interface shall provide a log out button allowing the administrator to stop the current session 2 1 23 3 The interface shall display the title of the site 2 1 23 4 The program shall display a log in button if the administrator is currently not logged in FGCU Computer Science Online Learning Game Figure 2 1 23 Admin Header File Interface 2 1 24 Footer File Requirements 2 1 24 1 The interface shall display the copyright year along with the name of the Computer Science Department 2 1 24 2 A link to the administrative portion of the site shall be displayed when users with administrative privileges are logged in Copyright 2011 FGCU Computer Science Department Figure 2 1 24 Footer File Interface 23 2 2 Static Representation 2 2 1 Overview The purpose of this section is to provide a static representation of the online self learning software interface separated into component
26. a link directing them to a page where they may modify each user 2 1 17 3 The interface shall have a link allowing them to delete any user 2 1 17 4 The interface shall display the username and email of all the users in the database 2 1 17 5 The interface shall display a message telling the administrator that the user was successfully deleted when the administrator selects the delete link 2 1 17 6 The interface shall display an error message when the program is unsuccessful at deleting the user from the database 17 View Modify and Delete the Online Users Modify Modi Modi Modi Modi Modi EPES Modi Modi Modi ii Modi Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Username amcolema capitalreef jocanas justinHodnett lilapolarski ncalteen slaforge tUjyanai Zalewski Email amcolemaGeagle fgcu edu capital reef com jrhodnet eagle facu edu lilapolarski yahoo com ncalteen gmail com rslaforg eagle fgcu edu tyyanai eagle fgcu edu ikswelaz gmail com Figure 2 1 17 Admin View User interface 2 1 18 Admin Modify Users Screen Requirements 2 1 18 1 2 1 18 2 2 1 18 3 2 1 18 4 2 1 18 5 2 1 18 6 2 1 18 7 The interface shall allow administrators to modify a selected user The interface shall display a form with the current data stored in the database The program shall allow the administrator to change the first name last name username pass
27. admin if t 1 echo lt center gt lt font face Verdana size 2 gt lt br gt lt a href staff php gt Admin Panel lt a gt lt br gt lt center gt lt font gt echo mysql_error gt lt div gt lt body gt lt html gt lt php 5 Close connection mysql_close connection gt Form_functions php lt php function check_required_fields required_array field_errors array foreach required_array as fieldname if isset _POST fieldname Il empty _POST fieldname amp amp _POST fieldname 0 field_errors fieldname return field_errors function check_max_field_lengths field_length_array field_errors array foreach field_length_array as fieldname gt maxlength if strlen trim mysql_prep _POST fieldname gt maxlength field_errors fieldname return field_errors 83 function display_errors error_array echo lt p class errors gt echo Please review the following fields lt br gt foreach error_array as error echo error lt br gt echo lt p gt gt Functions php lt php This file is the place to store all basic functions function mysql_prep value magic_quotes_active get_magic_quotes_gpc new_enough_php function_exists mysql_real_escape_string i e PHP gt v4 3 0 if new_enough_php PHP v4 3 0 or higher undo any magi
28. description of the genre 2 1 14 6 The interface shall display a message telling the administrator that the genre was successfully deleted when the administrator selects the delete link 2 1 14 7 The interface shall display an error message when the program is unsuccessful at deleting the genre from the database View Add Modify and Delete Genres gt Modify Delete Modify Delete Modify Delete Modify Delete Modify Delete Modify Delete Modify Delete Name Astronomy Computer Science Horticulture Misc Movies Video Games Description The branch of physics that studies celestial bodies and the universe as a whole The study of the theoretic application in comp The industry and sc of preparing soil for the planting of seeds tubers or cuttings estions A perfect place to put a question when you are not certain where it should go or the ayed using a microcomputer with a keyboard and often joysticks to manipulate changes or respond to the een Figure 2 1 14 Admin View Genres interface 2 1 15 Admin Modify Genre Screen Requirements 2 1 15 1 The interface shall allow administrators to modify a selected genre 2 1 15 2 The interface shall display a form with the current data stored in the database 2 1 15 3 The program shall allow the administrator to change the name and description of a particular genre 2 1 15 4 The program shall update the database with the new information w
29. gt lt td gt lt td gt lt echo genre gt lt td gt lt tr gt lt i gt lt tr gt lt table gt lt td gt lt php include includes footer php gt New_user php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php include includes head php gt lt php include_once includes form_functions php START FORM PROCESSING if isset _POST submit Form has been submitted _POST errors array perform validations on the form data reguired fields array firstname lastname username password email errors array_merge errors check_required_fields required_fields fields_with_lengths array firstname gt 100 lastname gt 100 username gt 100 password gt 40 email gt 100 errors array_merge errors check_max_field_lengths fields_with_lengths _POST firstname trim mysql_prep _POST firstname lastname trim mysql_prep _POST lastname username trim mysql_prep _POST username password trim mysql_prep _POST password email trim mysql_prep _POST email if empty errors query INSERT INTO users firstname lastname username hashed_password rank email active admin VALUES firstname lastnam
30. h3 gt The Word Description Pair has been successfully deleted lt h3 gt else message The Word Description Pair could not be deleted message lt br gt mysql_error if lempty message echo lt p class message gt message lt p gt if empty errors display_errors errors echo lt table gt lt tr gt lt td gt lt b gt Modify lt b gt lt td gt lt td gt lt b gt Delete lt b gt lt td gt lt td gt lt b gt W ord lt b gt lt td gt echo lt td gt lt b gt Description lt b gt lt td gt lt td gt lt b gt Genre lt b gt lt td gt lt tr gt id _SESSION user_id query select q id q word q genreid q addedby q description g id g name u id from question as q inner join genre as g on q genreid g id inner join users as u on q addedby u id where q addedby id ORDER BY word asc result mysql_query query num mysql_numrows result i 0 while i lt num qid mysql_result result i q id word mysql_result result i q word description mysql_result result i q description genre mysql_result result i g name gt 74 lt tr gt lt b gt lt td gt lt echo lt a href modifyuserpair php id gid gt Modify lt a gt gt lt td gt lt td gt lt echo lt a href mydata php id qid gt Delete lt a gt gt lt td gt lt td gt lt echo word gt lt td gt lt b gt lt td gt lt echo description
31. list Update and save Name Accretion The process by where dust and gas accumulated into larger bodies such as stars and planets Description Genre Astronomy x Figure 2 1 10 Modify My Data interface 2 1 11 Administration Home Page Screen Requirements 2 1 11 1 The interface shall display a welcome message displaying the user name Adminstration Area Welcome lilapolarski Here you can view and delete the word description pairs current users and current games Figure 2 1 11 Modify My Data interface 2 1 12 Admin View Data Screen Requirements 2 1 12 1 The interface shall allow administrators to view the word description pairs that have been added into the database 12 2 1 12 2 The interface shall have a link directing them to a page where they may modify these word description pair 2 1 12 3 The interface shall have a link allowing them to delete any word description pair 2 1 12 4 The interface shall display the word description and genre of each listing 2 1 12 5 The interface shall display a message telling the administrator that the word description pair was successfully deleted when the administrator selects the delete link 2 1 12 6 The interface shall display an error message when the program is unsuccessful at deleting the word description pair View Modify and Delete Word Description Pairs Modify Delete Word Description Genre Modify Delete Accretion The process by where dust and ga
32. logged in return isset _SESSION user_id function confirm_logged_in Q if llogged in redirect_to login php gt Welcome php lt div gt lt php con mysql_connect localhost slaforge if con die Could not connect mysql_error mysql_select_db slaforgedb con pid _SESSION user_id gt lt div id main gt lt if isset _SESSION id echo lt center gt lt font face Verdana size 2 gt lt br gt lt h3 gt Welcome _SESSION username echo lt h3 gt lt br gt lt br gt lt b gt Have fun playing games and uploading Word Description Pairs echo lt b gt lt br gt lt br gt Click lt a href logout php gt here to logout lt a gt amp nbsp amp nbsp echo lt a href modifyprofile php id pid gt Update Profile lt a gt lt br gt lt center gt lt font gt echo mysql_error else echo lt center gt lt font face Verdana size 2 gt lt a href login php gt lt b gt Already a member echo Please Login lt b gt lt a gt lt br gt lt br gt lt center gt lt font gt echo lt center gt lt font face Verdana size 2 gt or lt a href new_user php gt lt b gt echo Sign up for a Free Account lt b gt lt a gt lt center gt lt font gt gt 89 Stylesheets Folder Site css The base color for this template is 5c87b2 If you d like to use a different color start by replacing all inst
33. lt b gt lt td gt lt tr gt result mysql_query SELECT q id q word q genreid q description g id g name FROM question as q INNER JOIN genre as g where q genreid g id ORDER BY q word asc num mysql_numrows result i 0 while i lt num id mysql_result result i q id word mysql_result result i q word description mysql_result result i q description genre mysql_result result i g name gt lt tr gt lt b gt lt td gt lt echo lt a href modifypair php id id gt Modify lt a gt gt lt td gt lt td gt lt echo lt a href viewdata php id id gt Delete lt a gt gt lt td gt lt td gt lt echo word gt lt td gt lt b gt lt td gt lt echo description gt lt td gt lt td gt lt echo genre gt lt td gt lt tr gt 79 lt i gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Viewgames php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head_admin php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt View Modify and Delete the Online Games lt h2 gt lt a href addgame php gt Add A New Game lt a gt lt br gt lt br gt lt php if isset _REQUEST
34. lt br gt mysql_error if count errors 1 message There was error in the form message There were count errors errors in the form n else else else else Form has not been submitted word pu description gt 40 4 9 Data View Pages mydata php viewdata php viewgenres php viewusers php viewgames php All of these PHP files work similarly On load the PHP script checks to see whether a request is being made If there is the program will attempt to delete the specific record that was requested from the appropriate table in the database If the row is successfully deleted a message will be displayed along the top of the page If there is an error while attempting to delete the record an error message will be displayed The page then makes a database query retrieving all the data necessary to populate a list of items to display on the screen The program runs through a while loop and displays the appropriate records Each row also includes a delete and modify link that attaches the ID of the record as a parameter In this way if a user chooses to modify or delete a record the program will know which record to update When delete is selected the page returns to itself and then deletes the record When modify is selected the program navigates to the appropriate page and passed the record ID The mydata php file is naviga
35. outer CPU programming language which consists entirely of numbers and are almost impossible ead and write nd it is the first such data structure to be invented In this tree the heights Computer Science A device doing calculations The study of the theore 1 and of practical techniques for their tation f the celestial sphere or a set of instructions that can only be executed by one process or thread at a time e single source path tree This Computer Science ne t TAI a subroutir other graph algorithms Figure B11 View Data Page B Genre Page By clicking on the tab titled Genre you will be directed to a page listing all of the genres that currently exist in the database Each line in the list will display a modify and delete button along with the genre name and its description By selecting the modify button the administrator will be directed to a page where the genre may be edited By selecting the delete button the genre will be deleted from the database and removed from the list If the genre is successfully deleted a message stating that the genre was successfully deleted will be displayed Also above the list of genres will reside a hyperlink titled Add New Genre By clicking this link the administrator will be directed to a page where a new genre may be added to the database 107 View Add Modify and Delete Genres Add A New Genre
36. that have been added you may either click the hyperlink above the form titled View List or select the tab titled Genre 108 Add A New Genre Figure B13 Add New Genre Page D Modify Genre Page By clicking on a modify hyperlink next to the genre on the Genre page you will be directed to a page that includes a form populated with the data specific to that genre Here you may change the genre name and its description Once you have finished editing simply click the button under the form named Update A message will be posted above the form telling you whether the genre was updated successfully or if there were errors while updating Modify Genre Astronomy The branch of physics that studies celestial bodies and the universe as a whole Figure B14 Modify Genre Page 109 E Users Page By clicking on the tab titled Users you will be directed to a page listing all of the users that currently ezist in the database Each line in the list will display a modify and delete button along with the username and email of the user By selecting the modify button the administrator will be directed to a page where the user may be edited By selecting the delete button the user will be deleted from the database and removed from the list If the user is successfully deleted a message stating that the user was successfully deleted will be displayed View Modify and
37. Ai description if isset _REQUESTT id id _REQUEST id query SELECT FROM game WHERE id id result mysql_query query if result amp amp feed mysql_fetch_object result id feed gt id title feed gt title description feed gt description siteaddress feed gt siteaddress else id NULL title description siteaddress msg msg Wrong access ID is null lt a href viewgames php gt Try again lt a gt lt br gt gt lt php if empty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form name updated action modifygame php method post gt lt php echo lt font color red gt msg lt font gt gt lt table border 1 gt lt tr gt lt td colspan 2 align center gt Update and save lt td gt lt tr gt lt tr gt lt php echo lt td gt lt input type hidden name id value id gt lt td gt gt lt tr gt lt tr gt lt td gt Title lt td gt lt php echo lt td gt lt input type text name title value title gt lt td gt gt lt tr gt lt tr gt lt td gt Description lt td gt lt php echo lt td gt lt textarea name description cols 40 rows 8 gt description echo lt textarea gt lt td gt gt lt tr gt lt tr gt lt td gt Site Address lt td gt lt php echo
38. Delete the Online Users Modify Delete Username Email Modify Delete amcolema amcolema eagle fgcu edu Modify Delete capitalreef capital reef com Modify Delete jo Modify Delete Modify Delete Modify Delete Modify Delete Modify Delete tjyana Modify Delete Zalews Figure B15 View Users Page F Modify User Page By clicking on a modify hyperlink nezt to the user on the Users page you will be directed to a page that includes a form populated with the data specific to that user Here you may change the user s first name last name username password email address active status and their administrative privileges A zero for either means that they are either inactive or without administration privileges A one denotes that the user has an active status or that the user has administrative privileges Once you have finished editing simply click the button under 110 the form named Update A message will be posted above the form telling you whether the user was updated successfully or if there were errors while updating Modify Users Back to list Update and save First Name Capital Last Name Reef User Name capitalreef Password reefy 0 capital reef com Activated Admin Priveleges Figure B16 Modify User Page G Game Page By clicking on the tab titled Game you will be directed to a page listing all of the games that currently exist in the database Each line in the list wi
39. Modify Data Pages uw E i 42 5 Conclusion aa AS TA ohpecad Seegeegs sans E E ant ners 44 References goyani iriiria a eee EEE EEEE LE AE T N AAA EE ERARA 46 Appendix A Code UA EA ORTE I O E E E EEA ea 47 Appendix B User Manual iii AI Wa 97 1 Introduction The purpose of this document is to provide details on the structure of the online self learning software being developed as a group by the Spring 2011 CNT 4104 Computer Network Programming students In general this is a client server model software design containing a web interface server and database This interface shall allow users to build a dataset of information that may be used in various game environments designed to help the user memorize the information To access the web server through the web interface the interface shall allow users to create user accounts and log in to the site Once logged in the interface shall provide multiple options First and foremost the software shall allow users to interact with a database of information for use in the various game environments that it provides The software allows the user to select a category for the information being entered and then requires the user to provide word description pairs The software also allows users to select game types play games and view high scores The software allows the user to add additional data by category at any time During web interface connections the software provides a means for remember
40. Online Self Learning Software Main Interface Design Specifications Final Draft April 27 2011 By Robert S LaForge Instructor Janusz Zalewski Networks Project Florida Gulf Coast University Fort Myers Florida Spring 2011 Table of Contents 1 Introduction IA IAE 3 Da Requirements Specification ai ee nAi minnie PEREDE EAE ENE EEE A ed 4 2 1 General Requirements ii Aaa 4 2 2 Statie R pr sentati n ii aa 24 DPA AN eodera EN N A wai 24 2 2 2 Registration LogIn Log Out nee cece eee nent nent ees 24 2 2 3 Basic Program User Navigation wwwweanaannanananawanasa 25 2 24 Basic Program Administrator Navigation oo cece eee eee enone ee 26 2 3 Dynamic Representation AA 27 Doel QVCIVIEWS in a N ER N 27 2 32 UREA ii Iwa 28 2 3 3 Other Dynamic Representations wmmemeemanannannanaw mana 28 3 Design Description iia 29 3 1 OVEIVIEW aa 29 3 2 Database Di aa ai 29 3 21 Ui aa ii Wa 30 3 22 Game Table ii ia 30 3 2 3 Question Table ui II WA 30 S24 Genre Table ii EEES A TAE 31 3 23 GameLinePair Table ii 31 3 2 6 LiveGame Table iwa 31 4 Implementation ia 33 4 1 Main Pag Waua 33 4 2 Header Eiles aaa 34 4 3 Footer File iia 34 4 4 L gin PAGE Ia 35 4 5 Play Games PIA 36 4 6 Continue Games Page ia 38 4 7 Previous Games Page ii ginda iaun E RE KEE E a Ea 39 4 8 Data Input Pages ooien aE EEA EEEN TAN 39 4 9 ata View Pages ia 41 4 10
41. ace shall display the number of questions correct out of the total number of questions 2 1 6 6 The interface shall displaying a link titled delete game that allows the user to delete a current game from the database 2 1 6 7 The program shall pass the ID of the live game as a parameter to the game page that is being accessed 2 1 6 8 The program shall display a message stating that the game was successfully deleted when the user selects the delete game page 2 1 6 9 The program shall display an error message when the program is unsuccessful at deleting the game from the database Continue A Game The Game you selected has been successfully deleted Continue Burn and Learn 16 out of 20 questions answered Current Score 70 00 Delete Game Continue Peril 7 out of 22 questions answered Current Score 31 82 Delete Game Continue Dynamic Multiple Choice 0 out of 0 questions answered Current Score 0 00 Delete Game Figure 2 1 6 Continue Game interface 2 1 7 Previous Game Screen Requirements 2 1 7 1 The interface shall allow users to review a list of games they have previously finished 2 1 7 2 The interface shall provide links to access these previously played 2 1 7 3 2 1 7 4 2 1 7 5 Previous Game Info Crossword Madness games in detail The interface shall display the name of each game as a link The interface shall display the number of questions correct out of the total number of questions The interfa
42. ame updated action modifyuser php method post gt lt php echo lt font color red gt msg lt font gt gt lt table border 1 gt lt tr gt lt td colspan 2 align center gt Update and save lt td gt lt tr gt lt tr gt lt php echo lt td gt lt input type hidden name id value uid gt lt td gt gt lt tr gt lt tr gt lt td gt First Name lt td gt lt php echo lt td gt lt input type text name firstname value firstname gt lt td gt gt lt tr gt lt tr gt lt td gt Last Name lt td gt lt php echo lt td gt lt input type text name lastname value lastname gt lt td gt gt lt tr gt lt tr gt lt td gt User Name lt td gt lt php echo lt td gt lt input type text name username value username gt lt td gt gt lt tr gt lt tr gt lt td gt Password lt td gt lt php echo lt td gt lt input type text name password value password gt lt td gt gt lt tr gt lt tr gt lt td gt Rank lt td gt lt php echo lt td gt lt input type text name rank value rank gt lt td gt gt lt tr gt lt tr gt lt td gt Email lt td gt lt php echo lt td gt lt input type text name email value email gt lt td gt gt lt tr gt lt tr gt lt td gt Activated lt td gt lt td gt lt php query2 SELECT id active from users where id id result2 mysql_query qu
43. ances of 5c87b2 with your new color background color Black font size 75em font family Verdana Helvetica Sans Serif margin 0 padding 0 color 696969 min width 900px a link color 034af3 text decoration underline a visited color 505abc a hover color 1d60ff text decoration none a active color 12eb87 p ul margin bottom 20px line height 1 6em HEADINGS h1 h2 h3 h4 h5 h6 font size 1 5em color 000 font family Arial Helvetica sans serif 90 hi font size 2em padding bottom 0 margin bottom 0 h2 padding 0 0 10px 0 font size 1 2em font size 1 lem h5 h6 font size 1em this rule styles lt h2 gt tags that are the first child of the left and right table columns ightColumn gt h1 rightColumn gt h2 leftColumn gt h1 leftColumn gt h2 margin top 0 PRIMARY LAYOUT ELEMENTS you can specify a greater or lesser percentage for the page width Or you can specify an exact pixel width _page width 90 margin left auto margin right auto header position relative margin bottom Opx color 000 padding 0 header h1 font weight bold padding 5px 0 margin 0 color fff 91 border none line height 2em font family Arial Helvetica sans serif font size 32px important main
44. ble by all user types and allows the user to view a list of all word pairs they have added into the database It displays the word description and genre The viewdata php file is like the mydata php file but it is only available to administrators and allows them to view the entire set of word description pairs that have been added by all users The viewgenres php file is available only to administrators and allows them to view all genre types in the database It displays the name and description of the genre This page also includes a link where the administrator can navigate to a page where they may add a new genre The viewusers php page is only available to administrators and displays a list of all users displaying the username and email address The viewgames php page is only available to administrators and displays a list of all the games in the database The display includes the title description and site address for the game 41 4 10 Modify Data Pages modifyuserpair php modifyprofile php modifypair php modifygenre php modifyuser php modifygame php All of these PHP files work similarly On load the page checks to see what parameter was passed as a request It then populates the form on the page with data from the proper table in the database according to the parameter that it receives If no parameter is passed it displays a blank form and displays an error The program then allows the user to update the information and click t
45. blic htm Folder Addgame php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm logged in gt lt php include includes head_admin php gt lt php include_once includes form_functions php START FORM PROCESSING if isset _POST submit Form has been submitted errors array perform validations on the form data required_fields array title description siteaddress errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array title gt 100 description gt 250 siteaddress gt 100 errors array_merge errors check_max_field_lengths fields_with_lengths _POST title trim mysql_prep _POST title description trim mysql_prep _POST description siteaddress trim mysql_prep _POST siteaddress if empty errors query INSERT INTO game title description siteaddress VALUES title description siteaddress result mysql_query query connection if result message lt h3 gt The game has been successfully added lt h3 gt title description siteaddress else message The game could not be added message lt br gt mysql_error else if count errors 1 m
46. c quote effects so mysql_real_escape_string can do the work if magic_quotes_active value stripslashes value value mysql_real_escape_string value else before PHP v4 3 0 if magic quotes aren t already on then add slashes manually if magic_quotes_active value addslashes value if magic quotes are active then the slashes already exist return value function redirect_to location NULL if location NULL header Location location exit function confirm_query result_set if result_set die Database query failed mysql_error function get_all_subjects public true global connection query SELECT FROM subjects if public query WHERE visible 1 84 query ORDER BY position ASC subject_set mysql_query query connection confirm_query subject_set return subject_set function get_pages_for_subject subject_id public true global connection query SELECT FROM pages query WHERE subject id subject_id if public query AND visible 1 query ORDER BY position ASC page_set mysql_query query connection confirm_query page_set return page_set function get_subject_by_id subject_id global connection query SELECT query FROM subjects query WHERE id subject_id query LIMIT
47. ce shall display the final score of the game 13 out of 15 questions answered correctly Final Score 86 67 Figure 2 1 7 Previous Game interface 2 1 8 Input Data Screen Requirements 2 1 8 1 2 1 8 2 2 1 8 3 2 1 8 4 The interface shall allow users to add new word description pairs to the database The interface shall allow the users to select a category to describe the word description pair they are adding The interface shall provide a button titled add that saves the word description pairs into the database The interface shall provide a link to the specific word description pairs the user has added Input word description pairs View List Word Description Genre 2 1 9 Figure 2 1 8 Input Data interface My Data Screen Reguirements 2 1 9 1 2 1 9 2 2 1 9 3 2 1 9 4 2 1 9 5 2 1 9 6 The interface shall allow users to view the word description pairs that they have added into the database The interface shall have a link directing them to a page where they may modify their word description pair The interface shall have a link allowing them to delete their word description pair The interface shall display the word description and genre of each listing The interface shall display a message telling the user that the word description pair was successfully deleted when the user selects the delete link The interface shall display an error message when the program is
48. cho lt td gt lt input type text name name value name gt lt td gt gt lt tr gt lt tr gt lt td gt Description lt td gt lt php echo lt td gt lt textarea name description cols 40 rows 8 gt description lt textarea gt lt td gt gt lt tr gt lt tr gt lt td colspan 2 align center gt lt input type submit name submit value Save gt lt td gt lt tr gt lt table gt lt form gt 62 lt php include includes footer php gt Modifypair php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head_admin php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt Modify Word Description Pairs lt h2 gt lt a href viewdata php gt Back to list lt a gt lt php if isset _POST submit Form has been submitted id id errors array perform validations on the form data reguired fields array word description errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array word gt 100 description gt 500 errors array_merge errors check_max_field_lengths fields_with_lengths _POST id _POST id word _POST word genrei
49. d _POST genre description _POST description if empty errors query UPDATE question SET word word genreid genreid description description WHERE result mysql_query query connection if result message lt h3 gt The Word Description Pair has been successfully updated lt h3 gt else message The Word Description Pair could not be updated message lt br gt mysql_error else if count errors 1 message There was error in the form else message There were count errors errors in the form 63 else Form has not been submitted word im description gt lt php if isset _REQUEST id qid _REQUESTT id query SELECT FROM question WHERE id qid result mysql_query query if result amp amp feed mysql_fetch_object result qid feed gt id word feed gt word description feed gt description genre feed gt genreid else qid NULL word description genre msg msg Wrong access ID is null lt a href viewdata php gt Try again lt a gt lt br gt n gt lt php if lempty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form name updated action modifypair php method post gt lt php echo lt f
50. d Pairs Figure 2 2 2 General User Screen Navigation Figure 2 2 2 displays the basic navigation that the program allows users without administrative privileges within the site Essentially the program allows users to update their profiles Reguirement 2 1 4 play a new game Reguirement 2 1 5 play currently active games Reguirement 2 1 6 view a list of previously played games Reguirement 2 1 7 develop word description pairs and select a category Reguirement 2 1 8 view word description pairs that they have previously added Reguirement 2 1 9 modify their word pair data at a later time Requirement 2 1 10 25 2 2 4 Basic Program Administrator Navigation Game Website View Word Pairs Modify Word Pairs Delete Word Pairs View Genres Add New Games Modify Genres Delete Genres Modify Games Modify Users Add New Genres Delete Users Figure 2 2 2 General User Screen Navigation Figure 2 2 2 displays the basic navigation that the program allows administrative users within the site For word pairs in the database the program allows administrators to view Requirement 2 1 12 delete Requirement 2 1 12 and modify individual pairs Requirement 2 1 13 As well administrators may view Requirement 2 1 14 delete Requirement 2 1 14 modify Requirement 2 1 15 and add genres into the database Requirement 2 1 16 Administrators may also view Requirement 2 1 17 delete Requirement 2 1 17 and modify users Requirem
51. d gt lt input type text name lastname maxlength 100 value lt php echo htmlentities lastname lt tr gt lt tr gt lt td gt Username lt td gt 76 lt td gt lt input type text name username maxlength 100 value lt php echo htmlentities username gt gt lt td gt lt tr gt lt tr gt lt td gt Password lt td gt lt td gt lt input type password name password maxlength 40 value lt php echo htmlentities password gt gt lt td gt lt tr gt lt tr gt lt td gt Email lt td gt lt td gt lt input type text name email maxlength 150 value lt php echo htmlentities email gt gt lt td gt lt tr gt lt tr gt lt td colspan 2 gt lt input type submit name submit value Create user gt lt td gt lt tr gt lt table gt lt form gt lt td gt lt tr gt lt table gt lt p gt lt php include includes footer php gt Previous php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm logged in gt lt php include includes head php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt Previous Game Info lt h2 gt lt table id structure gt lt tr gt lt td id page gt lt div id gamescontainer gt lt ul id gamesmenu gt lt php id
52. date Profile Figure B3 User Main Page A Play Games Page If you select the Play Games tab you will be directed to the games page Here you will see a list of games along with a description of what the game is about To play a game simply click the title of the game This is a hyperlink that will direct you to the game you have selected and is colored in blue and underlined 100 FGCU Computer Science Online Learning Game Choose a Game to Play Title Description Burn and Learn Race your car faster and faster b Crossword Madness Try your best at thes Dynamic Multiple Choice Take time limited mul Peril A dangerous round of questions where answering incorrectly cou Quizzes hree rounds of increasing difficulty can you make it all the way through with 80 Figure B4 Play Game Page B Continue Games Page If you select the Continue Game tab you will be directed to the continue games page Here you will see a list of games that you have not yet completed if there are any This list will show the title of the game along with the number of questions you have answered out of the total number of questions You will also see your current score To continue playing a game simply click on the title of the game This is a hyperlink that will take you to the game page and is colored in blue and underlined 101 FGCU Computer Science Online Learning Game Continue A Game Continue Burn and Learn 16
53. don echo lt META HTTP EQUIV Refresh Content 0 URL gaddress uid uid gt exit result mysql_query INSERT INTO livegame userid gameid datetime numquestion numquestionsanswered ended numcorrect VALUES uid id FROM_UNIXTIME phpdate 0 0 0 0 query2 Select siteaddress from game where id id result2 mysql_query query2 siteaddress mysql_result result2 0 siteaddress query3 Select id UNIX_TIMESTAMP datetime from livegame where UNIX_TIMESTAMP datetime phpdate result3 mysql_query query3 lid mysql_result result3 0 id if result3 echo lt META HTTP EQUIV Refresh Content 0 URL siteaddress id lid gt exit else message There was a problem redirecting to the Game Site message lt br gt mysql_error 37 4 6 Continue Games Page continue php When this page loads the program checks to see whether parameters have been passed to itself If parameters have not been passed the program makes a guery to the database reguesting all livegame table data where the userid equals the session userid and where the ended attribute equals zero meaning the game has not been completed It then generates a list of all unfinished games displaying each title as an html link to continue the game that includes the livegame id appended to it the number of questions answered out of the total number the current sc
54. e username password 0 email 1 0 75 result mysql_query query connection if result else else message Your account was successfully created n firstname n lastname n username n password n email message Your account could not be created message lt br gt mysql_error if count errors 1 else message There was error in the form message There were count errors errors in the form else Form has not been submitted gt n firstname n lastname username nn password email lt div id main gt lt h2 gt Create A New Account lt h2 gt lt a href login php gt Return to Log In lt a gt lt br gt lt p gt lt table id structure gt lt tr gt gt gt lt td gt gt gt lt td gt lt td id page gt lt php if empty message echo lt p class message gt message lt p gt gt lt php if empty errors display errors errors gt lt form action new_user php method post gt lt table gt lt tr gt lt td gt First Name lt td gt lt td gt lt input type text name firstname maxlength 100 value lt php echo htmlentities firstname lt tr gt lt tr gt lt td gt Last Name lt td gt lt t
55. e lt br gt mysql_error if lempty message echo lt p class message gt message lt p gt if empty errors display_errors errors echo lt table gt lt tr gt lt td gt lt b gt Title lt b gt lt td gt lt td gt lt b gt Description lt b gt lt td gt lt tr gt result mysql_query SELECT FROM game ORDER BY title ASC num mysql_numrows result1 i 0 while i lt num gid mysql_result result1 i id title mysql_result result1 i title description mysql_result result1 i description siteaddress mysql_result result1 i siteaddress gt lt tr gt lt b gt lt td gt lt lt echo lt a href siteaddress id _SESSION user_id gt gt gt lt echo lt a href games php id gid gt gt lt echo title gt lt a gt lt td gt lt b gt lt td gt lt echo description gt lt td gt lt tr gt lt i 53 gt lt td gt lt tr gt lt table gt lt ul gt lt div gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Index php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php include includes head php gt lt php include includes welcome php gt lt php include includes footer php gt
56. e User Manual is to provide a general understanding of how to utilize the online gaming website This manual will provide instructions on how to create an account log in and out and navigate between pages The general idea of the site is to allow you to play games that involve a word or group of words and its definition You will also have the opportunity to add your own word description pairs to the database and these will be shuffled into the questions in the various games on the site These will be included for not only you but anyone with an account to interact with For the word pairs that you add you will have the ability to modify and delete them if you desire II Creating an Account If you do not already have an existing account you will need to create one When you first enter the site you will see a welcome message with two hyperlinks One will direct you to log in if you already have an account The other links you to the page where you may create an account Click the hyperlink that displays Sign up for a free account You will now see a form where you must populate the required data and click the Create User button If done correctly a message at the top of the page will let you know that the account was created successfully 97 FGCU Computer Science Online Learning Game Create A New Account Return to Log First Name Last Name Email Create user Figure B1 Create an Account Page
57. e a button by which the users may click to log in 2 1 2 4 The program shall check the database to determine whether the username and password are a valid combination 2 1 2 5 The program shall display an error message at the top of the log in text boxes stating that the combination is incorrect if the username and password combination are invalid 2 1 2 6 The program will redirect the user to the main page of the site if the username and password combination are valid 2 1 2 7 The program will create a unique user session that is maintained while the user is logged in if the username and password combination are valid 2 1 2 8 The program will link all related data stored in the database to the user id 2 1 2 9 The interface shall provide a link by which the user may click to be redirected to the create an account page Welcome to the FGCU Online Learning Game Website Username Password Login Create An Account Figure 2 1 2 Log in interface 2 1 3 Main Page Screen Requirements 2 1 3 1 The program shall display a link to log in or create an account if the user is not logged in Already a member Please Login or Sign up for a Free Account 2 1 3 2 2 1 3 3 2 1 3 4 Figure 2 1 3 Main page interface when not logged in The program shall display a Welcome note displaying the username when the user is logged in The program shall provide a log out link if the user is logged in The pro
58. echo mysql_error else echo lt center gt lt font face Verdana size 2 gt lt a href login _php gt lt b gt Already a member echo Please Login lt b gt lt a gt lt br gt lt br gt lt center gt lt font gt echo lt center gt lt font face Verdana size 2 gt or lt a href new_user php gt lt b gt echo Sign up for a Free Account lt b gt lt a gt lt center gt lt font gt gt 33 4 2 Header Files head php and head_admin php These PHP files are linked to the top of all web pages The head php file is included on all pages accessible only to users and the head admin php page is included on all pages accessible to administrators Both of these files check to see whether a session ezists or not Ifa session does not exist it prevents the user from accessing any pages except the home page index php Other than the main page the user will be redirected to the login page If a session does exist the user may navigate to the different pages on the site Each PHP file also contains a set of links specific to whether the user is accessing the administrative or general user side of the site These links provide navigation to the majority of pages on the site as shown in figures 2 1 22 and 2 1 23 The code to redirect the user to the login page is presented immediately below lt if isset _SESSION id echo lt li gt lt a href logout php gt Log Out lt a gt lt li gt echo mysql_er
59. ent 2 1 18 Administrators are also responsible for the games on the site They may view games stored in the database Requirement 2 1 19 delete games Requirement 2 1 19 modify the games Requirement 2 1 20 and add new games into the system Requirement 2 1 21 26 2 3 2 3 1 Overview The purpose of this section Dynamic Representation is to provide a sample dynamic representation of the online self learning software interface as it relates to user registration and logging in by providing graphical and written descriptions of the software A User registers for the game websit as they correlate to functional requirements one through four Website Registration e through the web interface Web Server Created with aoa Sequence Searan Eller eveuaton Editor evaluation version Register at www SequenceDiagramEditor com to remove this message Request The userclicks on the Registration Response Home Page Home Page La fink in the Home Page Erara iian i iA deat ecieaiveiip nde WATAMANI ROEE EEA EE 5 Request Registration Page RECEeCeeee errr Sere eee EE CORO Cece Renner cc rere if User not logged in Perform user login procedure FT T seas User Login MA Mm mamaaa maaana Heee MAA KANA KAA Prepare O NE Render Page 47 Response return Registration Page Figure 2 3 1 Sequence Diagram Website Registration and Login
60. ery2 out mysql_result result2 0 active echo lt select name active value gt Name lt option gt printing the list box select command e 0 if out e echo lt option value 0 selected selected gt 0 lt option gt echo lt option value 1 gt 1 lt option gt 70 else echo lt option value 0 gt 0 lt option gt echo lt option value 1 selected selected gt 1 lt option gt echo lt select gt Closing of list box gt lt tr gt lt tr gt lt td gt Admin Priveleges lt td gt lt td gt lt php query3 SELECT id admin from users where id id result3 mysql_query query3 out2 mysql_result result3 0 admin echo lt select name admin value gt Name lt option gt printing the list box select command if out2 e echo lt option value 0 selected selected gt 0 lt option gt echo lt option value 1 gt 1 lt option gt else echo lt option value 0 gt 0 lt option gt echo lt option value 1 selected selected gt 1 lt option gt echo lt select gt Closing of list box gt lt tr gt lt tr gt lt td colspan 2 align center gt lt input type submit name submit id submit value Update gt lt td gt lt tr gt lt table gt lt form gt lt php include includes footer php gt Modifyuserpair php lt php require_once includes session php gt lt php require_once includes connection php
61. essage There was error in the form else 47 message There were count errors errors in the form else Form has not been submitted title description siteaddress gt lt div id main gt lt h2 gt Add A New Game lt h2 gt lt a href viewgames php gt Return to List lt a gt lt br gt lt table id structure gt lt php if lempty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form action addgame php method post gt lt tr gt lt td id page gt lt table gt lt tr gt lt tr gt lt tr gt gt lt textarea gt lt td gt lt tr gt lt tr gt htmlentities siteaddress gt gt lt td gt lt tr gt lt tr gt gt lt td gt lt tr gt lt table gt lt form gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Addgenre php lt td gt Title lt td gt lt td gt lt input type text name title maxlength 100 value lt php echo htmlentities title gt gt lt td gt lt td gt Description lt td gt lt td gt lt textarea name description cols 40 rows 5 maxlength 250 value lt php echo htmlentities description gt lt td gt Site Address lt td gt lt td gt lt input type text name siteaddress maxlength 100 value lt php echo lt td colspa
62. gated and fized so that data sets are complete in the database Lastly the graphical user interface is eztremely simplified To achieve the goals of this project only minimal thought went into it and the focus was completely on functionality To enhance the user experience careful thought should go into developing a dynamic site that entertains the user 45 References 1 Ambler Scott UML 2 Sequence Diagrams AgileModeling com 10 Feb 2011 lt http www agilemodeling com artifacts sequenceDiagram htm gt 2 Borysowich Craig Observations from a Tech Architect Enterprise Implementation Issues amp Solutions Toolbox com 25 May 2007 10 Feb 2011 lt http it toolbox com blogs enterprise solutions using structure charts 16477 gt 3 MLA Format for Websites Roanstate edu 15 Feb 2011 lt http www roanestate edu owl MLA Format4Websites htm gt 4 SQL Tutorial W3Schools com 12 April 2011 lt http www w3schools com sql default asp gt 5 PHP Login and logout script and example Plus2Net com 14 April 2011 lt http www plus2net com php_tutorial php_login_logout php gt 6 PostgreSQL amp PHP Tutorials Deleting from your Database DesignMagick com 13 April 2011 lt http www designmagick com article 12 Starting Out Deleting Data gt 7 PHP Server Variables PCTalkNet com 15 April 2011 lt http www pctalknet com php serverVariables php gt 46 Appendiz A Code Pu
63. gram shall provide an update profile link if the user is logged in Welcome slaforge Have fun playing games and uploading Word Description Pairs Click here to logout Update Profile Figure 2 1 4 Main page interface when logged in 2 1 4 Update Profile Screen Requirements 2 1 4 1 2 1 4 2 2 1 4 3 2 1 4 4 2 1 4 5 2 1 4 6 The interface shall allow users to update their profile by entering data into the text boxes When the screen loads the text boxes shall be populated by the current profile information stored in the database The interface shall provide a button that when selected populates the database with the new information filled into the text boxes The interface shall display a message stating that the profile was updated successfully The interface shall provide a link that when selected will redirect the user to the home page The interface shall display an error message when the update is not successfully inserted into the database Update Profile Return to Home First Name Scott Last Name LaForge User Name slaforge Pas v word 1panther Email rslaforg eagle fgcu edu Figure 2 1 5 Update Profile interface 2 1 5 Play Game Screen Requirements 2 1 5 1 2 1 5 2 2 1 5 3 2 1 5 4 2 1 5 5 2 1 5 6 Choose a Game to Play Title Burn and Learn Crossword Madness Dynamic Multiple Choice Peril Quizzes The interface shall allow user
64. he new information when the save button is selected The program shall display a message stating that the Game was successfully updated when the update button is selected The interface shall display an error message when the program was unsuccessful at updating the database The interface shall contain a link that directs the administrator to the entire list of Games 20 Modify Game Back to list Title Description 2 1 21 1 2 1 21 2 2 1 21 3 2 1 21 4 Update and save Burn and Learn Race your car faster and faster by answering questions quickly Otherwise your game may come to a complete stop tjyanai BurnNLearn php Save Figure 2 1 20 Admin Modify Game interface 2 1 21 Admin Add New Game Screen Requirements The interface shall allow administrators to add new Games to the database The interface shall allow the administrators to input a name and description of the new Game The interface shall provide a button titled add that saves the Game information into the database The interface shall provide a link to the entire set of Games in the database 21 Add A New Game Title Description Site Address Add Figure 2 1 21 Admin Add New Game interface 2 1 22 User Header File Interface Requirements 2 1 22 1 The interface shall provide buttons for users to the different pages on the site that are accessible to users without administrative privileges
65. he update button The page then reloads and checks to see whether the page is receiving a post If it is it accesses the database table and updates the information If the database is successfully updated a message is displayed at the top letting the user know that the database was updated successfully Otherwise the page displays an error message stating that the information could not be updated At the top of each page is also a hyperlink allowing the user to return to the page to view all the data of that table The modifyuserpair php and modifyprofile php files are accessible to all users while the other four files are only available to users with administrative privileges The modifyprofile php page displays the first name last name user name password and email address of the user The modifyuser php file includes the same information as the modifyprofile php page but also includes list boxes where the administrator can change administrator privileges and whether the account is activated or not The modifyuserpair php file displays the word description and a list box of all available genres The modifypair php page is identical except that it includes the head_admin php file to display links appropriate to administrators The modifygenre php file displays the name and description The modifygame php page displays the title description and site address of the game lt php if isset _REQUESTT id id _REQUEST id query SELECT
66. hen the save button is selected 2 1 15 5 The program shall display a message stating that the genre was successfully updated when the save button is selected 2 1 15 6 The interface shall display an error message when the program was unsuccessful at updating the database 15 2 1 15 7 The interface shall contain a link that shall direct the administrator to the entire list of genres Modify Genre Back to list Update and save Name Computer Science The study of the theoretical A foundations of information and computation and of practical techniques for their implementation and Description 3 3 p p application in computer systems Figure 2 1 15 Admin Modify Genre interface 2 1 16 Admin Add New Genre Screen Requirements 2 1 16 1 The interface shall allow administrators to add new genres to the database 2 1 16 2 The interface shall allow the administrators to input a name and description of the new Genre 2 1 16 3 The interface shall provide a button titled add that saves the Genre into the database 2 1 16 4 The interface shall provide a link to the entire set of Genres in the database 16 Add A New Genre Return to List Name Description Add Figure 2 1 16 Admin Add New Genre interface 2 1 17 Admin View Users Screen Reguirements 2 1 17 1 The interface shall allow administrators to view the users that have been added into the database 2 1 17 2 The interface shall have
67. hp gt lt php confirm logged in gt lt php include includes head_admin php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt Modify Game lt h2 gt lt a href viewgames php gt Back to list lt a gt lt php if isset _POST submit Form has been submitted errors array perform validations on the form data reguired fields array title description siteaddress errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array title gt 100 description gt 250 siteaddress gt 150 errors array_merge errors check_max_field_lengths fields_with_lengths _POST id _POST id title _POST title description _POST description siteaddress _POST siteaddress if empty errors query UPDATE game SET title title description description siteaddress siteaddress WHERE id id result mysql_query query connection if result message lt h3 gt The Game has been successfully updated lt h3 gt else message The Game could not be updated message lt br gt mysql_error else if count errors 1 message There was error in the form else message There were count errors errors in the form 59 else Form has not been submitted name
68. i gt gt lt ul gt lt div gt lt td gt lt tr gt lt table gt lt div gt Head_admin php lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Strict EN http www w3 org TR xhtml1 DTD xhtml1 strict dtd gt lt html xmIns http www w3 org 1999 xhtml gt lt head gt lt title gt FGCU Computer Science Online Games lt title gt lt link href stylesheets Site css rel stylesheet type text css gt lt head gt lt body gt lt div class page gt lt div id header gt lt table width 100 gt lt tr gt lt td gt lt div id title gt lt h1 gt FGCU Computer Science Online Learning Game lt h1 gt lt div gt lt td gt lt tr gt lt tr gt lt td colspan 3 gt lt div id menucontainer gt lt ul id menu gt lt li gt lt a href index php gt Home lt a gt lt li gt lt li gt lt a href viewdata php gt Data lt a gt lt li gt lt li gt lt a href viewgenres php gt Genre lt a gt lt li gt lt li gt lt a href viewusers php gt Users lt a gt lt li gt lt li gt lt a href viewgames php gt Games lt a gt lt li gt lt if isset _SESSION id echo lt li gt lt a href logout php gt Log Out lt a gt lt li gt echo mysql_error else echo lt li gt lt a href login php gt Log In lt a gt lt li gt IS lt ul gt lt div gt lt td gt lt tr gt lt table gt 88 lt div gt Session php lt php session start function
69. ibute is an integer that stores the total number of questions the user answered correctly while playing the game The ended attribute is an integer that can be either a zero or a one If it is a zero it means that the game has not completed yet If it is a one then the game was successfully completed 32 4 Implementation This section discusses some of the key programming features that are necessary to make the website functional 4 1 Main Page index php This is the main entrance point into the site When a user arrives at the site the PHP script checks to see whether a session currently exists If there is no session the code provides a message directing the visitor to create an account or log in Links to the prospective pages are written in HTML If the visitor is logged in a message is displayed showing the username and what the user may participate in on the site It also shows two links allowing the user to update their profile or logout lt if isset _SESSION id echo lt center gt lt font face Verdana size 2 gt lt br gt lt h3 gt Welcome _SESSION username echo lt h3 gt lt br gt lt br gt lt b gt Have fun playing games and uploading Word Description Pairs echo lt b gt lt br gt lt br gt Click lt a href logout php gt here to logout lt a gt amp nbsp amp nbsp echo lt a href modifyprofile php id pid gt Update Profile lt a gt lt br gt lt center gt lt font gt
70. id name mysql_result result i name description mysql_result result i description gt lt tr gt lt b gt lt td gt lt echo lt a href modifygenre php id id gt Modify lt a gt gt lt td gt lt td gt lt echo lt a href viewgenres php id id gt Delete lt a gt gt lt td gt lt td gt lt echo name gt lt td gt lt b gt lt td gt lt echo description gt lt td gt lt tr gt lt i gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Includes Folder Connection php lt php require constants php 1 Create a database connection connection mysql_connect DB_SERVER DB_USER DB_PASS if connection die Database connection failed mysql_error 2 Select a database to use db_select mysql_select_db DB_NAME connection if db_select die Database selection failed mysql_error gt Constants php lt php Database Constants define DB SERVER localhost define DB USER slaforge define DB_PASS define DB NAME slaforgedb gt 82 Footer php lt div gt lt div id footer gt Copyright 2011 FGCU Computer Science Department lt div gt lt div gt lt if isset _SESSION id u _SESSION user_id v 1 adminquery select from users where id u adminresult mysql_query adminquery t mysql_result adminresult 0
71. ify Delete Algorithm ves performance by transparently storing data such that future reguests for that data Modify Delete Assembly r CPU programming language which consists entirely of numbers and are almost impossible fo Language Modify Delete AVL Tree data structure to be invented In this tree the heights z 5 Delete Cache ce by transparently storing data such that future reguests for that data Delete Computer Science on and computation and of practical technigues for their Delete Critical Section A piece of code or a set of instructions that can only be executed by one process or thread at a time Delete Dijkstra the single source st path tree Thi puter EEEF Delete Disassembly Computer z a Delete Distributed A da Database em DBMS in which storage devices Figure B8 My Data Page F Update Profile Page On the home page of the site you may choose to update your profile by selecting the hyperlink in the center of the page titled Update Profile On this page you will see a form populated with all of your user data Here you may change your first name last name username password and email address Once you have finished editing simply click the button under the form named Update A message will be posted above the form telling you whether your profile was updated successfully or if there were errors while updating 105 Update Profile me Scott t Name LaForge
72. ing previous session states in case of connection loss or users choosing to exit game play either because of pausing or exiting currently active games The purpose of this particular document is to provide descriptive details regarding the software s interface as it relates to site access navigation session states and data management These descriptions shall be detailed in the following sections both through diagrammed and written explanations 2 Reguirements Specification 2 1 General Requirements Listed below are the functional reguirements for the online self learning software 2 1 1 Registration Screen Requirements 2 1 1 1 The interface shall allow new users to register by reguiring a first name last name username password and email address 2 1 1 2 The program shall insert the newly created user into the database 2 1 1 3 The interface shall provide a button by which the users may click to create an account 2 1 1 4 The interface shall provide a link by which the user may click to be redirected to the log in page Create A New Account Return to Log In First Name Last Name Username Password Email Create user Figure 2 1 1 Create an Account interface 2 1 2 Log In Screen Requirements 2 1 2 1 The interface shall allow users to login to access all web pages on the site 2 1 2 2 The interface allows users to log in by typing in a user name and password 2 1 2 3 The interface shall provid
73. ink The interface shall display an error message when the program is 19 2 1 19 7 unsuccessful at deleting the game from the database The interface shall provide a link to add new games into the database View Modify and Delete the Online Games Add A New Game Delete Title Delete Burn and Learn Delete Crossword Madness Delete Dynamic Multiple Choice Delete Peril Delete Quizzes Description Site Address e r car faster and faster by swering questions ckly Otherwise your game Rac car faster and faster by answering questions quickl therwi our gam tjyanai BurnNLearn php may o a complete stop Try your best at these insane crossword clues ncalteen main php Jake tin gt acoleman self_study user_menu php gi round of questions where answering incorrectly could cost you a lot of jrhodnet peril php Three rounds of increasing difficulty can you make it all the way through with 80 correct or hetter jocanas game php Figure 2 1 19 Admin View Games interface 2 1 20 Admin Modify Games Screen Requirements 2 1 20 1 2 1 20 2 2 1 20 3 2 1 20 4 2 1 20 5 2 1 20 6 2 1 20 7 The interface shall allow administrators to modify a selected Game The interface shall display a form with the current data stored in the database The program shall allow the administrator to update the title description and site address of a particular Game The program shall update the database with t
74. instration Area lt h2 gt lt h3 gt Welcome lt php echo _SESSION username gt lt h3 gt 78 lt p gt lt b gt Here you can view and delete the word description pairs current users and current games lt b gt lt p gt lt php include includes footer php gt Viewdata php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head_admin php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt View Modify and Delete Word Description Pairs lt h2 gt lt php if isset _REQUEST id id _REQUEST id query DELETE FROM question WHERE id id result mysql_query query if result message lt h3 gt The Word Description Pair has been successfully deleted lt h3 gt else message The Word Description Pair could not be deleted message lt br gt mysql_error if lempty message echo lt p class message gt message lt p gt if empty errors display_errors errors echo lt table gt lt tr gt lt td gt lt b gt Modify lt b gt lt td gt lt td gt lt b gt Delete lt b gt lt td gt lt td gt lt b gt W ord lt b gt lt td gt echo lt td gt lt b gt Description lt b gt lt td gt lt td gt lt b gt Genre
75. ion or description in the Description text box select a genre in the Genre list box and then click the Add button If you do not see a category that you feel it should belong in simply add it to the Misc genre This will store it in a miscellaneous category and will eventually be updated to its own category when enough pairs exist in the database that are of a similar genre A message at the top of the page above the form will inform you that the word description pair was successfully added to the database If there was an error an error message will display instead To view the word description pairs that you have added you may either click the tab at the top left that says View List or select the tab titled My Questions 103 FGCU Computer Science Online Learning Game Input word description pairs View List Word Figure B7 Input data Page E My Data Page If you select the My Data tab you will be directed to the page where you can view all the words or small groups of words that you have added This will be displayed as a list that shows the word its description and what genre it belongs to You will also have the option to modify or delete these word description pairs by selecting either the modify or delete hyperlinks that correspond to the particular line 104 View Modify and Delete Word Description Pairs Modify Delete Word Description Genre Mod
76. ler than the continue or play games pages When it loads it does not look for any requests Instead it makes a query to the database retrieving all livegame table data where the userid equals the session id and that has a one in the ended attribute It then creates a list on the page displaying all of the previously played games It displays the title the number of questions answered correctly out of the total number and the final score 4 8 Data Input Pages addgame php addgenre php inputdata php new_user php All of these PHP files work similarly On load the PHP script checks to see whether a post is being submitted After the page will simply load the regular page along with appropriate form boxes to be populated by the user When the form is posted the same page receives the information and inserts a new row in the appropriate table Before it inserts the page checks to see whether the information has been posted correctly If it has not it will display an error message If the information is correct and was successfully inserted into the database a message stating that the element was successfully added will be displayed The addgame php file is available to administrators and allows them to insert a new game into the game table The addgenre php file is also only available to administrators and allows them to insert a new genre into the genre table The inputdata php file allows all user
77. ll display a modify and delete button along with the game name its description and its site address By selecting the modify button the administrator will be directed to a page where the game may be edited By selecting the delete button the game will be deleted from the database and removed from the list If the game is successfully deleted a message stating that the game was successfully deleted will be displayed Also above the list of games will reside a hyperlink titled Add New Game By clicking this link the administrator will be directed to a page where a new game may be added to the database 111 View Modify and Delete the Online Games Modify Delete Title Description Modify Delete Burn and Learn Race Site Address Hyanai BurnNLearn php Modify Delete Crossword ose P L eye T vour best at these insane crc word clue ncalteen main phr Madness Modify Delete Dynamic Multiple e limited e ice quizze 1a c 3n zed achleman ise saxiv usersmeniphn Choice correct and incorrect choices REN Ree PERS TEE Re Modify Delete Peril Modify Delete Quizzes Figure B17 View Games Page H Add New Game Page If you select the Add New Game hyperlink on the Game page you will be directed to a page where you may add new games into the database Simply fill in the different sections of the form Add a new game name up to 100 characters long in the Title text box Add its description in
78. lt td gt lt td gt lt php query2 SELECT id name from genre order by name result2 mysql_query query2 echo lt select name genre value gt Name lt option gt printing the list box select command while nt mysql_fetch_array result2 Array or records stored in nt if genre nt id echo lt option value nt id selected selected gt nt name lt option gt else Option values are added by looping through the array echo lt option value nt id gt nt name lt option gt Option values are added by looping through the array echo lt select gt Closing of list box gt lt tr gt lt tr gt lt td colspan 2 align center gt lt input type submit name submit value Save gt lt td gt 73 lt tr gt lt table gt lt form gt lt php include includes footer php gt Mydata php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt View Modify and Delete Word Description Pairs lt h2 gt lt php if isset _REQUEST id id _REQUEST id query DELETE FROM question WHERE id id result mysql_query query if result message lt
79. lt td gt lt input type text name siteaddress value siteaddress gt lt td gt gt lt tr gt lt tr gt lt td colspan 2 align center gt lt input type submit name submit 60 value Save gt lt td gt lt tr gt lt table gt lt form gt lt php include includes footer php gt Modifygenre php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head_admin php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt Modify Genre lt h2 gt lt a href viewgenres php gt Back to list lt a gt lt php if isset _POST submit Form has been submitted errors array perform validations on the form data required_fields array name description errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array name gt 100 description gt 250 errors array_merge errors check_max_field_lengths fields_with_lengths _POST id _POST id name _POST name description _POST description if empty errors query UPDATE genre SET name name description description WHERE id id result mysql_query query connection if result message
80. n 2 gt lt input type submit name submit value Add 48 lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head_admin php gt lt php include_once includes form_functions php START FORM PROCESSING if isset _POST submit Form has been submitted errors array perform validations on the form data reguired fields array name errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array name gt 100 description gt 250 errors array_merge errors check_max_field_lengths fields_with_lengths _POST name trim mysql_prep _POST name description trim mysql_prep _POST description if empty errors query INSERT INTO genre name description VALUES name description result mysql_query query connection if result message lt h3 gt The Genre has been successfully added lt h3 gt name description else message The Genre has not be added message lt br gt mysql_error else if count errors 1 message There was error in the form else message There were count errors errors in the form else
81. name hashed_password password email email where id id result mysql_query query connection if result message lt h3 gt Your profile has been successfully updated lt h3 gt _SESSION username username else message Your profile could not be updated message lt br gt mysql_error else if count errors 1 message There was error in the form else message There were count errors errors in the form else Form has not been submitted firstname lastname username password email n n n gt START FORM PROCESSING if isset _REQUESTTiid id _REQUEST id query SELECT FROM users WHERE id id result mysql_query query if result amp amp feed mysql_fetch_object result uid feed gt id firstname feed gt firstname lastname feed gt lastname username feed gt username password feed gt hashed_password 66 email feed gt email gt lt table id structure gt lt tr gt lt td id page gt lt php if empty message echo lt p class message gt message lt p gt gt lt php if empty errors display_errors errors gt lt form name updated action modifyprofile php method post gt gt lt td gt maxlength 100 maxlength 100 maxlength 40
82. nsists of five attributes The id is an integer value and acts as the primary key of the table It is unique and auto increments The word and description attributes are both varchars The word attribute stores up to 100 characters and the description attribute stores up to 500 characters The genreid is a foreign key from the genre table and is used to reference the particular genre that the question instance is a part of The addedby attribute is also a foreign key and references the id from the users table according to the user that created the question instance 30 3 24 Genre Table The genre table consists of four attributes The id is an integer value and acts as the primary key of the table It is unique and auto increments The name attribute is a varchar and stores the genre title The description attribute is also a varchar with a length up to 250 characters and stores the description of the genre in the database 3 2 5 GameLinePair Table The gamelinepair table consists of four attributes The id is an integer value and acts as the primary key of the table It is unique and auto increments The questionid and livegameid attributes are integer values The questionid attribute is a foreign key from the question table and references the id of the question The livegameid is also a foreign key and
83. nt Serrors 1 Smessage There was 1 error in the form else Smessage There were count Serrors errors in the form 4 5 Play Games Page games php When this page loads the program checks to see whether parameters have been passed to itself If parameters have not been passed the program makes a query to the database requesting 36 all the game data It then generates a list of all games displaying each title as an html link that includes the game id as a parameter and a description of each game The program then calls the same page when a link to a particular game is selected Now on load the page recognizes the request parameter and inserts a new instance of the particular game into the database in the livegame table It then redirects the user to the game they have selected and passes the livegame ID as a parameter so that the particular game will have the necessary information to recognize the user and repopulate the database later when the user either finishes a game or chooses to continue it later One note because Andon Coleman s game is set up differently the program checks to see whether Andon s game is going to be played If it is it sends the user ID instead of the live game ID as a parameter if id 6 query Andon Select siteaddress from game where id id resultAndon mysql_query query Andon gaddress mysql_result resultAndon 0 siteaddress if resultAn
84. ode page id gt page menu_name lt a gt lt li gt output lt ul gt output lt ul gt return output gt Head php lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Strict EN http www w3 org TR xhtml1 DTD xhtml1 strict dtd gt lt html xmIns http www w3 org 1999 xhtml gt lt head gt lt title gt FGCU Computer Science Online Games lt title gt lt link href stylesheets Site css rel stylesheet type text css gt lt head gt lt body gt lt div class page gt lt div id header gt lt table width 100 gt lt tr gt lt td gt lt div id title gt lt h1 gt FGCU Computer Science Online Learning Game lt h1 gt lt div gt lt td gt lt tr gt lt tr gt lt td colspan 3 gt lt div id menucontainer gt lt ul id menu gt lt li gt lt a href index php gt Home lt a gt lt li gt lt li gt lt a href games php gt Play Game lt a gt lt li gt lt li gt lt a href continue php gt Continue Game lt a gt lt li gt lt li gt lt a href previous php gt Previous Games lt a gt lt li gt lt li gt lt a href inputdata php gt Input Data lt a gt lt li gt lt li gt lt a href mydata php gt My Questions lt a gt lt li gt lt if isset _SESSION id echo lt li gt lt a href logout php gt Log Out lt a gt lt li gt echo mysql_error else 87 echo lt li gt lt a href login php gt Log In lt a gt lt l
85. of the diagram without details 2 3 3 Other Dynamic Representations Other dynamic interactions shall follow similarly to the diagram as depicted in the registration process Through a Browser User Interface a user shall make different requests to the web server depending on the specific links that are filled in and selected This in turn will make accesses to the database linked to the user s profile and eventually return responses to the browser In this manner all games may be played additional game data may be entered into the database and previous games may be viewed 28 3 Design Description 3 1 Overview In general this project utilizes the Internet to connect the online gaming website to the user So long as the user and hosting server are on the same network the pages may be accessed from anywhere To complete this project a database is designed to store vital information necessary for site interaction Then web pages are developed to provide an interface allowing the user or administrators to navigate the site play games and view and modify database information The webpages are displayed to the user via HTML and formatted with CSS PHP is used for all scripts that must generate sessions maintain variables or contain SQL queries that access the database SATNET one of the FGCU Computer Science servers is used to house both the webpages and the database 3 2 Database Design Figure 3 2 1 shows the database
86. ont color red gt msg lt font gt gt lt table border 1 gt lt tr gt lt td colspan 2 align center gt Update and save lt td gt lt tr gt lt tr gt lt php echo lt td gt lt input type hidden name id value qid gt lt td gt gt lt tr gt lt tr gt lt td gt Name lt td gt lt php echo lt td gt lt input type text name word value word gt lt td gt gt lt tr gt lt tr gt lt td gt Description lt td gt lt php echo lt td gt lt textarea name description cols 40 rows 8 gt description lt textarea gt lt td gt gt lt tr gt lt tr gt lt td gt Genre lt td gt lt td gt lt php query2 SELECT id name from genre order by name 64 result2 mysql_query query2 echo lt select name genre value gt Name lt option gt printing the list box select command while nt mysql_fetch_array result2 Array or records stored in nt if genre nt id echo lt option value nt id selected selected gt nt name lt option gt else Option values are added by looping through the array echo lt option value nt id gt nt name lt option gt Option values are added by looping through the array echo lt select gt Closing of list box gt lt tr gt lt tr gt lt td colspan 2 align center gt lt input type submit name submit value Save gt lt td gt lt tr gt lt table gt lt f
87. ore and an html link also including the livegame id to delete the game if they do not wish to continue it When a user selects the continue game link the program navigates to the game page selected with the livegame id appended If the delete game link is selected the page reloads itself Now on load the page recognizes the request parameter It then deletes the game instance from the database in livegame table It then displays a message stating that the game was successfully deleted The code below details the process by which a game instance is deleted from the livegame table One note the program also checks to see whether the row being added to the list is Andon Coleman s game If it is it sets the link so that it has two parameters to pass to his game the user ID and the live game ID Below is the code for deleting a continue game database entry lt php if isset _REQUESTT id id _REQUEST id query DELETE FROM livegame WHERE id id result mysql_query query if result message lt h3 gt The Game you selected has been successfully deleted lt h3 gt else message The Game could not be deleted message lt br gt mysql_error 38 if lempty message echo lt p class message gt message lt p gt if lempty errors display_errors errors 4 7 Previous Games Page previous php This page is simp
88. orm gt lt php include includes footer php gt Modifyprofile php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm logged in gt lt php include includes head php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt Update Profile lt h2 gt lt a href index php gt Return to Home lt a gt lt php if isset _POST submit Form has been submitted errors array perform validations on the form data reguired fields array firstname lastname username password email errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array firstname gt 100 lastname gt 100 65 gt 100 username gt 100 password gt 40 email errors array_merge errors check_max_field_lengths fields_with_lengths _POST gt lt php id _SESSION user_id firstname trim mysql_prep _POST firstname lastname trim mysql_prep _POST lastname username trim mysql_prep _POST username password trim mysql_prep _POST password email trim mysql_prep _POST email if empty errors query update users set firstname firstname lastname lastname username user
89. out of 20 guestions answered Current Score 70 00 Delete Game Continue Peril 7 out of 22 guestions answered Current Score 31 82 Delete Game Continue Peril 0 out of 0 questions answered Current Score 0 00 Delete Game Continue Peril 0 out of 0 questions answered Current Score 0 00 Delete Game Continue Peril 0 out of 0 questions answered Current Score 0 00 Delete Game Continue Dynamic Multiple Choice 0 out of 0 questions answered Current Score 0 00 Delete Game Figure B5 Continue Games Page C Previous Games Page If you select the Previous Games tab you will be directed to the previous games page Here you will see a list of games that you have already completed if they exist This list will show the title of the game along with the number of questions you have answered correctly out of the total number of questions You will also see your final score 102 FGCU Computer Science Online Learning Game Previous Game Info Peril 2 out of 25 guestions answered correctly Final Score 8 00 Peril 25 out of 25 guestions answered correctly Final Score 100 00 Figure B6 Previous Games Page D Input My Data Page If you select the Input Data tab you will be directed to the page where you can add a word or group of words along with its definition into the database Simply fill in the different sections of the form Add a word or group of words up to 100 characters long in the Word text box Add its definit
90. put lt li if subject id sel_subject id output class selected output gt lt a href edit_subject php subj urlencode subject id gt subject menu_name lt a gt lt li gt page_set get_pages_for_subject subject id public output lt ul class pages gt while page mysql_fetch_array page_set output lt li if page id sel_page id output class selected output gt lt a href content php page urlencode page id gt page menu_name lt a gt lt li gt output lt ul gt output lt ul gt return output function public_navigation sel_subject sel_page public true output lt ul class subjects gt subject_set get_all_subjects public while subject mysql_fetch_array subject_set output lt li if subject id sel_subject id output class selected output gt lt a href index php subj urlencode subject id gt subject menu_name lt a gt lt li gt if subject id sel_subject id page_set get_pages_for_subject subject id public output lt ul class pages gt 86 while page mysql_fetch_array page_set output lt li if page id sel_page id output class selected output gt lt a href index php page urlenc
91. references the id of the active or finished game in the livegame table The answered attribute is a zero or a one It is set to one if the question The word attribute stores up to 100 characters and the description attribute stores up to 500 characters The genreid is a foreign key from the genre table and is used to reference the particular genre that the question instance is a part of The addedby attribute is also a foreign key and references the id from the users table according to the user that created the question instance 3 2 6 LiveGame Table The livegame table consists of eight attributes The id is an integer value and acts as the primary key of the table It is unique and auto increments The userid and gameid attributes are integer values The userid attribute is a foreign key from the users table and references the id of the user The gameid is also a foreign key and references the id of the game in the game table The datetime attribute is a timestamp and stores the time when the game was last updated The numquestion is an integer attribute and is populated with the total number questions for that particular game instance The numquestionsanswered attribute is 31 also an integer and stores the total number of questions a user has answered for a particular game The numcorrect attr
92. ror else echo lt li gt lt a href login php gt Log In lt a gt lt li gt gt 4 3 Footer File footer php The footer file always displays the copyright message using html PHP checks to see whether a session exists If so a database query is made checking to see whether the user has administrative privileges If so it allows a link to the administrative portion of the site to be displayed and clickable 34 lt if isset _SESSION id u _SESSION user_id Sv 1 adminquery select from users where id u adminresult mysql_query adminquery t mysql_result adminresult 0 admin if t 1 echo lt center gt lt font face Verdana size 2 gt lt br gt lt a href staff php gt Admin Panel lt a gt lt br gt lt center gt lt font gt echo mysql_error gt 44 LogIn Page login php The login page allows users to log in and have access to the content on the website When the sign in button is clicked the program calls the same page again The page on load checks to see whether a post is made If so the program first prepares the data input from the user before making a query It then makes a query to the database to see whether the username and password combination are paired correctly or exist at all If the combination is correct a session is created that will be maintained while the user is on the site The program then redirects the user to the home page If the combina
93. rrors else Check database to see if username and the hashed password exist there query SELECT id username query FROM users query WHERE username username query AND hashed password password query LIMIT 1 result_set mysql_query query confirm_query result_set if mysql_num_rows result_set 1 username password authenticated and only 1 match found_user mysql_fetch_array result_set _SESSION id session_id _SESSION user_id found_user id _SESSION username found_user username redirect_to slaforge index php else username password combo was not found in the database message Username password combination incorrect lt br gt Please make sure your caps lock key is off and try again if count errors 1 message There was error in the form else message There were count errors errors in the form else Form has not been submitted if isset _GET logout amp amp _GET logout 1 username password message You are now logged out n gt nn gt gt lt div id main gt lt h2 gt Welcome to the FGCU Online Learning Game Website lt h2 gt lt table id structure gt 57 lt tr gt lt td id page gt lt php if lempty message echo lt p class message gt message lt p gt
94. s and to provide graphical and written descriptions as they correlate to the functional requirements of the software 2 2 2 Registration Login Logout Create New Session Validate User Register New User Add first Name to Get Valid Password database Get Valid User Name Add email address to database Add Username to Add Last name to database Add Password to Database Database Figure 2 2 1 Registration Login Logout Figure 2 2 1 depicts the general means by which the program allows a user to register login and logout To register the program requires a first name last name username email address and password Once the create account button is clicked the username password combination allows the user to login on the log in screen Requirement 2 1 1 When the program accepts the user registration the user may create a new session by logging in The program validates the user name and password If the username password pair is correct a new session is created If it is incorrect the program will display an error message Requirement 24 2 1 2 The program allows users to logout by selecting the logout button on the Main Page screen Reguirements 2 1 22 2 1 23 2 2 3 Basic Program User Navigation Modify Word Game Website Update Profile KY eee Save Word iew Word Pairs Description Pairs Load Old Games Data Load Active Games Data Add New Game Data Description Pairs Delete Wor
95. s accumulated into larger bodies such as stars and planets Astronomy Modify Delete Algorithm A component that improves performance by transparently storing data such that future requests for that data Computer can be served faster Science Modify Delete Assembly A type of computer CPU programming language which consists entirely of numbers and are almost impossible Computer Language for humans to read and write Science Modify Delete AVL Tree A self balancing binary search t and it is the first such data structure to be invented In this tree the heights Computer of the two child subtrees o y node differ by at most one Science Modify Delete Cache A component that improves performance by transparently storing data such that future requests for that data Computer can be served faster Science Modify Delete Computer A device doing calculations a Modify Delete Computer Science The study of the theoretical foundations of information and computation and of practical techniques for their Computer implementation and application in computer systems Science Modify Delete Constellation An internationally defined area of the celestial sphere Astronomy Modify Delete Critical Section A piece of code or a set of instructions that can only be executed by one process or thread at a time es Figure 2 1 12 Admin View Data interface 2 1 13 Admin Modify Data Screen Requirements 2 1 13 1 The interface shall allow administrators to modify a selected word description pair
96. s to insert new word description pairs into the question table The new_user php file allows unregistered users to create an account in order to have access to the complete site Below shows code from inputdata php for inserting a new word description pair into the question table in the database 39 START FORM PROCESSING if isset _POST submit Form has been submitted errors array perform validations on the form data reguired fields array word description errors array_merge errors check_required_fields required_fields _POST fields_with_lengths array word gt 100 description gt 500 errors array_merge errors check_max_field_lengths fields_with_lengths _POST word trim mysql_prep _POST word description trim mysql_prep _POST description genre trim mysql_prep _POST genre if empty errors query INSERT INTO question word description genreid addedby VALUES word description genre _SESSION user_id result mysql_query query connection if result message lt h3 gt The word pair has been successfully added lt h3 gt 1 win word description query UPDATE users SET rank rank 1 WHERE id _SESSION user_id result mysql_query query connection message The word pair could not be added message
97. s to select a game currently hosted on the website The interface shall provide links to each of the game pages The interface shall display the name of each game as a link The interface shall display a description of each game The program shall create an instance a unique row designated by an ID in the live game table of the game in the database that holds the game ID the user ID and the current date and time The program shall pass the ID of the instance just created in the database as a parameter when the game link is selected Description Race your car faster and faster by answering questions quickly Otherwise your game may come to a complete stop Try your best at these insane crossword clues Take time limited multiple choice quizzes on a variety of topics with randomized correct and incorrect choices A dangerous round of questions where answering incorrectly could cost you a lot of points Three rounds of increasing difficulty can you make it all the way through with 80 correct or better Figure 2 1 5 Play Game interface 2 1 6 Continue Game Screen Reguirements 2 1 6 1 The interface shall allow users to continue a game they have previously started and have not finished yet 2 1 6 2 The interface shall display all the current live games as a list 2 1 6 3 The interface shall provide links to access these games in progress 2 1 6 4 The interface shall display the name of each game as a link 2 1 6 5 The interf
98. structure for the online gaming website and includes their relationships id int name string description string admin bool active bool description string genreid int addedby int description string siteaddress string Figure 3 2 1 UML Diagram of the database 29 3 2 1 Users Table The users table consists of eight attributes The id is an integer value and acts as the primary key of the table It is unique and auto increments The firstname lastname username and password are all varchars and are self explanatory The rank is an integer value that increments as the user adds data pairs The admin attribute can either be a zero one If it is zero the user does not have administrator privileges If it is a one the user has administration privileges The active variable stores whether the user has an active account or not If it is a one the account is active 3 2 2 Game Table The game table consists of three attributes The id is an integer value and acts as the primary key of the table It is unique and auto increments The title attribute is a varchar and stores the game title The description attribute is a varchar and stores the description of the game in the database The siteaddress attribute is a varchar and stores the address of the game on the website 3 2 3 Question Table The question table co
99. t lt td gt lt td gt lt tr gt lt table gt lt php include includes footer php gt Viewgenres php lt php require_once includes session php gt lt php require_once includes connection php gt lt php require_once includes functions php gt lt php confirm_logged_inQ gt lt php include includes head_admin php gt lt php include_once includes form_functions php gt lt div id main gt lt h2 gt View Add Modify and Delete Genres lt h2 gt lt a href addgenre php gt Add A New Genre lt a gt lt br gt lt br gt lt php if isset _REQUEST id id _REQUESTT id query DELETE FROM genre WHERE id id result mysql_query query if result message lt h3 gt The Genre has been successfully deleted lt h3 gt else message The Genre could not be deleted message lt br gt mysql_error if lempty message echo lt p class message gt message lt p gt if empty errors display_errors errors echo lt table gt lt tr gt lt td gt lt b gt Modify lt b gt lt td gt lt td gt lt b gt Delete lt b gt lt td gt lt td gt lt b gt Name lt b gt echo lt td gt lt td gt lt b gt Description lt b gt lt td gt lt tr gt result mysql_query SELECT FROM genre ORDER BY name asc num mysql_numrows result i 0 81 while i lt num id mysql_result result i
100. t there is still much to do regarding the database error checking and the graphical user interface For the database there currently exists no protection when a table row is deleted If a row in one table is referenced in another table It will be deleted without question yet leave the other record that references it untouched This should adjusted to prevent this from happening or to also delete all records associated with it from the database Also the livegame table rows expand rapidly Every time a user clicks a link to play a game a new instance is added This is fine normally because when a game is being continued or is finished a record of the game is maintained for each user However should a user decide they no longer want to continue a game and instead delete the record a gap in the numbering system now will exist A future student may want to create an additional table that stores the ID s of all deleted records Then when a new game is being clicked if a record exists in deleted ID s table the program could reuse one of these ID s in the livegame table In terms of error checking the program works correctly in most regards It also ensures that there are no errors on log in and logout and protects against leaving a field blank However the program does not protect against leaving a field blank when a new record is being inserted or 44 updated in other areas of the site This should be thoroughly investi
101. the Description text box Add its site address on the server in the Site Address text box Then click the Add button A message at the top of the page above the form will inform you that the game was successfully added to the database If there was an error an error message will display instead To view the games that have been added you may either click the hyperlink above the form titled View List or select the tab titled Game 112 Add A New Game Return to List Figure B18 Add New Game Page I Modify Game Page By clicking on a modify hyperlink next to the game on the Game page you will be directed to a page that includes a form populated with the data specific to that game Here you may change the game title its description and its site address Once you have finished editing simply click the button under the form named Update A message will be posted above the form telling you whether the game was updated successfully or if there were errors while updating Modify Game Burn and Learn Race your car faster and faster by answering questions quickly Otherwise your game may come to a complete stop tjyanai BurnNLearn php Save Figure B19 Modify Game Page 113
102. tion is incorrect an error message is displayed on the page START FORM PROCESSING if isset S_POST submit Form has been submitted Serrors array perform validations on the form data Srequired_fields array username password Serrors array_merge Serrors check_required_fields Srequired_fields POST 35 Sfields_with_lengths array username gt 30 password gt 30 Serrors array_merge Serrors check_max_field_lengths Sfields_with_lengths POST Susername trim mysql_prep _POST username Spassword trim mysql_prep _POST password if empty Serrors Check database to see if username and the hashed password exist there Squery SELECT id username Squery FROM users Squery WHERE username Susername Squery AND hashed_password Spassword Squery LIMIT 1 Sresult_set mysql_query Squery confirm_query Sresult_set if mysql_num_rows Sresult_set 1 username password authenticated and only 1 match Sfound_user mysql_fetch_array Sresult_set S_SESSION id session_id S_SESSION user_id Sfound_user id S_SESSION username Sfound_user username redirect_to slaforge index php else username password combo was not found in the database Smessage Username password combination incorrect lt br gt Please make sure your caps lock key is off and try again else if cou
103. unsuccessful at deleting the word description pair 10 View Modify and Delete Word Description Pairs Delete Delete Delete Delete Word Accretion Java Search Engine Description The pr y where dust and gas accumulated into larger bod ich as stars and planets eveloped by Sun Mic tems It resembles C but was designed to designed to help find information over a computer network such as the World Wide Web inside a etary network or a personal computer A computer corporate o Figure 2 1 9 My Data interface 2 1 10 Modify My Data Screen Requirements 2 1 10 1 The interface shall allow users to modify a selected word description pair Genre Computer Science 2 1 10 2 The interface shall display a form with the current data stored in the database 2 1 10 3 The program shall allow the user to change the word description and genre of the particular pair 2 1 10 4 The program shall update the database with the new information when the save button is selected 2 1 10 5 The program shall display a message stating that the pair was successfully updated when the save button is selected 2 1 10 6 The interface shall display an error message when the program was unsuccessful at updating the database 2 1 10 7 The interface shall contain a link that shall direct the user to the entire list of the user s word description pairs 11 Modify Word Description Pairs Back to
104. v id main gt lt h2 gt Continue A Game lt h2 gt lt table id structure gt lt tr gt lt td id page gt lt div id gamescontainer gt lt ul id gamesmenu gt lt php 50 if lisset REOUESTTI id id _REQUEST id query DELETE FROM livegame WHERE id id result mysql_query query if result message lt h3 gt The Game you selected has been successfully deleted lt h3 gt else message The Game could not be deleted message lt br gt mysql_error if lempty message echo lt p class message gt message lt p gt if empty errors display_errors errors id _SESSION user_id result mysql_query select g id g title g siteaddress lg id lg userid 1g numquestion lg numquestionsanswered lg numcorrect lg ended from game as g inner join livegame as lg on lg gameid g id where lg ended 0 amp amp Ig userid id num mysql_numrows result i 0 while i lt num lid mysql_result result i lg id gid mysql_result result i g id uid mysql_result result i lg userid siteaddress mysql_result result i g siteaddress title mysql_result result i g title numquestions mysql_result result i lg numquestion numquestionsanswered mysql_result result i lg numquestionsanswered numcorrect mysql_result result i lg numcorrect gt lt tr gt lt b gt lt td gt
105. word rank email address the activation status and the administrative privileges of a particular user The program shall update the database with the new information when the save button is selected The program shall display a message stating that the user was successfully updated when the update button is selected The interface shall display an error message when the program was unsuccessful at updating the database The interface shall contain a link that shall direct the administrator to the entire list of users 18 Modify Users Back to list First Name Last Name User Name Password Rank Email Activated Admin Priveleges Update and save Capital Reef capitalreef reefy 0 capital reef com x o Update Figure 2 1 18 Admin Modify User interface 2 1 19 Admin View Games Screen Requirements 2 1 19 1 2 1 19 2 2 1 19 3 2 1 19 4 2 1 19 5 2 1 19 6 The interface shall allow administrators to view the games that have been added into the database The interface shall have a link directing them to a page where they may modify each game The interface shall have a link allowing them to delete any game The interface shall display the title description and site address of all the games in the database The interface shall display a message telling the administrator that the game was successfully deleted when the administrator selects the delete l

Download Pdf Manuals

image

Related Search

Related Contents

keenan brochure german  "取扱説明書"  Manuel moteur pneumatique a palettes 6,5cr-04  KAC-7404 KAC-6404    Nanoindentation and Nanoscratching with SPMs For NanoScope  €= Brunet Clinique  AEG DF6164-M  ORION 2000 - Millennium 2000  LV-2.0 電源トランス[LVX  

Copyright © All rights reserved.
Failed to retrieve file