Home

PAMS: A WEB-BASED PROGRAMMING

image

Contents

1. 37 Figure 14 Students Check Grades m mee 37 Figure 15 Grading Process Flow Diagram 38 Figure 16 Call GCC mCvgwm m me memes nene 39 Figure 17 Compiled file in Windows Explorer 39 Figure 18 Method for calling GCC e ene 40 Figure 19 Error in compilation 40 Figure 20 Contents in log during compilation 44 1X Chapter 1 INTRODUCTION Many Computer Science courses require student to do programming assignments however grading these programming assignments takes a lot of time furthermore instructors have to grade these assignments repeatedly These grading processes are monotonous and could be done by a program Conventional way of grading a programming assignment includes several steps which are collecting assignments compiling source code testing result for each compiled file checking roster and submission timestamps giving grades and publishing grades The entire process might take several hours for grading each assignment I designed a management system called PAMS Programming Assignment Management System which not only automates grading programming assignment but also manages student information and collects submission for instructors PAMS provides web based user interface customizable grading logic and reliable information storage 1 1 Related Works Base on the searching
2. Fileinfo it is used to store submission information 14 Table 2 Fileinfo table Attribute Type Not Null Key Foreign Key fid integer Yes Yes fname varchar Yes fsize varchar Yes fts date Yes sid varchar Yes Userinfo id Course it is used to store course information Table 3 Course table Attribute Type Not Null Key Foreign Key cid varchar Yes Yes cname varchar Yes totalcredit varchar Yes semester varchar Yes section varchar Yes grader varchar instructor varchar Assignment it is used to store assignment information Table 4 Assignment table Attribute Type Not Null Key Foreign Key aid varchar Yes Yes aname varchar Yes duedate date Yes cutoffdate date Yes cid varchar Yes Course cid weight integer fullcredit integer atype varchar other varchar 15 description varchar e Record it is used to store student grades Table 5 Record table Attribute Type Not Null Key Foreign Key rid integer Yes Yes sid varchar Yes Userinfo id aid varchar yes Assignment aid point integer Yes comment varchar e Sysconfig it is used to store system variables Table 6 Sysconfig table Attribute Type Not Null Key Foreign Key configid integer Yes yes configname varchar configvalue varchar description varchar
3. 82 p Runtime getRuntime exec command InputStream fis p getInputStream InputStreamReader isr new InputStreamReader fis BufferedReader br new BufferedReader isr String line null StringBuilder sb new StringBuilder fileDir StringBuilder sb new StringBuilder while line br readLine null System out printin line sb append line sb append WW result sb toString t s result catch IOException e e printStackTrace return result 83 REFERENCE 1 SacCT https online csus edu webct entryPageIns dowebct 2 WASG Palnitkar Rahul A WEB BASED ASSIGNMENT SUBMISSION AND GRADING SYSTEM 2003 3 Cygwin http en wikipedia org wiki Cygwin 4 Java EE http download oracle com javaee 6 firstcup doc 5 GlassFish http glassfish java net 6 JavaServer Face http www oracle com technetwork java javaee javaserverfaces 139869 html 7 Model View Controller http en wikipedia org wiki Model E2 80 93view E2 80 93controller 8 Enterprise JavaBean http www oracle com technetwork java javaee ejb index html 9 Java Persistence API http www oracle com technetwork articles javaee pa 137156 html 10 MySQL http www mysql com 11 Stateful session bean http en wikipedia org wiki Enterprise JavaBeanfstStateful Session Beans 12 Stateless session bean http Java sun com 2ee tutori
4. 4 3 Persistence Tier Design and Implementation 4 3 1 Description of Persistence Tier Persistence Architecture API is a Java specification for accessing persisting and managing data between Java objects and a relational database The main objective of designing persistence tier is making it easier for a program to persist its state in other word Persistence Tier bridges the gap between object models and the relational models 16 4 3 2 Mapping Relational Tables to Persistence Entities There are two ways to specify entity metadata which is not persisted in the database annotations or XML They are equally valid using annotations is more convenient for all developers and using XML is fairly straightforward for developers who still prefer to use traditional XML In this project I use annotations javax persistence package contains all the useful APP s for writing persistence entities For writing a persistence class annotations Entity and Table are required they designate this class as an entity class and its corresponding table name Annotation NamedQueries is used to preset some queries for this entity such as select statement Annotations 9 OneToMany or ManyToOne shows the cardinality between entities e Persistence class for table assignment Entity Table name assignment NamedQueries NamedQuery name Assignment findAll query SELECT a FROM Assignment a public class Assign
5. public void setCurrent Userinfo current this current current public String login current getFacade find this id if current getPassword equals this password getSessionMap put currentUser this current if current getRoletype equals ad getSessionMap put id current getId return dataBase faces redirect true else getSessionMap put id current getId System out printIn getSessionMap get id toString return panel faces redirect true 77 else this message Please check your password return index ViewUpload java package com pz managedbean import com icesoft faces component ext RowSelectorEvent import com pz persistence Fileinfo import com pz persistence Userinfo import com pz sessionbean FileinfoFacade import java util Comparator import java util List import java util Map import javax ejb EJB import javax faces bean ManagedBean import javax faces bean RequestScoped import javax faces context FacesContext import javax faces model ListDataModel import javax persistence EntityManager import javax persistence PersistenceContext author Peng ManagedBean RequestScoped public class ViewUpload EJB private com pz sessionbean FileinfoFacade ejbFacade PersistenceContext EntityManager em private List lt Fileinfo gt allList private List lt Fileinfo gt result private Useri
6. Committee Chair Du Zhang Ph D Date 1v ACKNOWLEDGMENTS I am heartily thankful to my advisor Dr Du Zhang whose encouragement and guidance from the beginning to the final level enabled me to design and implement PAMS I also thank Dr Chung E Wang for his precious time and all the people who supported me in any respect during the completion of this project TABLE OF CONTENTS Page e eeh E eu EE v List Of Tables niai ELE eed ite Hee EU EE tene viii Eistof Figures p EE ix Chapter INTRODUCTION cutter ete ite onto eie tere ee 1 Lk Related WORKS A A eere e re t eie e 1 1 2 Scope f PAMS tie iuo LIRE HR E E LUE UC e aloe epe oed 2 2 BACKGROUND dee dei diea den 4 3 REQOUIREMENT ANALDYSIS 22 t etit eet it e HH CER PR ELEME HE e et dete aet 6 3 1 General Description egene ENEE ENEE 6 3 1 T User Characteristics curie eem it rt e pde 6 5 1 2 Functional Re quirements cidade 6 3 1 2 1 Administrator Functional Requirements eese 6 3 1 2 2 Student Functional Requirements ss 7 Ee UE H 3 2 T Interface R quireme nts 1 5 58 e EU dp ed tere et eiit 7 3 2 RRE 7 3 2 1 2 Hardware Interface eee eee be List 7 3 2 1 3 Communication Interface ss 7 3 2 2 Non functional Requirements ss 7 3 355 ystem Coristralnts sey mener nimes A rre EN 8 3 4 Data Model Dia grains css ree etat ane dE 8 30 Use Case oe pes M CC C e 9 3 5 T Use Case Diagram ica 9
7. p waitFor outThd join errThd join catch Exception err System err println err Figure 18 Method for calling GCC Even though the result of compilation is very important to PAMS the process of compilation is also import to instructor for the purpose that instructor can observe the details of compilation Figure 19 shows an error was found in compilation cd C temp johndoe gmail com progi c o C temp johndoeRgmail com progi yguwin warning MS DOS style path detected C temp johndoe gmail com progi c Preferred POSIX equivalent is cygdrive c temp johndoe gmail com progi c CYGWIN environment variable option nodosfilewarning turns off this warning Consult the user s guide for more details about POSIX paths http cyguwin m cygwin ug net using htmlitusing pathnames bash cd C temp johndoe gmail com progi c Not a directory Figure 19 Error in compilation Therefore we need a mechanism to display these messages in other words we not only want to input commands to console but also we would like to see the responses from console So a class called StreamPipe is deployed in grading logic of PAMS The class creates an input stream and an output stream which take care of the communication between the PAMS and GCC Any method that wants to use StreamPipe class should provide two threads for input stream and output stream to ensure that two streams work individually without influencing the other one
8. lt f facet gt lt ice panelPopup gt lt ice panelPopup rendered true draggable true style z index 1000 top 64 left 18 position absolute width 200px height 100px gt lt f facet name header gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 1 style text align center gt lt ice outputText style color black value Sticky notes lt ice panelGrid gt lt f facet gt lt f facet name body gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 1 gt lt ice outputText value Only Add an assignment is available now gt lt ice panelGrid gt lt f facet gt lt ice panelPopup gt lt Floating Box End gt lt ice panelBorder renderCenter true renderEast true gt lt f facet name center gt lt ice panelTabSet width 800 height 500 gt lt ice panelTab label Submission gt lt ice dataTable id view_upload_table value viewUpload allList var file rows 10 gt lt ice rowSelector value viewUpload selectedFile selectionAction viewUpload rowSelectionListener gt 61 ice column lt f facet name header gt lt ice commandSortHeader columnName File Name arrow true gt lt ice outputText value File Name gt lt ice commandSortHeader gt lt f facet gt lt ice outputText value file fname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value File
9. 1 2 Expend the operation panel in dashboard page click on add an assignment Type in information for assignment name assignment type due date cutoff date weight full credit and description in the pop up panel Click on add button to finish add an assignment e Delete an assignment 1 2 Expend the operation panel in dashboard page click on delete an assignment Select the assignment that you want to delete in the drop down list in the pop up panel Click on confirm to delete this assignment e Edit grades 1 2 In dashboard page click on grade tab in the center panel Select an assignment and then click on display button to show grades for selected assignment Select a grade by clicking the corresponding row in the table Click on edit this record in the operation panel at the right side of dashboard page Type in a new grade in the pop up panel Click on update button to finish editing 54 APPENDIX B Source Code index xhml lt xml version 1 0 encoding UTF 8 lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Transitional EN http www w3 org TR xhtml1 DTD xhtml 1 transitional dtd gt html xmins http www w3 org 1999 xhtml xmlns ui http java sun com jsf facelets xmlns icecore http www icefaces org icefaces core xmlns ice http www icesoft com icefaces component xmlns ace http www icefaces org icefaces components xmlns h http java sun com jsf html gt
10. Test the result 41 Once the GCC finish the compilation the compiled files which are executable files in Windows are created in the same directory of source code the easiest way of check the results of these programs is running them in windows command line cmd directly PAMS do this for instructors as well It uses Process object in Java to iteratively run the programs and it records the output of each program by storing it in a Map object with a user id as key After PAMS catches all the results it iteratively matches the result to the correct answer and it records all the grades simultaneously Methods for grading programs o First of all system checks submission and maintain a score table in memory Use Userlnfo session bean to retrieve all student objects List scoreTable getUserInfoFacade findAll If Student does not submit the assignment or his her source code cannot pass compilation PAMS gives them a score and update the score table o Secondly system checks the correctness of source code This requires administrator set up some test cases and their corresponding correct results Administrator could specify the exact result for one test case or administrator could specify the key words which could be ordered or disordered he she is look for PAMS is able to match the correct result and output of source code or it searches for the key words in the output of source code Then PAMS gives a grade base on the weight of eac
11. customizable user friendly reliable and secure system There is no doubt that both students and instructors could obtain good user experience in using PAMS 6 1 Future Work There are a few improvements that probably could make PAMS better e Making PAMS platform independent This only requires some modification in grading logic module e Adding email function Undoubtedly using email is one of the easiest ways to contact a person today adding email function would help PAMS to publish information or broadcast news quickly e Adding text message reminder for mobile devices Mobile devices are very popular today PAMS would become more user friendly if it could send reminders to student s iPhone or Android devices 48 Grading programming assignments written in other languages This requires a compiler for other languages Even though PAMS only includes C compiler currently it does provides APIs of calling Java compiler Fixing browser compatibility issue This could be done when next version of ICEfaces framework renders UI Components perfectly on IE browser 49 APPENDIX A User Manual Student e Login 1 Type in URL http servername 8080 pams in address bar of browser then hit enter button 2 Inlogin page type in user name and password correctly and then click on login button e Dashboard There is a horizontal navigation bar located near the top of the page it has four menu items profile
12. lt f facet name previous gt lt ice graphicImage urlz xmlhttp css xp css images arrow previous gif style border none title Previous Page gt lt f facet gt lt f facet name next gt lt ice graphicImage urlz xmlhttp css xp css images arrow next gif style border none title Next Page gt lt f facet gt lt f facet name fastforward gt lt ice graphicImage url xmlhttp css xp css images arrow style border none title Fast Forward gt lt f facet gt lt f facet name fastrewind gt lt ice graphicImage url xmlhttp css xp css images arrow style border none title Fast Backwards gt lt f facet gt lt ice dataPaginator gt lt ice panelTab gt lt ice panelTab label Grades gt lt ice selectOneMenu value viewGrades assignmentName gt lt f selectltem itemLabel Assignment 1 itemValue csc13911 gt lt f selectltem itemLabel Assignment 2 itemValue csc13912 gt lt f selectltem itemLabel Assignment 3 itemValue csc13913 gt lt f selectltem itemLabel Assignment 4 itemValue csc13914 gt lt f selectltem itemLabel Assignment 5 itemValue csc13915 gt lt f selectltem itemLabel Assignment 6 itemValue csc13916 gt 63 lt ice selectOneMenu gt lt ice commandButton value Display action viewGrades retrieveResult gt lt br gt lt ice dataTable id view_all_grades value viewGrades resultByAssignment var grade scrollable true
13. scrollHeight 300px columnWidths 70px 200px 100px 100px 100px 100px gt lt ice rowSelector gt lt ice column gt lt f facet name header gt lt ice outputLabel value Assignment gt lt f facet gt lt ice outputText value grade assignment aname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputLabel value User Name gt lt f facet gt lt ice outputText value grade userinfo id gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputLabel value First Name gt lt f facet gt lt ice outputText value grade userinfo fname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputLabel value Last Name gt lt f facet gt lt ice outputText value grade userinfo Iname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputLabel value Grade gt lt f facet gt lt ice outputText value grade point gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputLabel value Comment gt lt f facet gt lt ice outputText value grade comment gt lt ice column gt lt ice dataTable gt lt ice panelTab gt lt ice panelTab label Students gt 64 lt ice dataTable 1d2 view all students value viewStudent userList varz user rows 10 gt ice column ice rowSelector selectionListener H view
14. 3 5 2 Typical Flow Scenario of the System 10 3 5 2 1 Use Case Students Submit Assignments esee rennen 10 3 5 2 2 Use Case Students Check Grades ss 10 3 5 2 3 Use Case Administrator Manages the Student Information 10 vi 3 5 2 4 Use Case Administrator Sets up System 11 3 5 2 5 Use Case System Grades Assignments eese 11 4 DESIGN ANDIMPEEMENTA TION eee enne nnnm eiae eaei ae eae 12 AT System Over Witt ii rif 12 4 2 Database Design and Implementation 13 4 3 Persistence Tier Design and Implementation 15 4 3 T Description ot Persistence Det is reae repere re pte eden ed tongs 15 4 3 2 Mapping Relational Tables to Persistence Entities eee 16 4 4 Enterprise JavaBean Tier Design and Implementation ssssseeeesseersesrereesrerresrrrreseesresresres 24 4 4 1 Objectives of Using EJB atisbo 24 4 452 Design EJB Classes tin eto tene ts 24 4 4 3 Implement EJB neret eere td dee ee ne EE qe 25 4 5 Web Tier Design and Implementation ssseseesseseesseereesesressesersstrrrsstestrstesresteserresseeresseents 29 4 5 1 Description of Web Tier etit iere te e ee ect eret teet eoa 29 4 5 2 Model and View Design and Implementation esee 31 4 6 Grading Lotus E e ae a ede aded 38 4 7 Tools for Design and Implementation ss 42 3 PERFORMANCE EVALUATION eee ete ed eo cinc Deed ett eee dete dene Hehe cone 43 6 CONCLUSION eae bee dene b 47 6 1 Future Works datar
15. 47 Appendix A User Manual eee a E Rat ent ae 49 Appendix B Source E 54 R f rence nine ely tie ea aA lie ai net at mn ii nait tte 83 vii LIST OF TABLES Page Table 1 Userinfo Fable eur orit ee lion dara 13 Table 2 Fileinfo Table err en tee eR ene e I ERE ES 14 Table 3 Course Ti rd etd ERR lei 14 Table 4 Assignment Table n me he 14 Table 5 Record Table o tetro EE UNUS ached i eto pU ERI S ien S 15 Table 6 Sysconftig Table o iex ee A E E Uie 15 viii 10 11 12 13 14 15 16 17 18 19 20 LIST OF FIGURES Page Figure 1 Entity Relationship Dagram cesse He 8 Figure 2 Use Case Diagram Ee dias 9 Figure 3 Structure of PA MS ui 12 Figure 4 Login BOX icono ie RR Ede htt tondeuse ire Deren 31 Figure 5 Administrator Dashboard ssssssseessessrrrerrrsssreersssrerreseeerereersseres 32 Figure 6 Add Student Function sees e e e me mee 33 Figure 7 View Grades seo a eur ety Ta atau LEE 34 Figure 8 Student Dashboard mee 35 Figure 9 Student Profile Page e e e he he 35 Figure 10 Assignment List Dage erssinaeie inaa E EE R TE E AE R A 36 Figure 11 Submission Pale coins oie ere depo EE ee 36 Figure 12 Submission Finished 37 Figure 13 Submission History
16. C programming assignments PAMS provides functions of managing relevant information collecting submission grading C programming assignments and publishing grades Therefore PAMS could e Authenticate users Update information showed on web pages according to the requirement of instructor Grade C programming assignments Record timestamps and submission history for each user Provide user friendly interface Maintain all the relevant data Manage submitted files Archive important data and files at the end of each semester Chapter 2 BACKGROUND In general programming assignment management system should have ability to maintain any relevant data To grade an assignment system must check the correctness of the source code by compiling it and checking program output additionally the submission date should be checked as well This requires system keeps the timestamp of each submission and the due date of each assignment For compilation part usually people compile C program in Unix Linux environment using GCC however there is another way of compiling C program in Windows environment using a tool called Cygwin 3 which is a Unix like environment for Windows Web based interface is very popular nowadays it has many advantages such as it does not require users to install any application on their machines it is difficult to find computers that do not come with browsers Web based application is easier to develop for de
17. ace http www icefaces org icefaces components xmlns ice http www icesoft com icefaces component gt lt h head gt lt title gt Sacramento State Computer Science lt title gt lt link rel stylesheet type text css href xmlhttp css rime rime css gt lt style type text css gt body background image url resources pic icecrystal jpg lt style gt lt h head gt lt h body gt lt ice form gt lt ice outputLabel value submissionController fname gt lt ice outputLabel value submissionController Iname gt lt hr gt lt ice menuBar orientation horizontal gt lt ice menultem value Profile gt lt ice menultem value View link profile xhtml gt lt ice menultem gt lt ice menultem value Submission gt lt ice menultem value Submit action submissionController goSubmit gt lt ice menultem valuez View action submissionController go View gt lt ice menultem gt lt ice menultem value Check Grades link viewGrade xhtml gt 56 lt ice menultem gt lt ice menultem value Logout action submissionController logout gt lt ice menultem gt lt ice menuBar gt lt br gt lt br gt lt br gt lt br gt lt br gt lt br gt lt ul gt lt li gt Please update your profile if you don t see your name on the page lt li gt li Please don t forget to log out lt li gt lt ul gt lt br gt lt br gt lt br gt lt br gt lt br gt lt br
18. and testing cases and letting PAMS take care of the rest PAMS collects the submissions from students before cutoff date compiles and executes the programs and then verifies for the correctness of the results Students could check their grades after PAMS finishes grading PAMS interacts with users by a web interface Using PAMS requires just a browser with internet access My project is a perfect tool for instructors who need students to submit programming assignments Since there is no similar tool could provide similar functions which are managing student information and grading C programming assignments PAMS actually fills in this gap Designing PAMS follows the latest Java EE 6 specification which includes JavaServer Faces 2 0 Java Servlet 3 0 Enterprise JavaBeans 3 1 and Java Persistence 2 0 The JavaServer Faces provides rich web interface by Ajax components Enterprise JavaBeans contains business logic which are database transaction control and grading logic The Java Persistence maps the database relations to Java objects that can be used by Enterprise JavaBeans Virtual machine technology is utilized for the grading component in PAMS MySQL provides the backend database support for PAMS For current version of PAMS only C programming assignments can be graded automatically however PAMS does provide API for calling Java compiler and testing Java Class Grading programming assignments written in other languages is the future work for PAMS
19. body background color ADD8E6 background image url resources pic brick_small jpg lt style gt lt h head gt lt h body gt lt ice form id main gt lt ice panelGrid columns 1 gt lt ice menuBar orientation horizontal gt lt ice menultem value Set up gt lt ice menultem value Preset system link regclass xhtml gt lt ice menultem value Change settings link changeSetting xhtml gt lt ice menultem gt lt ice menultem value Database link dataBase xhtml gt lt ice menultem gt lt ice menultem valuez Grading link gradeAssignments xhtml gt lt ice menultem value Statistic link gt lt ice menultem value Logout action submissionController logout gt 60 lt ice menultem gt lt ice menuBar gt lt Floating Box gt lt ice panelPopup rendered true draggable true style z index 1000 top 64 left 1 position absolute width 200px height 100px gt lt f facet name header gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 1 style text align center gt lt ice outputText style color black value Reminder gt lt ice panelGrid gt lt f facet gt lt f facet name body gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 1 gt lt ice outputText value 1 Assignment 3 due date 3 29 gt lt ice outputText value 2 Grade assignment 3 after break gt lt ice panelGrid gt
20. contains the methods of checking timestamps calling compiler and managing files Dividing PAMS into several components is good for 13 e Reusability All components including four tiers and a grading logic module can be reuse by other system EJB tier grading logic module and persistence tier have their own APIs to interact with other components e Maintainability It is easy to find and solve the problem in the system if it is using multi tier structure We can simply remove one component and modify it then put it back because each component is independent and its interface is same to its neighbor components Because loosely coupled PAMS is written in Java it can be deployed on any Windows Unix Linux platform the only component that need to be modified is grading logic which only provides the function calls for Cygwin environment in Windows 4 2 Database Design and Implementation Base on the ERD diagram in software requirement analysis chapter this project needs six tables entities e Userinfo the relation is used to store the user information It has nine attributes in which userld password roletype and classId are required other attributes are optional Table 1 Userinfo table Attribute Type Not Null Key Foreign Key id varchar Yes Yes pwd varchar Yes roletype varchar Yes cid varchar Yes fname varchar Iname varchar gender varchar degree varchar credit varchar
21. f selectltems value viewStudent courseList gt lt ice selectOneMenu gt lt ice outputText gt lt ice outputText value First Name gt lt ice inputText value viewStudent fName gt lt ice outputText gt lt ice outputText value Last Name gt lt ice inputText value viewStudent IName gt lt ice outputText gt lt ice commandButton value Update action viewStudent editStudent gt lt ice commandButton value Delete action viewStudent delStudent gt lt ice commandButton value Cancel action viewStudent editStudentCancel gt lt ice panelGrid gt lt f facet gt lt ice panelPopup gt lt 71 lt ice panelPopup id add re modal true rendered true visible viewGrades isShow draggable false style z index 1000 top 30 left 5 position absolute width 380px height 180px gt lt f facet name header gt lt ice panelGrid width 380px cellpadding 0 cellspacing 0 columns 2 style text align center gt lt ice outputText style color black value Add a record gt lt ice panelGrid gt lt f facet gt lt f facet name body gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 3 gt ice outputText value Student user name gt lt ice selectOneMenu gt lt f selectItem item Value a itemLabel a gt lt ice selectOneMenu gt lt ice outputText value gt lt ice outputText value Select assignment
22. finish grading this assignment nicely except that some programs cannot display results correctly in Windows environment Fortunately just a few programs suffer from this problem Instructors have to manually run these programs on Unix Linux machine Third assignment is writing a multi threaded C program to copy file using semaphores PAMS did a good job with having any problem 45 Problem 1 Both students and administrator need logging out function Originally PAMS doesn t provide any log out function student and administrator have to wait until the session expire Solution Add a new method called logout in managed bean public String logout f Map lt String Object sessionMap FacesContext getCurrentInstance getExternalContext getSessionMap sessionMap remove id sessionMap remove currentUser return index faces redirect true Problem 2 Students need an assignment list page Assignment list page could show how many assignments are available and how many assignments have been done Solution Add an assignment list page Problem 3 Some programs cannot display correctly in Windows environment Solution Manually run these programs in Unix Linux environment Another solution is making PAMS platform independent it is not difficult to do this since PAMS is written in Java This is part of future work Problem 4 Preventing system user from visiting certain page by typing in URL address Solution Add a met
23. gt lt ice selectOneMenu gt lt f selectItems value viewStudent courseList var course itemLabel course cname itemValue course cid gt lt f selectItem itemLabel csc 13911 itemValue csc13911 gt lt ice selectOneMenu gt lt ice outputText gt lt ice outputText value Points gt lt ice inputText value gt lt ice outputText gt lt ice outputText value Comment gt lt ice inputText value gt lt ice outputText gt lt ice outputText value gt lt ice commandButton value Add action viewStudent addStudentConfirm gt lt ice commandButton valuez Cancel action viewStudent addStudentCancel gt lt ice panelGrid gt lt f facet gt lt ice panelPopup gt gt lt ice form gt lt h body gt lt html gt AuthenticationBean java package com pz authentication import java io Serializable 72 import java util Map import javax faces bean ManagedBean import javax faces bean SessionScoped import javax faces context FacesContext import javax faces event ComponentSystemEvent author Peng ManagedBean SessionScoped public class AuthenticationBean implements Serializable private Map lt String Object sessionMap Creates a new instance of AuthenticationBean public AuthenticationBean public Map lt String Object gt getSessionMap FacesContext context FacesContext getCurrentInstance sessionMap context g
24. gt lt br gt lt br gt lt ice panelGrid columns 2 gt lt ice outputLabel value User Name gt lt ice outputText value viewProfile uid gt lt ice outputLabel value First Name gt lt ice outputText value viewProfile fname gt lt ice outputLabel value Last Name gt lt ice outputText value viewProfile Iname gt lt ice outputLabel value Course gt lt ice outputText value viewProfile cid gt lt ice panelGrid gt lt ice commandButton value Update action viewProfile redir gt 59 lt br gt lt br gt lt br gt lt h link value Back outcome panel xhtml gt lt ice form gt lt h body gt lt html gt dashboard xhtml lt xml version 1 0 encoding UTF 8 lt Document dataBase Created on Mar 23 2011 12 57 08 AM Author Peng gt lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Transitional EN http www w3 org TR xhtml1 DTD xhtml 1 transitional dtd gt html xmins http www w3 org 1999 xhtml xmlns ui http java sun com jsf facelets xmlns f http java sun com jsf core xmins h http java sun com jsf html xmins icecore http www icefaces org icefaces core xmins ace http www icefaces org icefaces components xmins ice http www icesoft com icefaces component gt lt h head gt lt title gt Dashboard lt title gt lt link rel stylesheet type text css href xmlhttp css rime rime css gt lt style type text css gt
25. lt body gt ui composition template template StandardTemplate xhtml lt ui define name content gt lt ice form gt lt fieldset style width 300px gt lt legend gt Login lt legend gt lt table gt lt tr gt lt td gt lt ice outputLabel value User Name gt lt td gt lt td gt lt ice inputText value userinfoController id style width 200px gt lt td gt lt tr gt lt tr gt lt td gt lt ice outputLabel value Password gt lt td gt lt td gt lt ice inputSecret value userinfoController password style width 200px gt lt td gt lt tr gt lt tr gt lt td gt lt td gt lt td gt lt ice commandButton value login action userinfoController login gt lt td gt lt tr gt lt table gt lt fieldset gt lt br gt 55 lt ice outputText value userinfoController message gt lt ice form gt lt ui define gt lt ui composition gt lt body gt lt html gt panel xhtml lt xml version 1 0 encoding UTF 8 lt Document panel Created on Jan 18 2011 12 34 14 PM Author Peng gt lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Transitional EN http www w3 org TR xhtml1 DTD xhtml 1 transitional dtd gt html xmins http www w3 org 1999 xhtml xmlns ui http java sun com jsf facelets xmlns f http java sun com jsf core xmins h http java sun com jsf html xmlns icecore http www icefaces org icefaces core xmlns
26. return id public void setId String id this id id public Userinfo getCurrentUser return currentUser public void setCurrentUser Userinfo currentUser this currentUser currentUser 74 public String getFname currentUser getFacade find this getId fname currentUser getFname return fname public void setFname String fname this fname fname public String getLname Iname currentUser getLname return Iname public void setLname String Iname this name Iname public String logout f Map lt String Object sessionMap FacesContext getCurrentInstance getExternalContext getSessionMap sessionMap remove id sessionMap remove currentUser return index faces redirect true public String goSubmit System out printIn this getFname if this getFname equals FacesContext fc FacesContext getCurrentInstance FacesMessage fm new FacesMessage Please update you profile first fc addMessage null fm return null else return assignmentList faces redirect true public String goView if this getFname equals FacesContext fc FacesContext getCurrentInstance FacesMessage fm new FacesMessage Please update you profile first fc addMessage null fm return null else return viewUpload faces redirect true 75 UserinfoController java package com pz co
27. PAMS A WEB BASED PROGRAMMING ASSIGNMENT MANAGEMENT SYSTEM Peng Zhang B S Nanjing Normal University China 2007 PROJECT Submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE COMPUTER SCIENCE at CALIFORNIA STATE UNIVERSITY SACRAMENTO SPRING 2011 PAMS A WEB BASED PROGRAMMING ASSIGNMENT MANAGEMENT SYSTEM A Project by Peng Zhang Approved by Committee Chair Du Zhang Ph D Second Reader Chung E Wang Ph D Date 11 Student Peng Zhang Icertify that this student has met the requirements for format contained in the University format manual and that this project is suitable for shelving in the Library and credit is to be awarded for the project Graduate Coordinator Nikrouz Faroughi Ph D Date Department of Computer Science 111 Abstract of PAMS A WEB BASED PROGRAMMING ASSIGNMENT MANAGEMENT SYSTEM Managing and grading programming assignments always takes a lot of effort including accepting submissions checking timestamps of files grading and publishing grades PAMS is a web based system that is designed for the purpose of automating the entire procedure of managing and grading programming assignments With the help provided by PAMS grading programming assignment becomes incredibly easy for instructors The only thing that instructors need to do is setting up an assignment by providing information such as assignment name due date cutoff date
28. PU private EntityManager em protected EntityManager getEntityManager return em public AssignmentFacade super Assignment class e Course stateless session bean Stateless public class CourseFacade extends AbstractFacade lt Course gt PersistenceContext unitName PrayingMantisPU private EntityManager em protected EntityManager getEntityManager return em public CourseFacade super Course class 26 e Hieinfo stateless session bean Stateless public class FileinfoFacade extends AbstractFacade lt Fileinfo gt PersistenceContext unitName PrayingMantisPU private EntityManager em protected EntityManager getEntityManager return em public FileinfoFacade super Fileinfo class e Record stateless session bean Stateless public class RecordFacade extends AbstractFacade lt Record gt PersistenceContext unitName PrayingMantisPU private EntityManager em protected EntityManager getEntityManager return em public RecordFacade super Record class Sysconfig stateless session bean Stateless public class SysconfigFacade extends AbstractFacade lt Sysconfig gt PersistenceContext unitName PrayingMantisPU private EntityManager em protected EntityManager getEntityManager return em public SysconfigFacade super Sysconfig class Userinfo stateless session bean Stateless public class UserinfoFacade extends AbstractFacade
29. Size gt lt f facet gt lt ice outputText value file fsize gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Submission Timestamp gt lt ice outputText gt lt f facet gt lt ice outputText value file fts gt lt f converter converterld com pz converter DateTime gt lt ice outputText gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Student gt lt f facet gt lt ice outputText value file userinfo id gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Student First Name gt lt f facet gt lt ice outputText value file userinfo fname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Student Last Name gt lt f facet gt lt ice outputText value file userinfo Iname gt lt ice column gt lt ice dataTable gt lt ice dataPaginator id uploadPaginator forz view upload table paginator true fastStep 3 paginatorMaxPages 4 ff gif fr gif 62 gt lt f facet name first gt lt ice graphiclmage urlz xmlhttp css xp css images arrow first gif style border none title First Page gt lt f facet gt lt f facet name last gt lt ice graphiclmage urlz xmlhttp css xp css images arrow last gif style border none title Last Page gt lt f facet gt
30. Student rowSelectionListener multiple false gt lt f facet name header gt lt ice outputText value User Name gt lt f facet gt lt ice outputText value user id gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Class ID gt lt f facet gt lt ice outputText value user cid gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value User First Name gt lt f facet gt lt ice outputText value user fname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value User Last Name gt lt f facet gt lt ice outputText value user Iname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value User Password gt lt f facet gt lt ice outputText value user password gt lt ice column gt lt ice dataTable gt lt ice dataPaginator id viewStudentPaginator for view_all_students paginator true fastStep 3 paginatorMaxPages 4 gt lt f facet name first gt lt ice graphicImage urlz xmlhttp css xp css images arrow first gif style border none title First Page gt lt f facet gt lt f facet name last gt 65 lt ice graphicImage urlz xmlhttp css xp css images arrow last gif style border none title Last Page gt lt f facet gt lt f facet name previous gt lt ice graph
31. al 1 3 fcs doc EJBConcepts3 html 13 Singleton session bean http en wikipedia org wiki Enterprise JavaBean Singleton_ Session Beans 14 JSF life cycle phases http download oracle com avaee 1 4 tutorial doc JSFIntro10 html 15 Netbeans http netbeans org 16 Other projects http en wikipedia org wiki NetBeans 17 Relational database management System http en wikipedia org wiki Relational database management system
32. al long serialVersionUID 1L ld 21 GeneratedValue strategy GenerationType IDENTITY Basic optional false Column name rid private Integer rid Map column rid Column name point private String point Map column point Column name comment private String comment Map column comment JoinColumn name aid referencedColumnName aid ManyToOne private Assignment assignment Object assignment mapped by aid JoinColumn name sid referencedColumnName id ManyToOne private Userinfo userinfo public Record Getters and Setters Persistence class for table sysconfig Entity Table name sysconfig public class Sysconfig implements Serializable private static final long serialVersionUID 1L ld 22 GeneratedValue strategy GenerationType IDENTITY Basic optional false Column name configid private Integer configid Map column configid Basic optional false Column name configname private String configname Map column configname Basic optional false Column name configcontent private String configcontent Map column configcontent Column name description private String description Map column description public Sysconfig Getters and Setters e Persistence class for table userinfo Entity Table name userinfo public class Userinfo implements Serializable private static final l
33. anelGroup gt lt ice outputText value Student gt lt ice panelGroup gt lt f facet gt lt ice panelGroup gt lt ice commandLink value Add a student action viewStudent addStudent gt lt ice commandLink gt lt br gt h link outcome index xhtml value Edit student information br h link outcome index xhtml valuez Delete a student br lt ice panelGroup gt lt ice panelCollapsible gt lt ice panelCollapsible expanded true gt lt f facet name header gt lt ice panelGroup gt lt ice outputText value Grade gt lt ice panelGroup gt lt f facet gt lt ice panelGroup gt lt ice commandLink value Add a record action viewGrades showPanel gt lt br gt h link outcome index xhtml value Edit a record gt lt br gt lt ice panelGroup gt lt ice panelCollapsible gt lt ice panelCollapsible expanded false gt lt f facet name header gt lt ice panelGroup gt lt ice outputText value Assignment gt lt ice panelGroup gt lt f facet gt lt ice panelGroup gt h link outcome index xhtml value Add an Assignment gt lt br gt lt h link outcome index xhtml value Edit assignment information gt lt br gt lt h link outcome index xhtml value Delete an assignment gt lt br gt lt ice panelGroup gt lt ice panelCollapsible gt lt ice panelCollapsible expanded false gt lt f facet name header gt lt ice panelGroup gt lt ice ou
34. at of data in student txt should be Studentl user name class id Student2 user name class id 52 e Start grading process 1 2 Click on grading button in navigation bar in dashboard page Type in a test case for this assignment and corresponding correctly result or key words Choose between matching results and finding key words Choose ordered or disordered if you want PAMS to find key words in the output of student s program The order of key words matters if you select this If you want to see results of compilation click on compile button Then click on test results to see final results PAMS will automatically update database when this step finished If you do not want to see any results right now just click on compile and test result button at the bottom When grading process finished click on dashboard hyperlink to go back to dashboard e Add a student l In dashboard page click on add a student on the operation panel at the right side of page Type in student user name and select a class id from drop down list in the pop up panel Click on add button to finish adding a student e Delete a student l 2 3 In dashboard page click on student tab in the center panel Select a student by clicking the corresponding row in the table Click on delete this student on the operation panel at the right side of page 4 53 Click on confirm in the pop up panel e Add an assignment
35. ck to panel page assignment list page check submission history page or upload another file after he she successfully submit a file Use Case Students Check Grades Student log into the system by providing his her user name and password Student clicks on the check grades button on the navigation bar in panel page Student could see a grades table with table headers assignment name grade and comment Use Case Administrator Manages the Student Information Administrator log into the system by providing his her user name and password Administrator is redirected to dashboard page in which there are five tabs submission grades students assignment and course Administrator clicks on the student tab Administrator is able to see all the information of registered students including their user name class name first name last name and their password 11 e Administrator clicks add a new student button on the control panel which is located within the dashboard page if he she wants to add a new student into the system e Administrator types in the user name for the new student and choose a class in the drop down list in the pop up panel e Administrator clicks add button to confirm adding a new student or clicks cancel button to cancel adding this student e Administrator picks a student in the student table and clicks on delete this student button on the control panel if he she wants to delete a student from the system e Administrat
36. ent grade and comment e Logout Click on the logout button in navigation bar in dashboard page Administrator e Login 1 Type in URL http servername 8080 pams in address bar of browser then hit enter button 51 2 Inlogin page type in user name and password correctly and then click on login button Dashboard Dashboard contains a horizontal navigation bar a panel which is composed by five tab panels submission grade student assignment and course and an operation panel View data You can view all the submissions grades student information assignment details and course information by simply clicking on corresponding tab names in the center panel of dashboard Setup the system Before every semester setting up system is required There are steps 1 2 Click on set up button in navigation bar in dashboard page Input class information including class name instructor full credit for this class semester section number and then click on next button Manually add students information to system database by providing student s user name recommend email address and class id Click on more button to add another student click on done button to finish setup There is another way to add students information you can create a plain text file which contains student s user name and class id then name it student txt and save the file to student folder in PAMS directory C pams student The form
37. etExternalContext getSessionMap return sessionMap public void forwardToLoginIfNotLoggedIn ComponentSystemEvent cse FacesContext fc FacesContext getCurrentInstance String viewId fc getViewRoot getViewlId if lisUserLoggedIn if not loggedin back to the login page fc getApplication getNavigationHandler handleNavigation fc null hndex faces redirect true public boolean isUserLoggedIn return getSessionMap containsKey currentUser SubmissionController java package com pz controller import com pz persistence Userinfo import com pz sessionbean UserinfoFacade import java util Map import javax ejb EJB 73 import javax faces bean ManagedBean import javax faces bean ManagedProperty import javax faces bean RequestScoped import javax faces context FacesContext import javax faces application FacesMessage ek author Peng ManagedBean RequestScoped public class SubmissionController EJB com pz sessionbean UserinfoFacade ejbFacade private String id private Userinfo currentUser private String fname private String Iname Creates a new instance of SubmissionController public SubmissionController private UserinfoFacade getFacade return ejbFacade public String getId Map lt String Object sessionMap FacesContext getCurrentInstance getExternalContext getSessionMap id sessionMap get id toString
38. gt lt br gt lt br gt lt ice form gt lt h body gt lt html gt submission xhtml lt xml version 1 0 encoding UTF 8 gt lt Document submission Created on Jan 21 2011 12 07 32 AM Author Peng gt lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Transitional EN http www w3 org TR xhtml1 DTD xhtmll transitional dtd gt lt html xmins http www w3 org 1999 xhtml xmins ui http java sun com jsf facelets xmlns f http java sun com jsf core xmins h http java sun com jsf html xmins icecore http www icefaces org icefaces core xmins ace http www icefaces org icefaces components xmins ice http www icesoft com icefaces component gt lt h head gt lt title gt Sacramento State Computer Science lt title gt lt link rel stylesheet type text css href xmlhttp css rime rime css gt lt style type text css gt body background image url resources pic icecrystal jpg lt style gt lt h head gt lt h body gt lt ice form gt lt ice outputLabel value submissionController fname gt lt ice outputLabel value submissionController Iname gt lt hr gt lt ice menuBar orientation horizontal gt 57 lt ice menultem valuez Profile lt ice menultem valuez View link profile xhtml gt lt ice menultem gt lt ice menultem value Submission gt lt ice menultem value Submit action submissionController goSubmit gt lt ice menultem
39. h test case that set up by administrator After that PAMS updates the score table 42 o Next step is that PAMS check the assignment submission date it deducts the points that set up by administrator from the grade that student gets in score table if the assignment is overdue o Atlast PAMS would submit the score table to database to make the changes permanently 4 7 Tools for Design and Implementation e Netbeans 6 9 1 15 Netbeans is an Integrated Development Environment for developing Java PHP Ruby and other projects 16 e MySQL 5 MySQL is an open source relational database management system 17 e ICEfaces plugin for Netbeans ICEfaces is an open source Ajax framework for Java EE application which can create server based rich Internet application 43 Chapter 5 PERFORMANCE EVALUATION PAMS was used for CSc 139 during spring 2011 the system was running fine for both students and administrator however some bugs was found during test run First assignment is requiring students to write a multi processed C program for matrix multiplication The command for compiling this program is gcc progl c o progl Sample code for this command in PAMS compileFile gcc C temp subDir fileName o C temp on subDir fileName substring 0 fileName indexOf parameter n exit n Usually directory C temp is default directory for storing submissions Because each student has hi
40. hod called forwardToLoginIfNotLoggedIn in authentication managed bean 46 public void forwardToLoginIfNotLoggedIn ComponentS ystemEvent cse FacesContext fc FacesContext getCurrentInstance String viewId fc getViewRoot getViewlId if lisUserLoggedIn if not loggedin back to the login page fc getApplication getNavigationHandler handleNavigation fc null hndex faces redirect true e Problem 5 Browser compatibility issue PAMS has issues of rendering UI Components on Microsoft Internet Explorer Solution There is no solution for this problem right now probably next version of ICEfaces framework could perfectly work with Microsoft Internet Explorer 47 Chapter 6 CONCLUSION Since we can barely find a tool that satisfies the requirement of grading C program assignments automatically and managing student information PAMS is the best choice for instructors who assign C programming assignments additionally because of the intuitive interface that PAMS provides students do not feel strange or uncomfortable when they are using PAMS PAMS could dramatically improve the efficiency of grading a programming assignment written in C so that instructors do not have to spend a lot of time to grade same programming assignment repeatedly Also PAMS is a good system for managing student information including his her grades name and email address To compete with other teaching tools PAMS is designed to be a
41. ht fullcredit configname configcontent description atype other description Figure 1 Entity relationship Diagram 3 5 Use Case Model 3 5 Use Case Diagram PAMS View student information Adi Add new student Manage student Delete student from system Management Set up assignment assignment Edit assignment information uses Delete assignment Manage grades Administrator Update grades Store grading View all grades D result Management submission View all submission history uses Submit assignment Delete submission record uses ZN Check grade Student View assignment list Check submission history Figure 2 Use Case Diagram 10 3 5 2 Typical Flow Scenario of the System 3 5 2 1 3 5 22 3 5 2 3 Use Case Students Submit Assignments Student log into the system by providing his her user name and password Student clicks on the submit button on navigation bar in panel page Student is redirected to an assignment list page which lists all the available assignments Student picks an appropriate assignment by clicking the assignment name on the list Student is redirected to upload page in which he she could choose a file on his her local machine Student is able to see the details of his her submitted file after he she clicks submit button in upload page Student could choose to go ba
42. icImage url xmlhttp css xp css images arrow previous gif style border none title Previous Page gt lt f facet gt lt f facet name next gt lt ice graphicImage urlz xmlhttp css xp css images arrow next gif style border none title Next Page gt lt f facet gt lt f facet name fastforward gt lt ice graphicImage url xmlhttp css xp css images arrow ff gif style border none title Fast Forward gt lt f facet gt lt f facet name fastrewind gt lt ice graphicImage url xmlhttp css xp css images arrow fr gif style border none title Fast Backwards gt lt f facet gt lt ice dataPaginator gt lt ice panelTab gt lt ice panelTab label Assignments gt lt ice dataTable value viewAssignment assignmentList var assignment gt lt ice rowSelector gt lt ice column gt lt f facet name header gt lt ice outputText value Assignment No gt lt f facet gt lt ice outputText value assignment aid gt lt ice column gt lt ice column gt lt lt ice rowSelector value selectionListener gt gt lt f facet name header gt lt ice outputText valuez Assignment Name gt lt f facet gt n multiple false 66 lt ice outputText value assignment aname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Assignment Type gt lt f facet gt lt ice outputText value assignmen
43. ile event getSelectedRows System out printIn selectedFile get 0 getFname this fileName selectedFile get 0 getFname ViewAssignment java package com pz managedbean import com pz persistence Assignment import com pz sessionbean AssignmentFacade import java util List import javax ejb EJB import javax faces bean ManagedBean import javax faces bean RequestScoped import javax faces model ListDataModel pee author Peng ManagedBean RequestScoped public class ViewAssignment EJB private com pz sessionbean AssignmentFacade ejbFacade private ListDataModel lt Assignment gt assignmentList private List lt Assignment gt result Creates a new instance of ViewAssignment public ViewAssignment private AssignmentFacade getFacade 80 return ejbFacade public ListDataModel lt Assignment gt getAssignmentList result getFacade findAllQ assignmentList new ListDataModel result return assignmentList public void setAssignmentList ListDataModel lt Assignment gt assignmentList this assignmentList assignmentList public List lt Assignment gt getResult return result public void setResult List lt Assignment gt result this result result ViewClass java package com pz managedbean import com pz persistence Course import com pz sessionbean CourseFacade import java util List import javax ejb EJB import java
44. indow C programs can be compiled by GCC within Cygwin figure 15 shows the command of calling gcc in Cygwin figure 16 shows the compiled file in Windows Explorer cd johndoe gmail com gcc progi c o progi Figure 16 Call GCC in Cygwin progl 2 15 2011837PM CFile 3 KB progl 4 26 2011 4 53 PM Application 16 KB Figure 17 Compiled file in Windows Explorer So far multi processed C program multi threaded C program and C program using semaphores and pthread are tested fine in Cygwin environment however GCC in Cygwin has some problems occasionally a few compiled files run with errors in Windows but they run totally fine on Unix Linux after they were compiled by GCC in Unix Linux Methods for calling GCC in Grading logic 40 public void runProcess String subDir String fileName try Process p null Runtime rt Runtime getRuntime String lunchCygwin cmd exe c C cygwin Cygwin bat String compileFile null p rt exec lunchCygwin compileFile gcc C temp subDir fileName o C temp subDir fileName sul out new StreamPipe new InputStreamReader p getInputStream new OutputStreamWriter System out err new StreamPipe new InputStreamReader p getErrorStream new OutputStreamWriter System err in new StreamPipe new InputStreamReader new ByteArrayInputStream compileFile getBytes new Ou outThd start errThd start inThd start
45. ing an ICEfaces application is e Put UI Components on the page For example ice inputText valuesz s model data gt e Write corresponding managed bean For example ManagedBean Annotation for managed bean RequestScoped Define scope of this bean could be session scope or others public class model private String data The field holds data from client s request Getter and Setter for field data public void logic put logic here j e Add validator for components For example lt f validator validatorld dataValidator gt e The JSF controller which is FacesServlet will take care of the rest So when students fill in the input box which is rendered by inputText UI Component the input data will be kept in String variable data in managed bean after he she submits the form Then the logic that defined in the method logic in managed bean will be executed after the JSF validates the data Ultimately students will see the changes or redirection on the page base on the logic method and data he she inputs 31 4 5 2 Model and View Design and Implementation The JavaServer Faces framework already provides a powerful controller FacesServlet for us so we do not need to do anything about controller design and implementation However the models and views still need to be done by ourselves Login page is the first thing to take into consideration whoever uses PAMS should be authenticated and redirected to ap
46. lt Userinfo gt PersistenceContext unitName PrayingMantisPU private EntityManager em protected EntityManager getEntityManager return em public UserinfoFacade 28 29 super Userinfo class 4 5 Web Tier Design and Implementation 4 5 1 Description of Web Tier Web tier provides graphical user interface this project uses ICEfaces Framework as web tier ICEfaces framework is an extension to the standard JavaServer Faces framework and it provides rich Internet application The standard JavaServer Faces framework has MVC architecture the JSF web pages are view which presents a UI to the user the JSF managed beans are model which contains business logic or non UI code and FacesServlet plays role of controller which handles the user s request and dispatches the appropriate view A JSF framework processes user s request in six phases 14 restore view apply request values process validations update model values invoke application and render response e Restore view Creates server side component trees to represent UI information from a client e Apply request values Updates the server side components with the data retrieved from client e Process validations Validates the data such as Email format length of input data e Update model values Update server side models e Invoke application Runs logic for the request e Render response Renders a response to client 30 Therefore the way of design
47. ment implements Serializable private static final long serialVersionUID 1L Id Basic optional false Column name aid Column aid private String aid Mapped variable 17 Column name aname Column aname private String aname Column name duedate Column duedate Temporal TemporalType DATE private Date duedate Column name cutoffdate Column cutoffdate Temporal TemporalType DATE private Date curoffdate Column name weight Column weight private String weight Column name fullcredit Column fullcredit private String fullcredit Column name atype Column atype private String atype Column name other Column other private String other Column name description Column description private String description OneToMany mappedBy assignment Cardinality private Collection lt Record gt recordCollection JoinColumn name cid referencedColumnName cid ManyToOne private Course course 18 public Assignment Getters and Setters For variables Columns Persistence class for table course Entity Table name course public class Course implements Serializable private static final long serialVersionUID 1L Id Basic optional false Column name cid private String cid Map column cid Column name cname private String cname Map column cname Column name inst
48. nfo currentUser private List lt Fileinfo gt selectedFile private String fileName Creates a new instance of ViewUpload public ViewUpload 78 private FileinfoFacade getFacade return ejbFacade public Userinfo getCurrentUser return currentUser public void setCurrentUser Userinfo currentUser this currentUser currentUser public String getFileName return fileName public void setFileName String fileName this fileName fileName public List lt Fileinfo gt getSelectedFile return selectedFile public void setSelectedFile List lt Fileinfo gt selectedFile this selectedFile selectedFile public List lt Fileinfo gt getAllList allList ejbFacade findAll return allList public void setAllList List Fileinfo allList this allList allList public List lt Fileinfo gt getResult Map lt String Object sessionMap FacesContext getCurrentInstance getExternalContext getSessionMap 79 currentUser Userinfo sessionMap get currentUser this result em createQuery select f from Fileinfo f where f userinfo user setParameter user this currentUser getResultList System out printin sid return result public void setResult List lt Fileinfo gt result this result result public void rowSelectionListener RowSelectorEvent event System out println selected this selectedF
49. nistrator and student Administrator could set up the system update or delete an assignment view student s information and start grading process Student could submit programming assignment view submission history and check grades 3 1 2 Functional Requirements 3 1 2 1 Administrator Functional Requirements e Administrator has ability to add or delete a student e Administrator has ability to add or delete an assignment o Set the due date and cutoff date for an assignment o Name the assignment o Set weight of assignment o Define test cases and their corresponding result e Administrator has ability to check and edit the grading result of system e Administrator has ability to view all the submission details e Administrator has ability to start a grading process 3 1 2 2 Student Functional Requirements e Student can upload his her source code to the system drop box o View the list of assignment o View the due date and cutoff date of the assignment o Submit the source code e Student can check his her submission history e Student can check the grade for each assignment 3 2 Specific Requirements 3 2 1 Interface Requirement 3 2 1 1 Browser PAMS requires JavaScript enabled web browser including Mozilla Firefox Google Chrome and Apple Safari 3 2 1 2 Hardware Interface PAMS requires a computer accessed to the ECS network domain 3 2 1 3 Communication Interface PAMS server communicate with the client thro
50. ntroller import com pz persistence Userinfo import com pz sessionbean UserinfoFacade import java util Map import javax ejb EJB import javax faces application FacesMessage import javax faces bean ManagedBean import javax faces bean RequestScoped import javax faces context FacesContext ek author Peng ManagedBean RequestScoped public class UserinfoController EJB private com pz sessionbean UserinfoFacade ejbFacade private String id private String password private Userinfo current private String message private Map lt String Object gt sessionMap Creates a new instance of UserinfoController public UserinfoController public String getId return id public void setId String id this id id public String getPassword return password 76 public void setPassword String password this password password public String getMessage return message public void setMessage String message this message message public Map lt String Object gt getSessionMap FacesContext context FacesContext getCurrentInstance sessionMap context getExternalContext getSessionMap return sessionMap public void setSessionMap Map lt String Object gt sessionMap this sessionMap sessionMap private UserinfoFacade getFacade return ejbFacade public Userinfo getCurrent return current
51. oject EJB provides transaction processing for upper tier which is web tier 4 4 2 Design EJB Classes EJB container has three types of session bean they are stateful session bean 11 stateless session bean 12 and singleton session bean 13 In this project only stateless session beans are used due to the fact that there is no need to keep a state during session Because there are six stateless session beans and each of them controls transaction processing of corresponding entity furthermore they share some functions such as create edit remove and find so we could take advantage of inheritance in Java writing a parent class which contains all the common methods 25 4 4 3 Implement EJB e Parent Class public abstract class AbstractFacade lt T gt private Class lt T gt entityClass public AbstractFacade Class lt T gt entityClass this entityClass entityClass j protected abstract EntityManager getEntityManager public void create T entity getEntityManager persist entity public void edit T entity getEntity Manager merge entity public void remove T entity getEntity Manager remove getEntity Manager merge entity public T find Object id return getEntityManager find entityClass id e Assignment stateless session bean Stateless public class AssignmentFacade extends AbstractFacade lt Assignment gt PersistenceContext unitName PrayingMantis
52. on S o Course progl D AE i 3 i 100 correct Incorrect result progl E 50 three days late prog A 100 correct prog ey PR n bo 100 correct No file found progl progl mo a 100 correct 0 No file found progl a prog 1 D No file found pri Reminder om Sticky notes ak 0 No file found Y 1 Assignment 3 due date Only Add an assignment is 3 29 available now 2 Grade assignment 3 after break Figure 7 View Grades User Interface for students should provide the functions of submitting source code and checking grades According to the system constraints student is not allowed to do anything unless he she updates his her profile we add profile checking function to student interface Student has to update his her default password which was set by system and provides his her actual name before he she uses any function of PAMS Here we make use of session map to check student s identity and attach student information to the submitted file 35 Profile Submission Check Grades Logout Please update your profile if you dont see your name on the page e Please dont forget to log out Please update you profile first Figure 8 Student Dashboard Profile Submission Check Grades Logout User Name johndoe gmail com First Name Last Name Course csc1391 Update Figure 9 Student Profile Page 36 john doe Profile Submission Check Grade
53. ong serialVersionUID 1L Id Basic optional false Column name id private String id Basic optional false Column name password private String password Basic optional false Column name roletype private String roletype Basic optional false Column name cid private String cid Column name fname private String fname Column name Iname private String Iname Column name gender private String gender Column name degree private String degree Column name credit private Integer credit OneToMany mappedBy userinfo 23 Map column id Map column password Map column roletype Map column cid Map column fname Map column Iname Map column gender Map column credit private Collection lt Record gt recordCollection One student has multiple records OneToMany mappedBy userinfo 24 private Collection lt Fileinfo gt fileinfoCollection One student submits multiple files public Userinfo Getters and Setters Here we already finished designing persistence tier and those persistence entities are ready for being called by upper tier as long as the appropriate JDBC driver was set up successfully 4 4 Enterprise JavaBean Tier Design and Implementation 4 4 1 Objectives of Using EJB The EJB specification intends to provide a standard way to implement the back end business In this pr
54. or confirms deleting selected student by clicking confirm button in the pop up panel or he she cancels deleting selected student by clicking cancel button in the pop up panel 3 5 2 4 Use Case Administrator Sets up System e Administrator clicks on set up button on navigation bar in dashboard page e Administrator types in information of the course and then hits the button next e Administrator adds assignments of this course and then hits the button done to finish 3 5 2 5 Use Case System Grades Assignments e Administrator clicks on grade assignment button on navigation bar in dashboard page e Administrator is redirected to grading page e Administrator types in test cases and their corresponding correct result e Administrator clicks the start grading button on the page e After the grading process is finished administrator can see grades under grades tab on the dashboard page 12 Chapter 4 DESIGN AND IMPLEMENTATION 4 System Overview Figure 3 shows the structure of PAMS Web Tier EJB Tier Compiler Figure 3 Structure of PAMS PAMS has four tiers and one grading logic module e Data tier Database which keeps all the required data e Persistence tier Persistence entities which are mapped from database relations e FJB tier EJBs which takes care of database transaction processing e Web tier Web pages and managed beans which provides rich Internet applications e Grading logic Classes
55. ownloads temp temp zelduck gmail com prog3 c o C Users P eng Downloads temp temp zelduckfgmail com out lpthread Lposix4 cygwin warning MS DOS style path detected C Users Peng Downloads temp temp zelduckfgmail com prog3 c Preferred POSIX equivalent is cygdrive c Users Peng Downloads temp temp zelduckfgmail com prog3 c CYGWIN environment variable option nodosfilewarning turns off this warning Consult the user s guide for more details about POSIX paths http cygwin com cygwin ug net using html using pathnames 10 32mPengfPeng Thinkpad 33m Om exit logout 10 32mPeng Peng Thinkpad 33m Om gcc C Users Peng Downloads temp temp zs926saclink csus edu prog3 c o C Use rs Peng Downloads temp temp zs92fsaclink csus edu out lpthread Lposix4 cygwin warning MS DOS style path detected C Users Peng Downloads temp temp zs92 6saclink csus edu prog3 c Preferred POSIX equivalent is cygdrive c Users Peng Downloads temp temp zs92fsaclink csus edu prog3 c CYGWIN environment variable option nodosfilewarning turns off this warning Consult the user s guide for more details about POSIX paths http cygwin com cygwin ug net using html using pathnames 10 I32mPena amp Pena Thinkpad 33m Om Figure 20 Contents in log during compilation Second assignment is writing a multi threaded C program to do matrix multiplication using pthread therefore instructor have to specify the parameter Ipthread in compile command PAMS could
56. propriate pages We also want to maintain a session map in memory to keep track of user s identity and activities Login User Name Password login Figure 4 Login Box This is the login box for PAMS user only need providing his her user name and password to log into the system The Userinfo table has an attribute called roletype which ensures the role of user so he she could be redirected to appropriate pages For creating a session map we could write a method to return a session map object public Map lt String Object getSessionMap FacesContext context 2 FacesContext getCurrentInstance sessionMap context getExternalContext getSessionMap 32 return sessionMap When user hits the login button managed bean puts his her user name and a mapped object of userinfo entity to the session map Administrator and student should have different main pages since they have different requirements of using PAMS Set up Database Grading Statistic Logout Submission Grades Students Assignments Courses Operations Student Add a student Edit student information Delete a student File Name File Size Submission Timestamp Student Student First Hame Student Last Name 6 Grade Drog 3KB 02 12 2011 jshaltesi gmail com Josh Shaltes Edit a record proj1 c 4KB 02 13 2011 discostewsm gmail com Stuart McAllister o Assignment progl c 4KB 02 14 2011 ejonssonBB gmail com Eric Jons
57. result of Google I can barely find some systems or tools which can provide same functions as PAMS does Currently SacCT 1 provides the functions of managing student information collecting submissions and publishing grades however it lacks grading function Instructors have to manually download all the submissions organize these source files before starting compiling them and then type in the grades on SacCT after testing finished There is another assignment grading system called WASG 2 done by Palnitkar Rahul in 2003 however there are still some deficiencies in WASG it does not provide function of managing grades it still needs instructor or grader to manually assign grades because it cannot check results of compiled file also it requires a file server and a grading server which could cause some availability issues 1 2 Scope of PAMS PAMS provides simple intuitive and user friendly interface for students and instructor current version of PAMS could accept all kinds of programming assignments but it only can grade C programs right now PAMS allows students to e Submit programming assignments written in C e View submission history e Check grades PAMS allows instructor to e Manage student account e Choose manually or automatically grade assignment e Set up assignment information including assignment name due date weight and cutoff date e View and edit all grades In order to help instructors in grading
58. ructor private String instructor Map column instructor Column name grader private String grader Map column grader Column name totalcredit private String totalcredit Map column totalcredit 19 Column name semester private String semester Map column semester Column name section private String section Map column section OneToMany mappedBy course private Collection lt Assignment gt assignmentCollection public Course Getters and Setters Persistence class for table fileinfo Entity Table name fileinfo public class Fileinfo implements Serializable private static final long serialVersionUID 1L Id GeneratedValue strategy GenerationType IDENTITY Basic optional false Column name fid private Integer fid Map column fid Basic optional false 20 Column name fname private String fname Map column fname Basic optional false Column name fsize private String fsize Map column fsize Basic optional false Column name fts Temporal TemporalType DATE private Date fts Map column fts JoinColumn name sid referencedColumnName id ManyToOne private Userinfo userinfo public Fileinfo Getters and Setters Persistence class for table record Entity Table name record public class Record implements Serializable private static fin
59. s Logout Assignment List Click assignment name to submission page Assignment 1 Assignment 2 Assignment 3 Figure 10 Assignment List Page john doe Profile Submission Check Grades Logout Assignment 2 Please submit correct file in required format e You can resubmit your file before due date e Make sure your resubmitted file has the SAME file name as the first one has e Any problem such as cannot submit file please email instructor ASAP Check the submitted files under Submission gt View e You are responsible for the files that you have submitted Choose a file Figure 11 Submission Page 37 Programming assignment submission Y our file name is helloworld c Size IKB Thank you very much Panel Assignment List Submit Another File Check Submitted Files Figure 12 Submission Finished john doe Profile Submission Check Grades Logout File Name File Size Submitted Date helloworld c 1KB 04 24 2011 Figure 13 Submission History john doe Profile Submission Check Grades Logout Assignment Grade Out of 100 Comments prog 100 Correct Figure 14 Students Check Grades 38 4 6 Grading Logic Figure 15 is the flow chart for grading process Commi it Figure 15 Grading Process Flow Diagram 39 There are several procedures we need to consider before actually grading the programs GCC in Windows Because we have Cygwin a Unix Linux like environment in W
60. s her own folder in this directory subDir is the folder name which is student s email address in PAMS The variable fileName stands for the name of source code instructor specifies the name of source code for each assignment for example progl c is the file name for assignment 1 The variable parameter is the parameter that used in compilation when there is required special library function For example if an assignment requires using Posix thread the command should include Ipthread as parameter Figure 20 shows the some contents of the log file generated by PAMS during the compilation 44 32mPengfPeng Thinkpad 33m Om exit logout 10 32mPeng Peng Thinkpad 33m Om gcc C Users Peng Downloads temp temp violentafecs csus edu prog3 c o C Use rs Peng Downloads temp temp violentafecs csus edu out lpthread Lposix4 cygwin warning MS DOS style path detected C Users Peng Downloads temp temp violenta ecs csus edu prog3 c Preferred POSIX equivalent is cygdrive c Users Peng Downloads temp temp violenta ecs csus edu prog3 c CYGWIN environment variable option nodosfilewarning turns off this warning Consult the user s guide for more details about POSIX paths http cygwin com cygwin ug net using htmlfusing pathnames gcc C Users Peng Downloads temp temp violentafecs csus edu prog3 c No such file or directory 10 32mPeng Peng Thinkpad 33m Om exit logout 10 32mPengfPeng Thinkpad 33m Om gcc C Users Peng D
61. son O Course Progl c 5KB 02 14 2011 lgallarzo comcast net Luis Gallarzo pal c 6KB 02 14 2011 pakz5 yahoo com Francisco Ramirez 02 14 2011 Jason Landsborough JAL_prog1 c landsboj ecs csus edu main c 4KB 02 14 2011 Shadowfox 79 gmail com Peter Tucker progl c AER 02 14 2011 berryw ecs csus edu William Berry progl c 3KB 02 14 2011 chrisaughB2m yahoo com Chris Aughinbaugh ac 5KB 02 15 2011 gainford87 gmail com Trevor Gainford ae amp gt S 4 ee ap Reminder Sticky notes Only Add an assignment is available now 1 Assignment 3 due date 3 29 2 Grade assignment 3 after break Figure 5 Administrator Dashboard Base on the requirement analysis of administrator the dashboard for administrator provides these functions e View submission grades student information assignments and courses 33 Edit grades assignment information and course information Add a new user or delete a user Start grading process and set up test cases Add a student User name Class ID csci39 sl Add Cancel Figure 6 Add Student Function 34 Setup Database Grading Statistic Logout Submission o Grades Students Assignments Courses WE Student Add a student Assignment 1 y Delete a student O Grade Assignment User Name First Name Last Hame Comment Edit a record prog 100 correct al Assi nt prog uy 1 25 100 correct Qe
62. submission check grades and logout Above the navigation bar your name should appear here if you updated your profile before e Update profile If you do not see your name appears on the top of the dashboard page please follow these steps to update profile 1 Point to the Profile button in the navigation bar and click on view button 2 You could see your user name first name last name and course number on your profile page click on update button 3 You can choose to change your password and you have to type in your first name and last name in corresponding text box then hit the confirm button system will redirect you to the login page 50 4 Loginto the system e Submit assignment 1 Hover mouse cursor on the submission button in navigation bar and then click on submit 2 Inthe assignment list page choose an appropriate assignment by clicking the assignment name 3 Inthe submission page click on Browse button and then choose a file from local machine click submit button to submit this file 4 You could see file name and size of your submitted file 1f the file was submitted successfully You can choose to go back to dashboard check assignment list submit another file for this assignment and check submission history by clicking the hyperlinks provided on the page e Check grades 1 In dashboard page click on the check grades button in navigation bar 2 You can see a grades table with table headers assignm
63. t atype gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Due Date gt lt f facet gt lt ice outputText value assignment duedate gt lt f convertDateTime type date dateStyle default gt lt ice outputText gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Cutoff Date gt lt f facet gt lt ice outputText value assignment curoffdate gt lt f convertDateTime type date dateStyle default gt lt ice outputText gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Weight gt lt f facet gt lt ice outputText value assignment weight gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Full Credit gt lt f facet gt lt ice outputText value assignment fullcredit gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Description gt lt f facet gt lt ice outputText value assignment description gt lt ice column gt lt ice dataTable gt lt ice panelTab gt lt ice panelTab label Courses gt ice dataTable value viewClass courseList var class gt lt ice rowSelector gt lt ice column gt 67 n lt lt ice rowSelector value selectionListener gt gt lt f facet name header gt lt ice outputTex
64. t ice outputText value Class ID gt lt ice selectOneMenu id cl_id value viewStudent classId gt lt f selectltems value viewStudent courseList gt lt ice selectOneMenu gt lt h message for cl_id style color red gt lt ice outputText gt lt ice commandButton value Add action viewStudent addStudentConfirm gt 70 lt ice commandButton value Cancel action viewStudent addStudentCancel gt lt ice panelGrid gt lt f facet gt lt ice panelPopup gt lt ice form gt lt ice form gt lt ice panelPopup id op_st modal true rendered true visible viewStudent showPanelOp draggable false style z index 1000 top 30 left 5 position absolute width 380px height 200px gt lt f facet name header gt lt ice panelGrid width 380px cellpadding 0 cellspacing 0 columns 2 style text align center gt lt ice outputText style color black value Edit Student Info gt lt ice panelGrid gt lt f facet gt lt f facet name body gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 3 gt lt ice outputText value User Id gt lt ice outputText value viewStudent selectedUser id gt lt ice outputText gt lt ice outputText value User Password gt lt ice inputText value viewStudent newPassword gt lt ice outputText gt lt ice outputText value Class gt ice selectOneMenu value viewStudent classId 7 lt
65. t value Course Name gt lt f facet gt lt ice outputText value class cname gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Grader gt lt f facet gt lt ice outputText value class grader gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Points gt lt f facet gt lt ice outputText value class totalcredit gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Semester gt lt f facet gt lt ice outputText value class semester gt lt ice column gt lt ice column gt lt f facet name header gt lt ice outputText value Section gt lt f facet gt lt ice outputText value class session gt lt ice column gt lt ice dataTable gt lt ice panelTab gt lt ice panelTabSet gt lt f facet gt lt f facet name east gt lt ice panelGrid width 200 gt lt f facet name header gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 2 style text align center background color cccccc gt lt ice outputLabel value Operations gt lt ice panelGrid gt lt f facet gt multiple false lt ice panelGroup menuPopup menu_selection gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 1 gt lt ice panelCollapsible expanded true gt 68 lt f facet namez header lt ice p
66. tputText value Course gt lt ice panelGroup gt 69 lt f facet gt lt ice panelGroup gt lt h link outcome index xhtml value Edit course information gt lt br gt lt ice panelGroup gt lt ice panelCollapsible gt lt ice panelGrid gt lt ice panelGroup gt lt ice panelGrid gt lt f facet gt lt ice panelBorder gt lt ice panelGrid gt lt ice menuPopup id menu_selection gt lt ice menultem value Delete gt lt ice menultem value Edit gt lt ice menuPopup gt lt ice form gt lt Popup panel for database operations gt lt ice form gt lt ice panelPopup id add_st modal true rendered true visible viewStudent showPanelAdd draggable false style z index 1000 top 30 left 5 position absolute width 380px height 130px gt lt f facet name header gt lt ice panelGrid width 380px cellpadding 0 cellspacing 0 columns 2 style text align center gt lt ice outputText style color black value Add a student gt lt ice panelGrid gt lt f facet gt lt f facet name body gt lt ice panelGrid width 100 cellpadding 0 cellspacing 0 columns 3 gt lt ice outputText value User name gt lt ice inputText id st_name value viewStudent userName gt lt f validator validatorld com pz validator email Validator gt lt f ajax execute Othis event blur gt lt ice inputText gt h message for st_name style color red gt l
67. ugh HTTP protocols 3 2 2 Non functional Requirements e Usability The user interface should be intuitive for both administrator and students e Availability The system should be available all the time e Fault tolerance The system should tolerate some small runtime error without crushing e Security The system should provide secure service for both administrator and students o System archives all the submitted source code every two weeks o System backup database by using database dump o System prevents unauthorized access o System ensures session expired after certain idle time 3 3 System Constraints System only accepts submission before cutoff date for each assignment For security purpose system doesn t allow student who haven t updated his her profile to submit assignment or check grades System doesn t allow administrator to set up an assignment with an inappropriate weight that makes the sum of weight of all the assignments exceed one hundred percent 3 4 Data Model Diagram Fileinfo Course PK fid PK cid fname PO SH cname 1 instructor fsize submit is of d fts 1 grader FK2 sid totalcredit semester e session Userinfo PK id pwd roletype cid fname Iname AC has isof gender degree credit FH has is of O4 has is of O Assignment Sysconfig configid aname duedate cutoffdate cid weig
68. valuez View action submissionController go View gt lt ice menultem gt lt ice menultem value Check Grades link viewGrade xhtml gt lt ice menultem gt lt ice menultem value Logout action submissionController logout gt lt ice menultem gt lt ice menuBar gt lt br gt lt br gt lt br gt lt ice form gt lt h2 gt redirectSubmission subName lt h2 gt lt h3 gt Please submit correct file in required format lt h3 gt lt ul gt li You can resubmit your file before due date lt li gt li Make sure your resubmitted file has the SAME file name as the first one has li li Any problem such as cannot submit file please email instructor ASAP lt li gt lt li gt Check the submitted files under Submission gt View lt li gt li You are responsible for the files that you have submitted lt li gt lt ul gt lt form name upload enctype multipart form data method post action pams Upload gt Choose a file lt input type file name in_file size 40 gt lt br gt lt input type submit value submit gt lt br gt lt br gt lt br gt lt br gt lt h link value Back outcome assignmentList xhtml gt lt form gt lt h body gt lt html gt profile xhtml lt xml version 1 0 encoding UTF 8 gt lt Document profile Created on Feb 8 2011 11 34 56 PM Author Peng gt lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Transitional EN http www
69. velopers so that developers only need to develop an application located on server instead of developing a server side application and a client side application Besides these web based application is easy to update because it centralize data and code on the server PAMS runs on Java EE 4 platform which provides multi tier and modularized software in Java programming language The system contains several tiers which are web tier business logic tier persistence tier and data tier Application server is GlassFish 5 and Database is MySQL e Web tier uses JavaServer Faces 6 technology JavaServer Faces is a Java based web application framework using Model View Controller 7 architecture e Business logic tier uses Enterprise JavaBean technology 8 which is a server side model that encapsulates the business logic of an application Persistence tier uses Java Persistence API 9 which is is a Java programming language framework managing relational data in applications using Java Platform Data tier uses MySQL 10 database which is a relational database management system RDBMS that runs as a server providing multi user access to a number of databases Application server uses GlassFish which is an open source application server project led by Sun Microsystems for the Java EE platform Chapter 3 REQUIREMENT ANALYSIS 3 1 General Description 3 1 1 User Characteristics There are two types of users in this system including admi
70. w3 org TR xhtml1 DTD xhtmll transitional dtd gt lt html xmins http www w3 org 1999 xhtml xmins ui http java sun com jsf facelets xmlns f http java sun com jsf core 58 xmins h http java sun com jsf html xmlns icecore http www icefaces org icefaces core xmlns ace http www icefaces org icefaces components xmlns ice http www icesoft com icefaces component gt lt h head gt lt title gt Sacramento State Computer Science lt title gt lt link rel stylesheet type text css href xmlhttp css rime rime css gt lt style type text css gt body background image url resources pic icecrystal jpg lt style gt lt h head gt lt h body gt lt ice form gt lt ice outputLabel value submissionController fname gt lt ice outputLabel value submissionController Iname gt lt hr gt lt ice menuBar orientation horizontal gt lt ice menultem value Profile gt lt ice menultem valuez View link profile xhtml gt lt ice menultem gt lt ice menultem value Submission gt lt ice menultem value Submit action submissionController goSubmit gt lt ice menultem value View action submissionController go View gt lt ice menultem gt lt ice menultem value Check Grades link viewGrade xhtml gt lt ice menultem gt lt ice menultem value Logout action submissionController logout gt lt ice menultem gt lt ice menuBar gt lt br gt lt br
71. x faces bean ManagedBean import javax faces bean RequestScoped import javax faces model DataModel import javax faces model ListDataModel author Peng ManagedBean RequestScoped public class ViewClass EJB private com pz sessionbean CourseFacade ejbFacade private ListDataModel Course courseList private List lt Course gt result Creates a new instance of ViewClass 81 public ViewClass private CourseFacade getFacade return ejbFacade public ListDataModel Course getCourseList result getFacade findAllQ courseList new ListDataModel result return courseList public void setCourseList ListDataModel lt Course gt courseList this courseList courseList public List lt Course gt getResult return result public void setResult List lt Course gt result this result result RunApp java package com pz logic import java io BufferedReader import java io IOException import java io InputStream import java io InputStreamReader author Peng public class RunApp public String result null public String runApplication String fileDir String fileName String parameter throws IOException InterruptedException Process p null String result null String command C TEMP fileDir W fileName parameter n String sid fileName substring 0 fileName indexOf try

Download Pdf Manuals

image

Related Search

Related Contents

Grundig GCM 1000  ¡Reproducción inmediata de un MD!  Revista Chef n1  2014年3月版カタログ(PDF形式、6835kバイト)  Preh Touch Commander (MC12T7)  TDS200, TDS1000, TDS2000, and TPS2000 Series Digital  Elo Touch Solution 2401LM  

Copyright © All rights reserved.
Failed to retrieve file