Project Report - noorthemes/Automated-Online-Programming-Contest-System GitHub Wiki

CHAPTER 1

INTRODUCTION

1.1 Introduction

For many years now, the International Collegiate Programming Contest (ICPC) has organized and conducted yearly world programming championships, under the patronage of Association for Computing Machinery (ACM), for college students. The main motivation behind such an organization is to provide students with an opportunity to demonstrate and sharpen their problem solving and computing skills.

During the contest, teams can submit solutions, in source code, to the given problems. The submissions are typically evaluated by a human judge and it involves compiling the program, running it with a set of predefined test inputs, comparing the results obtained with those expected in the test outputs, and then marking the submission against a marking scheme. A submission is marked as accepted only when it successfully passes all the test cases. Usually, there are maximum execution times associated with the tests, and therefore for a program to pass the tests successfully it must not only produce the correct results but also has to do so within the specified time limit. This ensures that the solutions produced by teams are reasonably efficient and not just a brute force approach . This project seeks to explore the current state of the applications used to automate online programming competitions and aims to establish an account of common trends. In this project, the available online programming systems are reviewed to present a holistic view of the framework that will facilitate development of the proposed system. The leads of such a framework will discuss the modules, scope and methodology of the entire system development   1.2 Problem Statement

One of the primary functions of an academic institution that teaches computer science must be to imbue all its students with the ability to program. After all, in order for anyone to claim to have knowledge of computer science, the ability to write a working program is a definite prerequisite and in order to master this programming, it is necessary to do lots of assignments and get involved in contests. Programming assignments and contests are notoriously difficult to manually grade in a fair and timely manner. Programs that appear to work on certain test cases may fail on others, and programs that are not entirely correct must still be graded on a relative scale based on several factors. Therefore, human graders generally have no choice but to strenuously examine each line of code in order to give a grade. Other problems run the range from human subjectivity and favoritism to the dependency of graders on ‘‘model’’ answers. In fact, the labor-intensiveness of grading programming contests is the main reason why academic organizations and institutions will not organize programming contests. 

This project presents a Web-based system, to handle programming contests. The system acts as a full contest manager as well as an automatic judge for programming contests. The System innovates in a number of aspects: it has a scalable architecture that can be used for small single server contests; it has automatic judging capabilities to assist human judges in the evaluation of programs and rank the contestants. It is an open system that can be implemented on the Linux and windows operating system using the Apache HTTP server and the PHP scripting language.   1.3 Objectives

Besides overcoming all the problems on the current techniques, these are the objectives that wish accomplish by the system:-

I. The main objective of this project is to create a tool to manage programming contest online. It will also serve as a community for programmers to share ideas. Unfortunately, programming is something that does not come naturally. Formal training is necessary if one wants to succeed and be able to contribute new ideas. Keeping this in mind, there will be forums and mock contest to build up the foundation of new users.

II. It will also serve as a platform to motivate and facilitate their learning process, contests are held at regular basis and the best contestants will receive medals and incentives this will sharpen the contestants' programming skills through some real-life computing practices.

  1.4 Scope 1.4.1 User Categories

The system has three cartegories of users, which are administrator, judges or supervisors and contestants. User access is controlled by authentication, except for the general public. A. Admin The administrators has full control overs the system. He is responsible for: • Adding, Updating and deleting accounts, • Adding, updating and deleting problems or questions to solve, • Adding or modifying programming languages to the system, • Set the contest time, etc. B. Contestant The system will allow contestants to interact with the supervisors during the contest through messages to request clarifications and to submit source programs for evaluation as intended solutions for problems; ask questions to the judges and access all feedback questions posed by contestants and corresponding answers given by the judges; access the list of all submissions and corresponding marks; access the current contest classification. C. Supervisor The supervisors can communicate with each contestant to answer their request, The supervisors can read the program codes sent by each contestant. The basic listings available to the supervisor show the submissions and questions. This view includes a submitting questions for the contest and also entering expected outputs for each question. The supervisor also has access to the contest progress.

  1.4.2 Modules And Functionalities

A. Manage user The user module allows users to register, log in, and log out. Users benefit from being able to sign on because this associates content they create with their account and allows various permissions to be set for their roles. The module also defines memberships and membership types.

