├── README.md
├── executor
├── .gitignore
├── requirements.txt
├── Dockerfile
├── exec_server.py
└── exec_utils.py
├── OJ-server
├── .gitignore
├── models
│ └── problemModel.js
├── package.json
├── modules
│ └── redisClient.js
├── server.js
├── routes
│ └── rest.js
├── services
│ ├── editorSocketService.js
│ └── problemService.js
└── package-lock.json
├── OnlineJudge
├── src
│ ├── assets
│ │ ├── .gitkeep
│ │ └── loading.svg
│ ├── app
│ │ ├── app.component.css
│ │ ├── components
│ │ │ ├── navbar
│ │ │ │ ├── navbar.component.css
│ │ │ │ ├── navbar.component.spec.ts
│ │ │ │ ├── navbar.component.ts
│ │ │ │ └── navbar.component.html
│ │ │ ├── new-problem
│ │ │ │ ├── new-problem.component.css
│ │ │ │ ├── new-problem.component.spec.ts
│ │ │ │ ├── new-problem.component.ts
│ │ │ │ └── new-problem.component.html
│ │ │ ├── user-number
│ │ │ │ ├── user-number.component.css
│ │ │ │ ├── user-number.component.html
│ │ │ │ ├── user-number.component.ts
│ │ │ │ └── user-number.component.spec.ts
│ │ │ ├── edit-problem
│ │ │ │ ├── edit-problem.component.css
│ │ │ │ ├── edit-problem.component.spec.ts
│ │ │ │ ├── edit-problem.component.ts
│ │ │ │ └── edit-problem.component.html
│ │ │ ├── problem-detail
│ │ │ │ ├── problem-detail.component.css
│ │ │ │ ├── problem-detail.component.html
│ │ │ │ ├── problem-detail.component.spec.ts
│ │ │ │ └── problem-detail.component.ts
│ │ │ ├── loading
│ │ │ │ ├── loading.component.html
│ │ │ │ ├── loading.component.css
│ │ │ │ ├── loading.component.ts
│ │ │ │ └── loading.component.spec.ts
│ │ │ ├── profile
│ │ │ │ ├── profile.component.css
│ │ │ │ ├── profile.component.html
│ │ │ │ ├── profile.component.ts
│ │ │ │ └── profile.component.spec.ts
│ │ │ ├── problem-list
│ │ │ │ ├── problem-list.component.css
│ │ │ │ ├── problem-list.component.html
│ │ │ │ ├── problem-list.component.spec.ts
│ │ │ │ └── problem-list.component.ts
│ │ │ └── editor
│ │ │ │ ├── editor.component.css
│ │ │ │ ├── editor.component.spec.ts
│ │ │ │ ├── editor.component.html
│ │ │ │ └── editor.component.ts
│ │ ├── app.component.html
│ │ ├── models
│ │ │ └── problem.model.ts
│ │ ├── pipes
│ │ │ ├── search.pipe.spec.ts
│ │ │ └── search.pipe.ts
│ │ ├── app.component.ts
│ │ ├── services
│ │ │ ├── auth.service.spec.ts
│ │ │ ├── data.service.spec.ts
│ │ │ ├── search-input.service.spec.ts
│ │ │ ├── collaboration.service.spec.ts
│ │ │ ├── search-input.service.ts
│ │ │ ├── collaboration.service.ts
│ │ │ ├── data.service.ts
│ │ │ └── auth.service.ts
│ │ ├── mock-problems.ts
│ │ ├── app.component.spec.ts
│ │ ├── app.routes.ts
│ │ └── app.module.ts
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── styles.css
│ ├── favicon.ico
│ ├── typings.d.ts
│ ├── tsconfig.app.json
│ ├── index.html
│ ├── tsconfig.spec.json
│ ├── main.ts
│ ├── test.ts
│ └── polyfills.ts
├── e2e
│ ├── app.po.ts
│ ├── tsconfig.e2e.json
│ └── app.e2e-spec.ts
├── .editorconfig
├── tsconfig.json
├── .gitignore
├── protractor.conf.js
├── karma.conf.js
├── README.md
├── package.json
├── .angular-cli.json
└── tslint.json
├── public
├── favicon.ico
├── glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf
├── glyphicons-halflings-regular.f4769f9bdb7466be6508.eot
├── glyphicons-halflings-regular.448c34a56d699c29117a.woff2
├── glyphicons-halflings-regular.fa2772327f55d8198301.woff
├── index.html
├── assets
│ └── loading.svg
├── inline.bundle.js.map
├── inline.bundle.js
└── main.bundle.js.map
├── oj-executor
└── launcher.sh
/README.md:
--------------------------------------------------------------------------------
1 | # Online_Judge
--------------------------------------------------------------------------------
/executor/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
--------------------------------------------------------------------------------
/OJ-server/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
--------------------------------------------------------------------------------
/OnlineJudge/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/OnlineJudge/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/executor/requirements.txt:
--------------------------------------------------------------------------------
1 | Flask
2 | docker
--------------------------------------------------------------------------------
/OnlineJudge/src/app/components/navbar/navbar.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/OnlineJudge/src/app/components/new-problem/new-problem.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/OnlineJudge/src/app/components/user-number/user-number.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/OnlineJudge/src/app/components/edit-problem/edit-problem.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/OnlineJudge/src/app/components/problem-detail/problem-detail.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/OnlineJudge/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 | user-number works! 3 |
4 | -------------------------------------------------------------------------------- /OnlineJudge/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /OnlineJudge/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /OnlineJudge/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/OnlineJudge/src/favicon.ico -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/loading/loading.component.html: -------------------------------------------------------------------------------- 1 |{{ profile | json }}
12 | 9 | {{problem.desc}} 10 |
11 |{{users}}
43 |{{result}}
47 |{{users}}
\\n{{result}}
\\n\\n {{problem.desc}}\\n
\\n{{ profile | json }}\\n \\n user-number works!\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.html\n// module id = ../../../../../src/app/components/user-number/user-number.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-user-number',\n templateUrl: './user-number.component.html',\n styleUrls: ['./user-number.component.css']\n})\nexport class UserNumberComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.ts","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { Problem } from '../models/problem.model';\n\n@Pipe({\n name: 'search'\n})\nexport class SearchPipe implements PipeTransform {\n\n transform(problems: Problem[], term: string): Problem[] {\n console.log(problems);\n return problems.filter(\n problem => (problem.name.toLowerCase().includes(term))\n || problem.id === +term\n || problem.difficulty === term);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/pipes/search.pipe.ts","import { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\nimport * as auth0 from 'auth0-js';\n\n@Injectable()\nexport class AuthService {\n\n auth0 = new auth0.WebAuth({\n clientID: '5xbog7t8lFRoXryt9ZjhlSFKnxVkIPT5',\n domain: 'auth-yicong.auth0.com',\n responseType: 'token id_token',\n audience: 'https://auth-yicong.auth0.com/userinfo',\n redirectUri: \"http://\" + window.location.hostname + \":3000\" + \"/loading\",\n scope: 'openid profile'\n });\n\n userProfile: any;\n\n constructor(public router: Router) {}\n\n public getProfile(cb): void {\n const accessToken = localStorage.getItem('access_token');\n if (!accessToken) {\n throw new Error('Access Token must exist to fetch profile');\n }\n \n const self = this;\n this.auth0.client.userInfo(accessToken, (err, profile) => {\n if (profile) {\n self.userProfile = profile;\n }\n cb(err, profile);\n });\n }\n\n\n public login(): void {\n this.auth0.authorize();\n }\n\n \n public handleAuthentication(): void {\n console.log(\"calling\");\n this.auth0.parseHash((err, authResult) => {\n console.log(authResult);\n if (authResult && authResult.accessToken && authResult.idToken) {\n this.setSession(authResult);\n this.router.navigate(['/']);\n } else if (err) {\n this.router.navigate(['/']);\n console.log(err);\n alert(`Error: ${err.error}. Check the console for further details.`);\n }\n });\n }\n\n\n private setSession(authResult): void {\n // Set the time that the access token will expire at\n const expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime());\n localStorage.setItem('access_token', authResult.accessToken);\n localStorage.setItem('id_token', authResult.idToken);\n localStorage.setItem('expires_at', expiresAt);\n }\n\n\n public logout(): void {\n // Remove tokens and expiry time from localStorage\n localStorage.removeItem('access_token');\n localStorage.removeItem('id_token');\n localStorage.removeItem('expires_at');\n // Go back to the home route\n this.router.navigate(['/']);\n }\n\n\n public isAuthenticated(): boolean {\n // Check whether the current time is past the\n // access token's expiry time\n const expiresAt = JSON.parse(localStorage.getItem('expires_at'));\n return new Date().getTime() < expiresAt;\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/auth.service.ts","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs/Rx';\nimport { Subject } from 'rxjs/Subject';\n\ndeclare var io: any;\n\n@Injectable()\nexport class CollaborationService {\n\n collaborationSocket: any;\n private _userSource = new Subject