Skip to content

Commit 1b2a14a

Browse files
committed
Files uploading
1 parent e7019e2 commit 1b2a14a

29 files changed

Lines changed: 299 additions & 65 deletions

codecamp-front/.angular-cli.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
"../node_modules/jquery/dist/jquery.min.js",
2828
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
2929
"../node_modules/ace-builds/src-min/ace.js",
30-
"../node_modules/ace-builds/src-min/theme-eclipse.js",
31-
"../node_modules/ace-builds/src-min/mode-c_cpp.js",
30+
"../node_modules/ace-builds/src-min/theme-sqlserver.js",
31+
"../node_modules/ace-builds/src-min/mode-c.js",
32+
"../node_modules/ace-builds/src-min/mode-cpp.js",
3233
"../node_modules/ace-builds/src-min/mode-python.js",
3334
"../node_modules/ace-builds/src-min/mode-java.js"
3435
],

codecamp-front/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codecamp-front/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"core-js": "^2.4.1",
2929
"jquery": "^3.3.1",
3030
"ng2-ace-editor": "^0.3.4",
31+
"ng2-file-upload": "^1.3.0",
3132
"popper.js": "^1.12.9",
3233
"rxjs": "^5.5.6",
3334
"zone.js": "^0.8.19"

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { AddProblemComponent } from './components/add-problem/add-problem.compon
2121

2222
import { AuthGuard } from './guards/auth.guard';
2323
import { NotAuthGuard } from './guards/not-auth.guard';
24+
import { SolultionSubmitComponent } from './components/solultion-submit/solultion-submit.component';
2425

2526

2627
const appRoutes: Routes = [
@@ -61,15 +62,18 @@ const appRoutes: Routes = [
6162
path: 'ide',
6263
component: IdeComponent
6364
},
65+
{
66+
path: ':contest/submit/:code',
67+
component: SolultionSubmitComponent
68+
},
6469
{
6570
path: 'contest/add-contest',
6671
component: AddContestComponent,
6772
canActivate: [AuthGuard]
6873
},
6974
{
7075
path: 'contest/:contest',
71-
component: ProblemsComponent,
72-
canActivate: [NotAuthGuard]
76+
component: ProblemsComponent
7377
},
7478
{
7579
path: 'contest/:contest/addproblem',
@@ -78,8 +82,7 @@ const appRoutes: Routes = [
7882
},
7983
{
8084
path: 'contest/:contest/:problem',
81-
component: ProblemComponent,
82-
canActivate: [NotAuthGuard]
85+
component: ProblemComponent
8386
},
8487
{
8588
path: 'contest/edit/:edit-contest',

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { AddProblemComponent } from './components/add-problem/add-problem.compon
3333

3434
import { AuthGuard } from './guards/auth.guard';
3535
import { NotAuthGuard } from './guards/not-auth.guard';
36+
import { SolultionSubmitComponent } from './components/solultion-submit/solultion-submit.component';
3637

3738
@NgModule({
3839
declarations: [
@@ -54,7 +55,8 @@ import { NotAuthGuard } from './guards/not-auth.guard';
5455
RanklistComponent,
5556
SolutionComponent,
5657
ProblemComponent,
57-
AddProblemComponent
58+
AddProblemComponent,
59+
SolultionSubmitComponent
5860
],
5961
imports: [
6062
BrowserModule,

codecamp-front/src/app/components/add-problem/add-problem.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
</div>
180180

181181
<input
182-
[disabled]="!form.valid"
182+
183183
type="submit" class="btn btn-primary" value="Add Problem">
184184
</form>
185185
</div>

codecamp-front/src/app/components/add-problem/add-problem.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export class AddProblemComponent implements OnInit {
5757
timelimit: this.form.get('timelimit').value,
5858
sourcelimit: this.form.get('sourcelimit').value,
5959
author: this.form.get('author').value,
60-
Input: this.form.get('Input').value,
61-
Output: this.form.get('Output').value,
60+
testCaseInput: this.form.get('Input').value,
61+
testCaseOutput: this.form.get('Output').value
6262
};
6363

6464
this.contestService.addProblem(problem, this.contest).subscribe(data => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h5>Select language</h5>
1515
<div ace-editor id="" cols="105" rows="28"
1616
[text]="content"
1717
class="aceEditorDirective"
18-
theme="eclipse"
18+
theme="sqlserver"
1919
mode="{{selectedLanguage}}"
2020
style="height:500px;"></div>
2121

codecamp-front/src/app/components/ide/ide.component.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ import { Component, OnInit, ViewChild } from '@angular/core';
88
export class IdeComponent implements OnInit {
99

1010

11-
selectedLanguage: String = 'c_cpp';
11+
selectedLanguage: String = 'c';
1212
content: string;
1313
selectLanguage(event: any) {
1414
this.selectedLanguage = event.target.value;
15-
if(this.selectedLanguage === 'c_cpp') { this.content =
16-
`#include<stdio.h>
15+
if (this.selectedLanguage === 'c') {
16+
this.content =
17+
`#include<stdio.h>
1718
18-
int main()
19-
{
19+
int main()
20+
{
2021
21-
printf("Welcome To CodeCamp");
22+
printf("Welcome To CodeCamp");
2223
23-
}
24-
`} else if(this.selectedLanguage === 'java'){this.content =
25-
`import java.util.*;
24+
}`;
25+
} else if (this.selectedLanguage === 'java') {
26+
this.content = `import java.util.*;
2627
2728
public class CodeCamp {
2829
@@ -35,7 +36,7 @@ public class CodeCamp {
3536
}
3637
`
3738
} else {
38-
this.content = `print("Welcome To CodeCamp")`
39+
this.content = `print("Welcome To CodeCamp")`;
3940
}
4041

4142
}

codecamp-front/src/app/components/practice/practice.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ export class PracticeComponent implements OnInit {
1111

1212
ngOnInit() {
1313
}
14-
1514
}

0 commit comments

Comments
 (0)