B. Manage contest This module allows the administrator to add and remove contests, set score marks, time, and input data and answer data. C. Manage Judgment The system makes judgment based on minimum line of code, faster execution, and faster solving time. The contestants are graded and ranked according to these judgments. D. Manage report The Reports Module provides customized reporting according to your individual needs. Any number of reports can be defined by selecting from a range of search criteria and report fields. Report definitions can be saved to avoid repeating this task. Once the report definition is saved the report can be generated by providing the required criteria data. Features: • Ability to save reports • Assign reports to user groups • View employee contest reports • Print & export reports • Create and define specific reports

  E. Manage live Contest This includes everything from viewing questions, submitting answers, public discussion board feedbacks etc. The Module also allows easily administering of the system and also allows the contestants and supervisors to exchange ideas by posting comments.

1.4.3 Technical Aspects

The System was developed using diffirent web languages and technologies such as PHP (Lerdorf, 1995), CSS (Lie, 1994; McFarland, 2006), JavaScript (Eich, 2005; Goodman & Morrison, 2004). It uses MySQL relational database system (Widenius &Axmark, 1994; Schwartz, 2008) to store the information rather than plain files. It is then more flexible and easier to add modules. Connecting to contests is as easy as browsing web pages. All what contestat need is web address, login name and password. The system is focused on C, C++ and Java programming languages. The system is able to run each program code and finally provide a scoreboard that shows the results during the contest period. It is also Web-based and therefore all of its functionalities are accessible through interfaces deployed on a Web-browser, irrespective of the operating system where the browser is running.

  CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

A literature review is a body of text that aims to review the critical points of current knowledge on a particular topic. Most often associated with science-oriented literature, such as a thesis, the literature review usually precedes a research proposal, methodology and result section. 

2.2 Analysis/ Technique / Model / Current System

For many years now, the International Collegiate Programming Contest (ICPC) has organized and conducted yearly world programming championships, under the patronage of Association for Computing Machinery (ACM), for college students. This contest is a two-tiered competition among teams of students. Up to 60 of the winning teams of the regional contests advance to the world finals. The participation numbers are impressive: in 2001 there were more than 3000 teams, from 1150 universities, 70 countries, participating in 29 regional contests distributed among 94 locations. The main motivation behind such an organization is to provide students with an opportunity to demonstrate and sharpen their problem solving and computing skills.

Some systems have been developed to try and fulfill this purpose. PC2 is the system that has been used in recent world finals. It has capabilities for managing single and multi-site contests and since it has been developed in Java it can be run on either WINDOWS or UNIX operating systems. Serious programming competitions worldwide use this famous programming contest control system, PC2 developed at the California state university, Sacramento (CSUS, 2009). The PC2 system has many limitations and weakness, although it can e used in diffirent centers, it cannot be used behind firewalls. In particular, there must not be any firewalls which prohibit communication paths, the system will not operate if the TCP/IP paths are blocked (CSUS, 2009). Also with the PC2 system there is the need to install it in each client before it can be used by the client. Other systems have been developed elsewhere, namely at Ural State University and at Valladolid University were they have a 24 hour online automated judge that interacts with users through e-mail.

No Developer System Year Objective Method Finding

  1. California state university PC2 2002 Organize and manage international programming contests. Installed on each client machine The system has many limitations, it is restricted to only Linux platform and cannot be used behind firewalls
  2. Ural State University and Valladolid University Online Automated Judge 2009 Automate judgement process Web based The system is used in many applications. Ranging from contest systems to online learning systems.

2.2.1 Command Line for Automatic Compiler

Since June, 1 2006 the Java programming language is supported at Timus Online Judge. J2SE Development Kit (JDK) 7.0 Update 11 is used to compile and run solutions written in Java (JDK 6.0 was used before January, 18 2013; JDK 5.0 was used before February, 2 2009). You may download JDK and read online documentation on the official site.

Java programs are executed on the server with the following command line:

2.2.2 Examples of Automatic Judges

Other sites which implement the of Automatic judges system: • www.topcoder.comwww.spoj.comwww.codeforces.comwww.codechef.com • uva.onlinejudge.org http://www.acmsolver.org/?p=492 is an opensource online judge system which runs only on linux operating system.

2.2.3 Criteria for Ranking And Scoring

