├── .gitignore
├── codejudge-compiler
├── .classpath
├── .project
├── src
│ └── codejudge
│ │ └── compiler
│ │ ├── languages
│ │ ├── Language.java
│ │ ├── Python.java
│ │ ├── Cpp.java
│ │ ├── Java.java
│ │ └── C.java
│ │ ├── CodejudgeCompiler.java
│ │ ├── TimedShell.java
│ │ └── RequestThread.java
└── .settings
│ └── org.eclipse.jdt.core.prefs
├── logout.php
├── admin
├── logout.php
├── footer.php
├── preview.php
├── header.php
├── profile.php
├── users.php
├── index.php
├── login.php
├── update.php
└── problems.php
├── README.md
├── license.txt
├── footer.php
├── functions.php
├── update.php
├── js
├── bootstrap-transition.js
├── bootstrap-alert.js
├── bootstrap-button.js
├── bootstrap-dropdown.js
├── bootstrap-popover.js
├── bootstrap-tab.js
├── bootstrap-scrollspy.js
├── bootstrap-collapse.js
├── bootstrap-carousel.js
├── bootstrap-modal.js
├── bootstrap-typeahead.js
└── bootstrap-tooltip.js
├── scoreboard.php
├── submissions.php
├── header.php
├── account.php
├── about.php
├── index.php
├── eval.php
├── login.php
├── install.php
├── solve.php
├── css
└── bootstrap-responsive.css
└── markdown.php
/.gitignore:
--------------------------------------------------------------------------------
1 | # Codejudge .gitignore
2 | *~
3 | dbinfo.php
4 | *.class
5 |
--------------------------------------------------------------------------------
/codejudge-compiler/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/logout.php:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/admin/logout.php:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/codejudge-compiler/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | codejudge-compiler
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/codejudge-compiler/src/codejudge/compiler/languages/Language.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Codejudge
3 | * Copyright 2012, Sankha Narayan Guria (sankha93@gmail.com)
4 | * Licensed under MIT License.
5 | *
6 | * Codejudge Compiler Server: The base interface for each language
7 | */
8 |
9 | package codejudge.compiler.languages;
10 |
11 | public abstract class Language {
12 |
13 | public boolean timedout = false;
14 | public abstract void execute(); // method to override when executing a program
15 | public abstract void compile(); // method to override when compiling a program
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/codejudge-compiler/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=1.6
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11 | org.eclipse.jdt.core.compiler.source=1.6
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Codejudge
2 | =========
3 |
4 | **NOTE: This project is not maintained anymore!**
5 |
6 | Coding competitions are now easy to organise anytime, anywhere.
7 |
8 | Codejudge can be run from any PHP, MySQL server and can be used to power any coding competition and evaluate its solutions automatically.
9 |
10 | No need to run to big companies to host your event. You can set up Codejudge almost anywhere and anytime!
11 |
12 | ### Note
13 |
14 | Bleeding edge changes are on the `develop` branch and things most likely don't work there. You are recomended to use the `master` branch. If you love to experiment then go for the `develop` branch.
15 |
16 | A follow-up project to create a better judge was being worked on, but kind of stalled at the moment (due to lack of time from my side). Take a look at [judgev2](https://github.com/sankha93/judgev2)
17 |
18 |
--------------------------------------------------------------------------------
/codejudge-compiler/src/codejudge/compiler/CodejudgeCompiler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Codejudge
3 | * Copyright 2012, Sankha Narayan Guria (sankha93@gmail.com)
4 | * Licensed under MIT License.
5 | *
6 | * Codejudge Compiler Server
7 | */
8 |
9 | package codejudge.compiler;
10 |
11 | import java.io.IOException;
12 | import java.net.ServerSocket;
13 | import java.net.Socket;
14 |
15 | public class CodejudgeCompiler {
16 |
17 | public static void main(String args[]) {
18 | int n=0;
19 | try {
20 | ServerSocket server = new ServerSocket(3029); // create a new socket to listen on
21 | System.out.println("Codejudge compilation server running ...");
22 | while(true) {
23 | n++;
24 | // accept any incoming connection and process it on a new thread
25 | Socket s = server.accept();
26 | RequestThread request = new RequestThread(s, n);
27 | request.start();
28 | }
29 | } catch (IOException e) {
30 | e.printStackTrace();
31 | }
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/codejudge-compiler/src/codejudge/compiler/TimedShell.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Codejudge
3 | * Copyright 2012, Sankha Narayan Guria (sankha93@gmail.com)
4 | * Licensed under MIT License.
5 | *
6 | * Codejudge Timer Shell that executes a commend with a timeout period
7 | */
8 |
9 | package codejudge.compiler;
10 |
11 | import codejudge.compiler.languages.Language;
12 |
13 | public class TimedShell extends Thread {
14 |
15 | Language parent;
16 | Process p;
17 | long time;
18 |
19 | public TimedShell(Language parent, Process p, long time){
20 | this.parent = parent;
21 | this.p = p;
22 | this.time = time;
23 | }
24 |
25 | // Sleep until timeout and then terminate the process
26 | public void run() {
27 | try {
28 | sleep(time);
29 | } catch (InterruptedException e) {
30 | e.printStackTrace();
31 | }
32 | try {
33 | p.exitValue();
34 | parent.timedout = false;
35 | } catch (IllegalThreadStateException e) {
36 | parent.timedout = true;
37 | p.destroy();
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Sankha Narayan Guria
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/footer.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |