Skip to content

Commit fd3084d

Browse files
committed
IDE added
2 parents 242ced3 + 73a9b1d commit fd3084d

83 files changed

Lines changed: 2184 additions & 50 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
node_modules
23
a.out
34
judge/practice
@@ -7,4 +8,7 @@ judge/result.txt
78
judge/solution.c
89
judge/test.c
910
judge/test.out
10-
solutions
11+
solutions
12+
=======
13+
node_modules/
14+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5

a.out

8.41 KB
Binary file not shown.

codecamp-front/src/app/app-routing.module.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import { PracticeComponent } from './components/practice/practice.component';
1212
import { DiscussComponent } from './components/discuss/discuss.component';
1313
import { ContestComponent } from './components/contest/contest.component';
1414
import { AboutComponent } from './components/about/about.component';
15+
<<<<<<< HEAD
1516
import { IdeComponent } from './components/ide/ide.component';
17+
=======
18+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5
1619

1720

1821

@@ -24,8 +27,12 @@ const appRoutes: Routes = [
2427
{path: 'practice' , component: PracticeComponent},
2528
{path: 'contest' , component: ContestComponent},
2629
{path: 'discuss' , component: DiscussComponent},
30+
<<<<<<< HEAD
2731
{path: 'profile' , component: ProfileComponent},
2832
{path: 'ide', component: IdeComponent}
33+
=======
34+
{path: 'profile' , component: ProfileComponent}
35+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5
2936
]
3037

3138
@NgModule({

codecamp-front/src/app/app.module.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ import { AboutComponent } from './components/about/about.component';
1919
import { AuthService } from './services/auth.service';
2020
import { ValidateService } from './services/validate.service';
2121
import { HttpModule } from '@angular/http';
22+
<<<<<<< HEAD
2223
import { SubmissionComponent } from './components/submission/submission.component';
2324
import { SolutionComponent } from './components/solution/solution.component';
2425
import { RanklistComponent } from './components/ranklist/ranklist.component';
2526
import { IdeComponent } from './components/ide/ide.component';
27+
=======
28+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5
2629

2730

2831
@NgModule({
@@ -36,11 +39,15 @@ import { IdeComponent } from './components/ide/ide.component';
3639
PracticeComponent,
3740
DiscussComponent,
3841
ContestComponent,
42+
<<<<<<< HEAD
3943
AboutComponent,
4044
SubmissionComponent,
4145
SolutionComponent,
4246
RanklistComponent,
4347
IdeComponent
48+
=======
49+
AboutComponent
50+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5
4451
],
4552
imports: [
4653
BrowserModule,

codecamp-front/src/app/components/navbar/navbar.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@
3232
</li>
3333
<li class="nav-item">
3434
<a class="nav-link"
35+
<<<<<<< HEAD
3536
routerLink="/ide"
3637
routerLinkActive="active"
3738
>Online IDE</a>
3839
</li>
3940

4041
<li class="nav-item">
4142
<a class="nav-link"
43+
=======
44+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5
4245
routerLink="/discuss"
4346
routerLinkActive="active"
4447
>Discuss</a>

codecamp-front/src/app/services/auth.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ export class AuthService {
4444
}
4545

4646
loadToken(){
47+
<<<<<<< HEAD
4748
const token = localStorage.getItem('id_token');
49+
=======
50+
const token=localStorage.getItem('id_token');
51+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5
4852
this.authToken = token;
4953
}
5054

@@ -56,6 +60,10 @@ export class AuthService {
5660
}
5761

5862
loggedIn() {
63+
<<<<<<< HEAD
64+
=======
65+
console.log( tokenNotExpired('id_token') );
66+
>>>>>>> 73a9b1d0a1fabb223c70b50431b009c32cb343a5
5967
return tokenNotExpired('id_token');
6068
}
6169

contest/models/contest.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const mongoose = require('mongoose');
2+
const {Problem} = require('./problem/problem')
3+
4+
var contestSchema = new mongoose.Schema({
5+
'name':{
6+
type:String,
7+
required:true
8+
},
9+
'startTime':{
10+
type:Date,
11+
required:true,
12+
},
13+
'endTime':{
14+
type:Date,
15+
required:true
16+
},
17+
'description':{
18+
type:String
19+
},
20+
'questions':[{
21+
type: mongoose.Schema.Types.Object,
22+
ref:Problem
23+
}]
24+
})
25+
26+
module.exports = mongoose.model('Contest',contestSchema)

contest/models/contest.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name":{
3+
"type":"string",
4+
"required":true
5+
},
6+
"startDate":{
7+
"type":"date",
8+
"required":true
9+
},
10+
"endDate":{
11+
"type":"date",
12+
"required":true
13+
},
14+
"description":{
15+
"type":"string"
16+
},
17+
18+
}

contest/models/problem/problem.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const mongoose = require('mongoose')
2+
const ProblemJson = require('./problem.json')
3+
4+
const ProblemSchema = new mongoose.Schema(ProblemJson)
5+
6+
module.exports=mongoose.model('Problem',ProblemSchema)
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<<<<<<< HEAD:contest/models/problem/problem.json
2+
{
3+
"code":{
4+
"type":"string",
5+
"required":true,
6+
"unique":true
7+
},
8+
"name":{
9+
"type":"string",
10+
"required":true
11+
},
12+
"level":{
13+
"type":"string"
14+
},
15+
"description":{
16+
"type":"string",
17+
"default":""
18+
},
19+
"successfulSubmission":{
20+
"type":"number",
21+
"default":0
22+
},
23+
"input_format":{
24+
"type":"string"
25+
},
26+
"output_format":{
27+
"type":"string"
28+
},
29+
"constraints":{
30+
"type":"string"
31+
},
32+
"input_example":{
33+
"type":"string"
34+
},
35+
"output_example":{
36+
"type":"string"
37+
},
38+
"explanation_example":{
39+
"type":"string",
40+
"default":""
41+
},
42+
"date_added":{
43+
"type":"date"
44+
},
45+
"timelimit":{
46+
"type":"number"
47+
},
48+
"sourcelimit":{
49+
"type":"number"
50+
},
51+
"author":{
52+
"type":"string"
53+
},
54+
"contest":{
55+
"type":"string"
56+
}
57+
=======
58+
{
59+
"code":{
60+
"type":"string",
61+
"required":true,
62+
"unique":true
63+
},
64+
"name":{
65+
"type":"string",
66+
"required":true
67+
},
68+
"level":{
69+
"type":"string"
70+
},
71+
"description":{
72+
"type":"string",
73+
"default":""
74+
},
75+
"successfulSubmission":{
76+
"type":"number",
77+
"default":0
78+
},
79+
"input_format":{
80+
"type":"string"
81+
},
82+
"output_format":{
83+
"type":"string"
84+
},
85+
"constraints":{
86+
"type":"string"
87+
},
88+
"input_example":{
89+
"type":"string"
90+
},
91+
"output_example":{
92+
"type":"string"
93+
},
94+
"explanation_example":{
95+
"type":"string",
96+
"default":""
97+
},
98+
"date_added":{
99+
"type":"date"
100+
},
101+
"timelimit":{
102+
"type":"number"
103+
},
104+
"sourcelimit":{
105+
"type":"number"
106+
},
107+
"author":{
108+
"type":"string"
109+
}
110+
>>>>>>> aae61357893efc5840f7327a2cce64f575d50d4d:server/models/problem/problem.json
111+
}

0 commit comments

Comments
 (0)