Contestants are ranked according to the most problems solved. For the purposes of awards, or in determining qualifier(s) for the next rounds, teams who solve the same number of problems are ranked by least total time. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the accepted run plus penalty minutes for every rejected run for that problem regardless of submittal time. There is no time consumed for a problem that is not solved.   2.3 Novelty

In Educational Institutions, considering the concerned of equipping students with adequate programming skills there has not been any project, which were able to fulfill the requirements for organizing programming contests online. So this project aims to contribute to the solution for achieving both the Online Compiler and Online Judge targets on one hand and on the other hand it helps to fulfill the aim of boosting students interest in programming by constantly organizing contests and awarding the best contestants.

Both the Online Compiler and the Online Judge technologies developed and implemented, will afford solutions for the problematic process of organizing and hosting programming contests.

A key aspect during the development of the technology is  to offer a new alternative for existing PC2 system, which must be hosted on each client machine and runs only on LINUX platform.

  2.3 Summary

This system was developed using diffirent web languages and technologies such as PHP(Lerdorf,1995), CSS(Lie, 1994; McFarland, 2006), Javascript (Eich, 2005; Goodman & Morrison, 2004). It also uses Mysql relational database system (Widenius & Axmark, 1994; Schwartz, 2008) to store its information. It is much flexible and easier use this system than PC2. Connecting to a contest is just as easy as browsing through web pages. All what a contestant needs is a web browser, login name and password and the url.

CHAPTER 3

METHODOLOGY

3.1 Introduction

In this chapter, the methodology that was used during the system development project is explained. The Spiral Model which was used for this project is made up of several processes and each process will be discussed according to this project. This chapter will explain in details every phase that was involve in this project development.

3.2 Justification for Methodology

The advantages of using the spiral model are varied: its design flexibility allows changes to be implemented at several stages of the project; the process of building up large systems in small segments makes it easier to do cost calculations; and the client, who will be involved in the development of each segment, retains control over the direction and implementation of the project. In addition, the client's knowledge of the project grows as the project grows, so that they can interface effectively with management.

3.3 Methodology Review

The disadvantage of the waterfall model is the advantage of the spiral model. It is a realistic model, which is often used in the development of large software. There is a systematic approach used in the spiral model, which is integrated into the iterative framework. This helps in ensuring there is no problems in the software. Since changes to the software can be made at any point of time in the software development process.

Figure 3.1: Spiral model

3.3.1	Development Phase	


The development phases discuss about the details of every phases in of the system according to Spiral model which are Planning, analysis, design development, implementation and testing.

  3.3.1.1 First Phase (Planning and Proposal Presentation)

The first essential step in developing the system is context analysis. In this phase, I try to elicit and understand the major objectives and corporate requirements of the system, gather information about the operational/application environment. Then, based on these needs, I decide on both the technical and non-technical requirements, which can be classified into broader requirements (such as what the system should do) and specific requirements (such as access control and performance). It also includes making a proposal for the project and presenting the proposal.

3.3.1.2	Second Phase (Module Development)

Based on the broader requirements and specific requirements, a Product Model, which shows how various components are linked together, to meet those requirements is developed. The product model should include the overall physical system architecture (the network and the various servers - web servers, application servers, database servers etc.), application architecture (a map of the various information modules and the functions available) and the software architecture (various software and database modules required to implement the application architecture).

Development of manage user module, manage contest module and manage judgment module are to be made during this phase. This will last for about three weeks and then succeeded by the third phase. 3.3.1.3 Third Phase (Module Development)

The third phase which will last for about two weeks involve creation of manage live contest module and manage report module. The manage live contest module entails all the functions that will be available on the system during a live contest whilst the manage report module takes care of all the other aspects of the system that can be accessed after a contest like viewing results, viewing participants and upcoming contests.

Most web application development consists of designing the web site and constructing the web site to deliver the content and the required functionality. The module design process starts with a detailed analysis of requirements and development of appropriate specification. A prototype is constructed from the design which usually contains a set of sample pages that can be used for evaluating the screen layout and navigation among different pages.

3.3.1.4 Fourth Phase (Testing)

The implementation of the system based on the product model, calls for a set of activities, which include a detailed analysis of requirements and testing. The system will be tested for on sample students from the faculty in order to identify whether it meets the requirements or not. During this phase of the project, there will also be a presentation to project supervisor.

3.3.1.5 Final Phase (Presentation and reporting)

The final phase comes with final presentation and reporting, The final presentation will be a formal presentation of the completed system to the staff of the faculty. This will be followed by reporting. That is creating a comprehensive report of the system and the entire project.

3.4 System Requirement

	The requirement of hardware and software are the most important part of some 	project because it will guide to the successful of project, because without software and 	hardware requirement the project cannot be accomplish.

3.4.1	Software Requirement

SOFTWARE DESCRIPTION Xampp Managed connection between Apache and MySQL in the localhost server. Web Browser ● Mozilla Firefox Used to run the system Compiler • Java compiler, • c compiler Integrated into the system to compile program codes submitted by contestants.

3.4.2	Hardware Requirement

HARDWARE ITEM DESCRIPTION Server 1 Operating system: Windows RAM: 512 above Hard Drive: 20 GB above

Pendrive 1 Backup the data

  3.5 Summary

The spiral model was introduced, due to the shortcomings in the waterfall and prototype models of software engineering. It is a combination of the said two models of software development. From the name of the model, it can be derived that the activities of software development are carried out like a spiral. To explain the model further, the entire software development process is broken down into small projects. The phases of the spiral model are as follows: • Planning Phase • Analysis Phase • Design Phase • Coding and Implementation Phase/ Evaluation Phase

  CHAPTER 4

DESIGN AND MODELING

4.1	Introduction

	Project modeling is a method used to define and analyze data requirements 	needed to support for the software development. Data modeling defines the 	relationships between the data elements and structures. Data modeling techniques are 	used to model data in standard, consistent, predictable manner in order to manage it as 	a resource. Design and project modeling is to show how the system will be realized 	during the implementation phase. Referring to the phase of the Spiral Model of system 	development, design and modeling system object is located on the third phase. This 	phase aims to serve as a guideline for the system architecture provides a stable 	foundation for the design and implementation of the system.
	Modeling project can be explained by the Context Diagram, DFD, Use Case 	Diagram, framework and Entity Relationship Diagram (ERD). Modeling project also 	including how 	the developers design for the database modeling. 	

  4.2 Context Diagram

Figure 4.1: Context Diagram Figure 4.1 explain the flow of the system based on character and main process that involve on the system functional. It just tells the main function of the system. There have 3 characters in this figure, which are admin, contestant and supervisor.

4.3 Use Case

Figure 4.2: Use Case As we can see from the figure 4.2 on the previous page, there are 3 actors that involves on this system. They are lecturer, student and admin. All actors have their own functionality in this system.

4.4 Data Flow Diagram (DFD)

Figure 4.3: Data Flow Diagram Figure 4.3 shows the flow of the data that through on this system. That show that the data will save on the database with specific table that created on the database. There has seven processes in this diagram. 4.5 Architecture

Figure 4.4: Architecture Figure 4.4 shows about the flow how the actors use this system. The system must be hosted on a web server which will be configured to compile on command. It will contain a databse to store data which will be made accessible on user request. All users require a web browser to access the system. 4.6 Entity Relational Diagram (ERD)

Figure 4.5: Entity Relational Model (ERD) The figure 4.5 shows the ERD of Lecturer Activities System. The ERD show it using the derive table, derive are used for make a relationship between two or more main table, it will have only record of foreign key from the main table. 4.7 Database Modeling

	The database table contains the submitted answers by each contestant.

Figure 4.6: Table for Answer Figure 4.6 shows the Answer table for overall this system.

Figure 4.7: Table for User This table are contains user details.

Figure 4.8: Table for Contest .

Figure 4.9: Table for Contest_question

Figure 4.10: Table for Question

Figure 4.11: Table for Contest_User

  4.8 Summary

In this chapter explained the technical aspects of this project, these includes context diagram, Use case, DFD, framework, ERD, and database of this system. It also shows the figure and table that are related to the table on the database and the interface of every module on the system.

CHAPTER 5

IMPLEMENTATION AND TESTING

5.1 Introduction

An implementation is a realization of a technical specification or algorithm as a program, software component, or other computer system through computer programming and deployment. A product software implementation method is a blueprint to get users and/or organizations running with a specific software product.

The method is a set of rules and views to cope with the most common issues that occur when implementing a software product: business alignment from the organizational view and acceptance from human view.

  5.2 System Testing (screen-short)

The figure below show the testing process of the system which are by the modules integrated in the whole the system.

No. Testing Procedure Expected Result Result

  1. Valid Login Login successful. Main page loaded. Success

  2. Invalid Login Message: “Invalid Username or Password. Please try again using your Username & Password.” Success

  3. User click ‘Logout’ button. Logout page loaded. Logout successful. Success

Table 5.1: Test case for Login

No. Testing Procedure Expected Result Result

  1. User writes code and clicks compile Compile successful. Display output or error message Success
  2. User submits code System displays status, Correct or wrong Success

Table 5.2: Test case for Contest

No. Testing Procedure Expected Result Result

  1. User clicks hall of fame. Display user score ranked from the best down to the worst. Success
  2. Clicks on a user. Details of user submission displayed. Success Table 5.3: Test Case for Results

Figure 5.1: Log in Form Validation Figure 5.2 shows the pop up message will appear when the user enters the wrong password in log in form.

Figure 5.2: Delete Confirmation Figure 5.2 shows a popup to confirm delete 5.2.1 Interface Design

	User interface design is the design of computers, appliances, machines, software 	applications, and websites with the focus on the user’s experience and interaction. The 	goal of user interface design is to make the user’s interaction as simple and efficient as 	possible, in term of accomplishing user goals; what is often called human-computer 	interaction.

Figure 5.3: Main interface

5.2.2 Compiler Interface Design

		The figures show all the input interface design of the code editor.

Figure 5.4: Interface for code editor  

Figure 5.5: Empty Input

Figure 5.6: Help

Figure 5.7: Run

Figure 5.8: Output

5.3 Summary

The implementation of product software, as the final link in the deployment chain of software production, is in a financial perspective of a major issue. It is stated that the implementation of (product) software consumes up to 1/3 of the budget of a software purchase (more than hardware and software requirements together).

  CHAPTER 6

DISCUSSION AND CONCLUSSION

6.1 Introduction

In this project, achieving the objective will facilitate the process of conducting programming competitions and ranking contestants. The proposed 	project is to facilitate student programming skills and provide a platform for them to engage in interactive competitions and build up habit of problem solving. 

6.2 Finding and constraint

Based on a survey conducted, the contestants responded positively to the system functionality and usage. They expressed a great deal of satisfaction using the system. They also showed their willingness in participating in further programming contests.

  6.3 Future Works

The system needs to be tested in a large group of teams and between different cities or countries to study its limitations and performance. Regarding the performance of the system, one should consider the compilation and execution of programs to be put on a different physical server. We should have more than one server, one for the system and the other dedicated to compile the codes. Some features such as;

• The compilation is not secure since users can send malicious codes to damage the whole system. • Mirroring the system. • The system is implemented and tested on C, C++, Java and PHP programming languages and can be extended for more • The interface is English and could be translated to other languages as well.

6.4 Conclusion

This project presents an alternative to the famous PC2 programming contest system. The implementation of the system is mainly focused on the programming contests. Open Source applications, web technologies such as PHP, HTML, CSS, and MySQL will be extensive used during the development of the system. The system should be able to run on both windows and Linux without any problems. It will reduce the burden of educational institutions in organizing programming contests. All the configuration files (web and database) should reside on the main server. The only requirement needed to connect to the system will be a  web browser. This system will create a competitive environment for students to improve problem solving skills and practice.

References

  1. ACM Symposium on Applied Computing, May 1995, pp. 10–13, ACM Press, NY, USA.
  2. The ACM –ICPC International Collegiate Programming Contest. http://icpc.baylor.edu/icpc
  3. Programming Contest Control System (PC2), California State University, Sacramento, U.S.A. http://www.ecs.csus.edu/pc2/.
  4. Ural University Problem Set Archive. http://acm.timus.ru/en.
  5. Online Judge from the Universidad de Valladolid, Spain. http://acm.uva.es/problemset.
  6. http://www.seowebsitedesign.com/the-spiral-model-of-software-development/
  7. Apache Group(2009). Available online http://httpd.apache.org
  8. KRUSTAR (2006). National programming contest Available online http://www.euc.ac.ae/eceportal/ece/npc2006.htm
  9. Lie, Hakon Wium 1994, Available online http://en.wikipedia.org/wiki/CSS
  10. Widenius, M.,Axmark, D. (1994), Available online: http://en.wikipedia.org/wiki/Mysql