diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..a04030d
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,9 @@
+{
+ "files.associations": {
+ "bitset": "cpp",
+ "array": "cpp",
+ "initializer_list": "cpp",
+ "valarray": "cpp"
+ },
+ "python.linting.pylintEnabled": false
+}
\ No newline at end of file
diff --git a/abc.txt b/abc.txt
new file mode 100644
index 0000000..0fb16fe
--- /dev/null
+++ b/abc.txt
@@ -0,0 +1,100 @@
+12
+13
+15
+17
+12
+16
+14
+13
+8
+14
+8
+11
+13
+16
+11
+10
+9
+13
+13
+12
+15
+8
+11
+16
+10
+9
+14
+14
+12
+11
+12
+11
+12
+11
+13
+15
+10
+13
+13
+15
+15
+11
+12
+9
+15
+17
+12
+12
+13
+11
+9
+10
+14
+8
+13
+10
+13
+12
+12
+13
+13
+13
+14
+13
+12
+14
+13
+9
+13
+10
+14
+12
+9
+13
+9
+8
+12
+6
+12
+12
+9
+16
+7
+13
+12
+11
+9
+8
+10
+17
+13
+9
+11
+8
+9
+13
+8
+11
+14
+12
diff --git a/codecamp-front/.angular-cli.json b/codecamp-front/.angular-cli.json
index 602248b..92f8ad7 100644
--- a/codecamp-front/.angular-cli.json
+++ b/codecamp-front/.angular-cli.json
@@ -8,8 +8,7 @@
"root": "src",
"outDir": "../server/public",
"assets": [
- "assets",
- "assets/home-icon.png"
+ "assets"
],
"index": "index.html",
"main": "main.ts",
diff --git a/codecamp-front/package-lock.json b/codecamp-front/package-lock.json
index 3bdb30b..74a6fc6 100644
--- a/codecamp-front/package-lock.json
+++ b/codecamp-front/package-lock.json
@@ -7794,6 +7794,11 @@
"resolved": "https://registry.npmjs.org/ng2-file-upload/-/ng2-file-upload-1.3.0.tgz",
"integrity": "sha512-Pudxik6LWYsT8hNiEW7RfjgGWAnvfQywxwJYMdt1snTUe+KnlRc/QqPv3QEQW6plXTanuLkYz/TbqilSfSHOsw=="
},
+ "ngx-pagination": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/ngx-pagination/-/ngx-pagination-3.1.0.tgz",
+ "integrity": "sha512-D/8Is3z0nipHCCQN0XZyh5/nhSrON/ybft3Wk8dfPHMGtjqzoOSorNaanypO35JD/jECcam/cS/evjlaqDAgQg=="
+ },
"ngx-progressbar": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ngx-progressbar/-/ngx-progressbar-2.1.1.tgz",
diff --git a/codecamp-front/package.json b/codecamp-front/package.json
index 064e6b8..231acc1 100644
--- a/codecamp-front/package.json
+++ b/codecamp-front/package.json
@@ -33,6 +33,7 @@
"ng2-ace-editor": "0.3.4",
"ng2-date-countdown": "0.0.5",
"ng2-file-upload": "1.3.0",
+ "ngx-pagination": "^3.1.0",
"ngx-progressbar": "2.1.1",
"popper.js": "1.12.9",
"rxjs": "5.5.6",
diff --git a/codecamp-front/src/app/app-routing.module.ts b/codecamp-front/src/app/app-routing.module.ts
index 2d7ba5a..63d8ba8 100644
--- a/codecamp-front/src/app/app-routing.module.ts
+++ b/codecamp-front/src/app/app-routing.module.ts
@@ -1,4 +1,4 @@
-import { NgModule } from '@angular/core';
+import { NgModule, Component } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
@@ -21,10 +21,16 @@ import { AddProblemComponent } from './components/add-problem/add-problem.compon
import { AuthGuard } from './guards/auth.guard';
import { NotAuthGuard } from './guards/not-auth.guard';
-import { SolultionSubmitComponent } from './components/solultion-submit/solultion-submit.component';
-import { SolutionComponent } from './components/solultion-submit/solution/solution.component';
+import { SolutionSubmitComponent } from './components/solution-submit/solution-submit.component';
+import { SolutionComponent } from './components/solution-submit/solution/solution.component';
import { RanklistComponent } from './components/ranklist/ranklist.component';
import { EditProfileComponent } from './components/edit-profile/edit-profile.component';
+import { IwedgeComponent } from './components/iwedge/iwedge.component';
+import { ContestiwComponent } from './components/iwedge/contestiw/contestiw.component';
+import { ContactComponent } from './components/contact/contact.component';
+import { ForgotPasswordComponent } from './components/forgot-password/forgot-password.component';
+import { ViewSolComponent } from './components/view-sol/view-sol.component';
+import { AdminGuard } from './guards/admin.guard';
const appRoutes: Routes = [
@@ -36,11 +42,6 @@ const appRoutes: Routes = [
path: 'about',
component: AboutComponent
},
- {
- path: 'register',
- component: RegisterComponent,
- canActivate: [NotAuthGuard]
- },
{
path: 'login',
component: LoginComponent,
@@ -50,6 +51,19 @@ const appRoutes: Routes = [
path: 'practice',
component: PracticeComponent
},
+ {
+ path: 'practice/:contest/:problem',
+ component: ProblemComponent
+ },
+ {
+ path: 'iwedge',
+ component: IwedgeComponent
+ },
+ {
+ path: 'iwedge/contest',
+ component: ContestiwComponent
+
+ },
{
path: 'contest',
component: ContestComponent
@@ -63,17 +77,25 @@ const appRoutes: Routes = [
component: ProfileComponent,
canActivate: [AuthGuard]
},
+ {
+ path: 'forgot-password',
+ component: ForgotPasswordComponent
+ },
{
path: 'ide',
component: IdeComponent
},
+ {
+ path: 'contact',
+ component: ContactComponent
+ },
{
path: ':username/edit-profile',
component: EditProfileComponent
},
{
path: ':contest/submit/:code',
- component: SolultionSubmitComponent,
+ component: SolutionSubmitComponent,
canActivate: [AuthGuard]
},
{
@@ -84,7 +106,7 @@ const appRoutes: Routes = [
{
path: 'contest/add-contest',
component: AddContestComponent,
- canActivate: [AuthGuard]
+ canActivate: [AdminGuard]
},
{
path: 'contest/:contest',
@@ -93,7 +115,7 @@ const appRoutes: Routes = [
{
path: 'contest/:contest/addproblem',
component: AddProblemComponent,
- canActivate: [AuthGuard]
+ canActivate: [AdminGuard]
},
{
path: 'contest/:contest/ranking',
@@ -101,7 +123,8 @@ const appRoutes: Routes = [
},
{
path: 'contest/:contest/:problem',
- component: ProblemComponent
+ component: ProblemComponent,
+ canActivate: [AuthGuard]
},
{
path: 'contest/:contest/ranklist',
diff --git a/codecamp-front/src/app/app.component.css b/codecamp-front/src/app/app.component.css
index 2c4d3cd..f526bc6 100644
--- a/codecamp-front/src/app/app.component.css
+++ b/codecamp-front/src/app/app.component.css
@@ -6,6 +6,9 @@
@media only screen and (max-width:896px){
.wrapper{
margin: 0;
+
}
+
+
}
diff --git a/codecamp-front/src/app/app.component.html b/codecamp-front/src/app/app.component.html
index 94eb4d0..292b424 100644
--- a/codecamp-front/src/app/app.component.html
+++ b/codecamp-front/src/app/app.component.html
@@ -1,17 +1,21 @@
+
-
-
+
+
+
+
+
diff --git a/codecamp-front/src/app/app.component.ts b/codecamp-front/src/app/app.component.ts
index 097a482..3fd1fb4 100644
--- a/codecamp-front/src/app/app.component.ts
+++ b/codecamp-front/src/app/app.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit, trigger, transition, style, animate, state } from '@angular/core';
import { NgProgress } from 'ngx-progressbar';
import { ContestService } from './services/contest.service';
+import { Router, NavigationEnd } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
@@ -23,7 +24,9 @@ export class AppComponent implements OnInit {
panelVisible;
menuState:string = 'out';
- constructor(public progressService: NgProgress,
+ constructor(
+ private router: Router,
+ public progressService: NgProgress,
private contestService: ContestService){
}
@@ -39,7 +42,13 @@ export class AppComponent implements OnInit {
if(!this.panelVisible)
// 1-line if statement that toggles the value:
this.menuState = 'in';
- else
+ else
this.menuState = 'out';
+ this.router.events.subscribe((evt) => {
+ if (!(evt instanceof NavigationEnd)) {
+ return;
+ }
+ window.scrollTo(0, 0)
+ });
}
}
diff --git a/codecamp-front/src/app/app.module.ts b/codecamp-front/src/app/app.module.ts
index 03938a8..4919926 100644
--- a/codecamp-front/src/app/app.module.ts
+++ b/codecamp-front/src/app/app.module.ts
@@ -1,5 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
+//import {NgxPaginationModule} from 'ngx-pagination';
+import { FormsModule } from '@angular/forms';
import { RouterModule, Routes} from '@angular/router';
import { ReactiveFormsModule} from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
@@ -27,21 +29,32 @@ import { AddContestComponent } from './components/add-contest/add-contest.compon
import { EditContestComponent } from './components/edit-contest/edit-contest.component';
import { SubmissionComponent } from './components/submission/submission.component';
import { RanklistComponent } from './components/ranklist/ranklist.component';
-import { SolutionComponent } from './components/solultion-submit/solution/solution.component';
+import { SolutionComponent } from './components/solution-submit/solution/solution.component';
import { ProblemComponent } from './components/problem/problem.component';
import { AddProblemComponent } from './components/add-problem/add-problem.component';
import { AuthGuard } from './guards/auth.guard';
import { NotAuthGuard } from './guards/not-auth.guard';
-import { SolultionSubmitComponent } from './components/solultion-submit/solultion-submit.component';
+
+import { AdminGuard } from './guards/admin.guard';
+import { SolutionSubmitComponent } from './components/solution-submit/solution-submit.component';
import { PreloaderComponent } from './components/preloader/preloader.component';
import { SidebarComponent } from './components/sidebar/sidebar.component';
import { NgProgressModule, NgProgressBrowserXhr } from 'ngx-progressbar';
import { BrowserXhr } from '@angular/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FlashMessagesModule } from 'angular2-flash-messages';
+import { IwedgeComponent } from './components/iwedge/iwedge.component';
+import { ContestiwComponent } from './components/iwedge/contestiw/contestiw.component';
//import { CountDown } from 'ng2-date-countdown';
+import { ContactComponent } from './components/contact/contact.component';
+import { FooterComponent } from './components/footer/footer.component';
+import { NotificationComponent } from './components/notification/notification.component';
+import { ForgotPasswordComponent } from './components/forgot-password/forgot-password.component';
+import { ViewSolComponent } from './components/view-sol/view-sol.component';
+import { CommentComponent } from './components/comment/comment.component';
+
@NgModule({
declarations: [
@@ -64,24 +77,34 @@ import { FlashMessagesModule } from 'angular2-flash-messages';
SolutionComponent,
ProblemComponent,
AddProblemComponent,
- SolultionSubmitComponent,
+ SolutionSubmitComponent,
PreloaderComponent,
SidebarComponent,
EditProfileComponent,
+ IwedgeComponent,
+ ContestiwComponent,
//CountDown
+ ContactComponent,
+ FooterComponent,
+ NotificationComponent,
+ ForgotPasswordComponent,
+ ViewSolComponent,
+ CommentComponent
],
imports: [
BrowserModule,
HttpModule,
+ FormsModule,
ReactiveFormsModule,
AppRoutingModule,
AceEditorModule,
NgProgressModule,
BrowserAnimationsModule,
FlashMessagesModule.forRoot()
+ //NgxPaginationModule
],
- providers: [ AuthService, AuthGuard, NotAuthGuard, ContestService,
- {provide: BrowserXhr, useClass: NgProgressBrowserXhr}, ],
+ providers: [ AuthService, AuthGuard, NotAuthGuard, AdminGuard, ContestService,
+ {provide: BrowserXhr, useClass: NgProgressBrowserXhr}],
bootstrap: [AppComponent]
})
export class AppModule { }
diff --git a/codecamp-front/src/app/components/about/about.component.css b/codecamp-front/src/app/components/about/about.component.css
index 3812eae..4835572 100644
--- a/codecamp-front/src/app/components/about/about.component.css
+++ b/codecamp-front/src/app/components/about/about.component.css
@@ -3,8 +3,10 @@ p{
}
h1{
- color: red;
- text-shadow: 0.01em 0em 0 #0d24ec, 0em 0.01em 0 #091fe7, 0.02em 0.01em 0 #091fe7, 0.01em 0.02em 0 #091fe7, 0.03em 0.02em 0 #091fe7 ,
- 0.02em 0.03em 0 #091fe7, 0.04em 0.03em 0 #091fe7, 0.03em 0.04em 0 #091fe7, 0.05em 0.04em 0 #091fe7, 0.04em 0.05em 0 #091fe7,
- 0.06em 0.05em 0 #091fe7, 0.05em 0.06em 0 #091fe7, 0.07em 0.06em 0 #091fe7, 0.06em 0.07em 0 #091fe7, 0.08em 0.07em 0 #091fe7, 0.07em 0.08em 0 #091fe7
+ color: rgb(60, 59, 59);
+ font-family: 'Courier';
}
+
+.container{
+ min-height: 800px;
+}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/about/about.component.html b/codecamp-front/src/app/components/about/about.component.html
index 6d0e345..a34ed93 100644
--- a/codecamp-front/src/app/components/about/about.component.html
+++ b/codecamp-front/src/app/components/about/about.component.html
@@ -1,15 +1,18 @@
-
-
CodeCamp
-
-
CodeCamp is an open-source educational initiative of the students of Techno India Salt Lake.
-
-
It is a platform dedicated to cometitive coding made by students for students.
-
-
It supports the 4 most used programming languages i.e, C, C++, JAVA and Python.
-
-
It is a budding community of programmers.
-
-
CodeCamp helps students improve their coding skills.Its objective is to provide a platform for practice, competition and improvement for students.
-
-
Apart from this, it aims to reach out to high school students while they are young and inculcate a culture of programming in India.
+
+
+
HackerCamp
+
+
HackerCamp is an open-source educational initiative of the students of Techno India Salt Lake.
+
+
It is a platform dedicated to cometitive coding made by students for students.
+
+
It supports the 4 most used programming languages i.e, C, C++, JAVA and Python.
+
+
It is a budding community of programmers.
+
+
HackerCamp helps students improve their coding skills.Its objective is to provide a platform for practice, competition and improvement for students.
+
+
Apart from this, it aims to reach out to high school students while they are young and inculcate a culture of programming in India.
+
+
diff --git a/codecamp-front/src/app/components/add-contest/add-contest.component.html b/codecamp-front/src/app/components/add-contest/add-contest.component.html
index b6b255c..e7d183c 100644
--- a/codecamp-front/src/app/components/add-contest/add-contest.component.html
+++ b/codecamp-front/src/app/components/add-contest/add-contest.component.html
@@ -1,26 +1,27 @@
+
\ No newline at end of file
+
diff --git a/codecamp-front/src/app/components/add-contest/add-contest.component.ts b/codecamp-front/src/app/components/add-contest/add-contest.component.ts
index 35951aa..cbfcb45 100644
--- a/codecamp-front/src/app/components/add-contest/add-contest.component.ts
+++ b/codecamp-front/src/app/components/add-contest/add-contest.component.ts
@@ -46,12 +46,22 @@ export class AddContestComponent implements OnInit {
endTime: this.form.get('endTime').value,
description: this.form.get('description').value
};
+ // console.log(typeof contest.startTime);
+ let time = contest.startTime;
+ time = new Date(time);
+ time = new Date(time.getTime() + 1000 * 60 * 60 * 5.5);
+ time = time.toISOString();
+ contest.startTime = time;
+ time = contest.endTime;
+ time = new Date(time);
+ time = new Date(time.getTime() + 1000 * 60 * 60 * 5.5);
+ time = time.toISOString();
+ contest.endTime = time;
this.contestService.addContest(contest).subscribe(data => {
if (!data.success) {
console.log(data.msg);
} else {
- console.log(contest.endTime)
- this.router.navigate(['/contest']);
+ this.router.navigate(['/iwedge/contest']);
}
});
}
diff --git a/codecamp-front/src/app/components/add-problem/add-problem.component.html b/codecamp-front/src/app/components/add-problem/add-problem.component.html
index 591a67c..ac407ec 100644
--- a/codecamp-front/src/app/components/add-problem/add-problem.component.html
+++ b/codecamp-front/src/app/components/add-problem/add-problem.component.html
@@ -1,3 +1,4 @@
+
@@ -33,7 +34,7 @@
formControlName="level"
class="form-control"
placeholder="Problem Level"
- autocomplete="off"
+
[ngClass]="{'is-invalid': (form.controls.level.errors && form.controls.level.dirty) , 'is-valid': !form.controls.level.errors}">
@@ -45,7 +46,7 @@
formControlName="author"
class="form-control"
placeholder="Author Name"
- autocomplete="off"
+
[ngClass]="{'is-invalid': (form.controls.author.errors && form.controls.author.dirty) , 'is-valid': !form.controls.author.errors}">
@@ -72,7 +73,7 @@
formControlName="output_format"
class="form-control"
placeholder="output_format"
- autocomplete="off"
+
[ngClass]="{'is-invalid': (form.controls.output_format.errors && form.controls.output_format.dirty) , 'is-valid': !form.controls.output_format.errors}">
@@ -129,7 +130,7 @@
formControlName="input_example"
class="form-control"
placeholder="Input TestCase"
- autocomplete="off"
+
[ngClass]="{'is-invalid': (form.controls.input_example.errors && form.controls.input_example.dirty) , 'is-valid': !form.controls.input_example.errors}">
@@ -142,7 +143,7 @@
formControlName="output_example"
class="form-control"
placeholder="Output Test case"
- autocomplete="off"
+
[ngClass]="{'is-invalid': (form.controls.output_example.errors && form.controls.output_example.dirty) , 'is-valid': !form.controls.output_example.errors}">
@@ -174,8 +175,16 @@
+
+ Score
+
+
diff --git a/codecamp-front/src/app/components/add-problem/add-problem.component.ts b/codecamp-front/src/app/components/add-problem/add-problem.component.ts
index 0d64400..b58a0bd 100644
--- a/codecamp-front/src/app/components/add-problem/add-problem.component.ts
+++ b/codecamp-front/src/app/components/add-problem/add-problem.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ViewChild } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { ContestService } from '../../services/contest.service';
import { Router, ActivatedRoute } from '@angular/router';
@@ -43,7 +43,8 @@ export class AddProblemComponent implements OnInit {
sourcelimit: ['', Validators.required],
author: ['', Validators.required],
Input: ['', Validators.required],
- Output: ['', Validators.required]
+ Output: ['', Validators.required],
+ score: ['', Validators.required]
});
}
onFileChange1(event) {
@@ -93,9 +94,10 @@ export class AddProblemComponent implements OnInit {
timelimit: this.form.get('timelimit').value,
sourcelimit: this.form.get('sourcelimit').value,
author: this.form.get('author').value,
- testCaseInput: this.Input,
- testCaseOutput: this.Output,
- image: this.image
+ testCaseInput: atob(this.Input),
+ testCaseOutput: atob(this.Output),
+ image: this.image,
+ score: this.form.get('score').value
};
diff --git a/codecamp-front/src/app/components/comment/comment.component.css b/codecamp-front/src/app/components/comment/comment.component.css
new file mode 100644
index 0000000..92b4062
--- /dev/null
+++ b/codecamp-front/src/app/components/comment/comment.component.css
@@ -0,0 +1,13 @@
+.pb-cmnt-container {
+ font-family: Lato;
+ margin-top: 10px;
+}
+
+.pb-cmnt-textarea {
+ resize: none;
+ padding: 20px;
+ height: 130px;
+ width: 100%;
+ margin-bottom: 10px;
+ border: 1px solid #F2F2F2;
+}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/comment/comment.component.html b/codecamp-front/src/app/components/comment/comment.component.html
new file mode 100644
index 0000000..34294d2
--- /dev/null
+++ b/codecamp-front/src/app/components/comment/comment.component.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Comment
+
+
+
+
+
+
diff --git a/codecamp-front/src/app/components/comment/comment.component.spec.ts b/codecamp-front/src/app/components/comment/comment.component.spec.ts
new file mode 100644
index 0000000..bcac3f2
--- /dev/null
+++ b/codecamp-front/src/app/components/comment/comment.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CommentComponent } from './comment.component';
+
+describe('CommentComponent', () => {
+ let component: CommentComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CommentComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CommentComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/codecamp-front/src/app/components/comment/comment.component.ts b/codecamp-front/src/app/components/comment/comment.component.ts
new file mode 100644
index 0000000..4ab8879
--- /dev/null
+++ b/codecamp-front/src/app/components/comment/comment.component.ts
@@ -0,0 +1,70 @@
+import { Component, OnInit } from '@angular/core';
+import { Router, ActivatedRoute } from '@angular/router';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { ContestService } from '../../services/contest.service';
+
+@Component({
+ selector: 'app-comment',
+ templateUrl: './comment.component.html',
+ styleUrls: ['./comment.component.css']
+})
+export class CommentComponent implements OnInit {
+ form: FormGroup;
+
+ constructor(
+ private contestService: ContestService,
+ private router: Router,
+ private route: ActivatedRoute,
+ private formBuilder: FormBuilder
+ ) {
+ this.createForm();
+ }
+ comments = [];
+ code;
+ contest;
+ username;
+ isAdmin;
+ ngOnInit() {
+ this.code = this.route.snapshot.params['problem'];
+ this.contest = this.route.snapshot.params['contest'];
+ this.username = JSON.parse(localStorage.getItem('user'));
+ this.isAdmin = this.username.isAdmin;
+ this.contestService.getComments(this.code, this.contest).subscribe((comment) => {
+ if (comment.success) {
+ this.comments = comment.msg;
+ // console.log(comment);
+ }
+ });
+ }
+
+ createForm() {
+ this.form = this.formBuilder.group({
+ comment: ['', Validators.compose([
+ Validators.required,
+ Validators.maxLength(100)
+ ])]
+ });
+ }
+
+ onCommentSubmit() {
+ const comment = this.form.get('comment').value;
+ // console.log(comment);
+ this.contestService.postComments(this.code, this.contest, comment, this.username)
+ .subscribe((comments) => {
+ // console.log(comments);
+ });
+ this.router.navigate([`/contest/${this.contest}/${this.code}`]);
+ }
+
+ onDeleteComment(comment, user) {
+ if (this.isAdmin) {
+ const comments = { comment : comment, username : user };
+ // console.log(comments);
+ this.contestService.deleteComments(this.code, this.contest, comments)
+ .subscribe((res) => {
+ // console.log(res);
+ });
+ this.router.navigate([`/contest/${this.contest}/${this.code}`]);
+ }
+ }
+}
diff --git a/codecamp-front/src/app/components/contact/contact.component.css b/codecamp-front/src/app/components/contact/contact.component.css
new file mode 100644
index 0000000..d431ebb
--- /dev/null
+++ b/codecamp-front/src/app/components/contact/contact.component.css
@@ -0,0 +1,39 @@
+img{
+ height:260px;
+ width: 100% !important;
+ margin-bottom: 30px;
+}
+input{
+ margin-bottom: 20px;
+ padding: 10px;
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
+}
+textarea{
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
+ padding: 10px;
+ margin-bottom: 20px;
+}
+p{
+ font-size: 17px;
+}
+.disp{
+ font-size: 35px;
+}
+button{
+ margin-top: 10px;
+ background: rgb(2, 112, 79);
+ color:black;
+}
+#ques{
+ margin-top: 7px;
+}
+#pa{
+ font-size: 17px;
+}
+#pas{
+ font-size: 22px;
+ font-style: italic;
+}
+#sp{
+ color: rgb(65, 82, 235);
+}
diff --git a/codecamp-front/src/app/components/contact/contact.component.html b/codecamp-front/src/app/components/contact/contact.component.html
new file mode 100644
index 0000000..a2ff259
--- /dev/null
+++ b/codecamp-front/src/app/components/contact/contact.component.html
@@ -0,0 +1,61 @@
+
+
+
+
diff --git a/codecamp-front/src/app/components/contact/contact.component.spec.ts b/codecamp-front/src/app/components/contact/contact.component.spec.ts
new file mode 100644
index 0000000..427633e
--- /dev/null
+++ b/codecamp-front/src/app/components/contact/contact.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ContactComponent } from './contact.component';
+
+describe('ContactComponent', () => {
+ let component: ContactComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ContactComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ContactComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/codecamp-front/src/app/components/contact/contact.component.ts b/codecamp-front/src/app/components/contact/contact.component.ts
new file mode 100644
index 0000000..432c729
--- /dev/null
+++ b/codecamp-front/src/app/components/contact/contact.component.ts
@@ -0,0 +1,52 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { FlashMessagesService } from 'angular2-flash-messages';
+import { AuthService } from '../../services/auth.service';
+
+@Component({
+ selector: 'app-contact',
+ templateUrl: './contact.component.html',
+ styleUrls: ['./contact.component.css']
+})
+export class ContactComponent implements OnInit {
+ form: FormGroup;
+ constructor(
+ private router: Router,
+ private authService: AuthService,
+ private formBuilder: FormBuilder,
+ private _flashMessagesService: FlashMessagesService
+ ) {
+ this.createForm();
+ }
+
+ ngOnInit() {
+ }
+
+ createForm() {
+ this.form = this.formBuilder.group({
+ name: '',
+ email_id: '',
+ message: ''
+ });
+ }
+ onSend() {
+ const user = JSON.parse(localStorage.getItem('user'));
+ const msg = {
+ name: user.username,
+ email_id: this.form.get('email_id').value,
+ message: this.form.get('message').value
+ };
+ // console.log(this.form.get('name').value)
+ // console.log(msg);
+ this.authService.sendFeedback(msg).subscribe((res) => {
+ // console.log(res);
+ if (res.success) {
+ this._flashMessagesService.show(res.msg, { cssClass: 'alert-primary', timeout: 10000});
+ } else {
+ this._flashMessagesService.show(res.msg, { cssClass: 'alert-danger', timeout: 10000});
+ }
+ this.router.navigate(['/']);
+ });
+ }
+}
diff --git a/codecamp-front/src/app/components/contest/contest.component.css b/codecamp-front/src/app/components/contest/contest.component.css
index 8e5bfe5..6e122bf 100644
--- a/codecamp-front/src/app/components/contest/contest.component.css
+++ b/codecamp-front/src/app/components/contest/contest.component.css
@@ -2,7 +2,7 @@
background: white;
border-bottom: 1px solid rgba(39,39,39,.1);
padding: 1% 1%;
- box-shadow: 0 1px 15px 1px rgba(39,39,39,.1);
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
cursor: pointer;
font-size: 14px;
}
@@ -27,4 +27,4 @@
}
.col-md-2 {
text-align: center;
-}
\ No newline at end of file
+}
diff --git a/codecamp-front/src/app/components/contest/contest.component.html b/codecamp-front/src/app/components/contest/contest.component.html
index adb4c00..1a0431f 100644
--- a/codecamp-front/src/app/components/contest/contest.component.html
+++ b/codecamp-front/src/app/components/contest/contest.component.html
@@ -1,3 +1,4 @@
+
@@ -9,9 +10,9 @@
-
+
Present Contest
-
+
Contest
@@ -29,7 +30,7 @@
Present Contest
class="nav-link contest"
*ngFor="let i of contest"
(click)="onSelectContest(i)">
-
+
{{i.name}}
@@ -41,6 +42,6 @@
Present Contest
-
+
diff --git a/codecamp-front/src/app/components/contest/contest.component.ts b/codecamp-front/src/app/components/contest/contest.component.ts
index 82a2820..6ecafe3 100644
--- a/codecamp-front/src/app/components/contest/contest.component.ts
+++ b/codecamp-front/src/app/components/contest/contest.component.ts
@@ -29,6 +29,7 @@ export class ContestComponent implements OnInit {
}
replaceTZ(time) {
+ // console.log(time);
return time && time.replace(/[TZ]|.000/g, '
');
}
onSelectContest(i) {
diff --git a/codecamp-front/src/app/components/discuss/discuss.component.html b/codecamp-front/src/app/components/discuss/discuss.component.html
index a29f0ad..7a1ea61 100644
--- a/codecamp-front/src/app/components/discuss/discuss.component.html
+++ b/codecamp-front/src/app/components/discuss/discuss.component.html
@@ -1,3 +1,4 @@
+
discuss works!
diff --git a/codecamp-front/src/app/components/edit-profile/edit-profile.component.css b/codecamp-front/src/app/components/edit-profile/edit-profile.component.css
index e69de29..3462e22 100644
--- a/codecamp-front/src/app/components/edit-profile/edit-profile.component.css
+++ b/codecamp-front/src/app/components/edit-profile/edit-profile.component.css
@@ -0,0 +1,43 @@
+.container{
+ padding: 3%;
+ margin: 10%;
+ background: aliceblue;
+ box-shadow: 0 1px 15px 1px rgba(39,39,39,.1);
+}
+.row{
+ margin: 2%;
+}
+option[disabled] { display: none; }
+
+.form-control{
+ border-radius: 1.5rem;
+}
+input{
+ padding: 6px;
+ box-shadow: 0 1px 15px 1px rgba(39,39,39,.1);
+
+}
+label{
+ padding-top: 6px;
+}
+
+.sub{
+ margin-left: 13.7rem;
+}
+.form-control:focus{
+ border-color: none;
+ box-shadow: none;
+}
+
+.btn-primary {
+ background: #2ca8ff;
+ border-color: #2ca8ff;
+ border-radius: 0;
+}
+input, select, label{
+ font-size: 22px;
+}
+#save{
+ padding:10px;
+ margin-left: 50%;
+}
diff --git a/codecamp-front/src/app/components/edit-profile/edit-profile.component.html b/codecamp-front/src/app/components/edit-profile/edit-profile.component.html
index fbf98d4..daa4e61 100644
--- a/codecamp-front/src/app/components/edit-profile/edit-profile.component.html
+++ b/codecamp-front/src/app/components/edit-profile/edit-profile.component.html
@@ -1,3 +1,62 @@
-
- Edit-profile works
-
+
+
+
+
+
+
+
+
+
+
+
+
+
Gender
+
+
+ Choose...
+ Male
+ Female
+
+
+
+
+
+
+
+
diff --git a/codecamp-front/src/app/components/edit-profile/edit-profile.component.ts b/codecamp-front/src/app/components/edit-profile/edit-profile.component.ts
index 0c411aa..3310920 100644
--- a/codecamp-front/src/app/components/edit-profile/edit-profile.component.ts
+++ b/codecamp-front/src/app/components/edit-profile/edit-profile.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';
+import { FlashMessagesService } from 'angular2-flash-messages';
@Component({
@@ -12,17 +13,61 @@ import { Router } from '@angular/router';
export class EditProfileComponent implements OnInit {
user;
+ form: FormGroup;
+
constructor(
private authService: AuthService,
- private router: Router
+ private formBuilder: FormBuilder,
+ private router: Router,
+ private _flashMessagesService: FlashMessagesService
) {
this.user = authService.getProfile().subscribe(profile => {
this.user = profile.msg;
- //console.log(JSON.stringify(this.user));
+
+ // console.log(profile);
});
- //console.log(this.user);
+ this.createForm();
+ // console.log(this.user);
}
ngOnInit() {
}
+ createForm() {
+ this.form = this.formBuilder.group({
+ name: this.user.name,
+ email_id: this.user.email_id,
+ username: this.user.username,
+ contact_number: this.user.contact_number,
+ dob: this.user.dob,
+ gender: this.user.gender,
+ city: this.user.city,
+ college: this.user.college
+
+ });
+ }
+ replaceTZ(time) {
+ if(time !== undefined ){
+ let t1 = time.replace(/[TZ]|.000/g , ' ');
+ t1 = t1.split(' ');
+ return t1[0];
+ }
+ }
+ onEdit() {
+ const usr = {
+ name: this.form.get('name').value ? this.form.get('name').value : this.user.name,
+ username: this.form.get('username').value ? this.form.get('username').value : this.user.username,
+ email_id: this.form.get('email_id').value ? this.form.get('email_id').value : this.user.email_id,
+ contact_number: this.form.get('contact_number').value ? this.form.get('contact_number').value : this.user.contact_number,
+ college: this.form.get('college').value ? this.form.get('college').value : this.user.college,
+ city: this.form.get('city').value ? this.form.get('city').value : this.user.city,
+ dob: this.form.get('dob').value ? this.form.get('dob').value : this.user.dob,
+ gender: this.form.get('gender').value ? this.form.get('gender').value : this.user.gender,
+ joinedOn: this.user.joinedOn
+ };
+ this.authService.editUser(usr).subscribe(data => {
+ // console.log(data);
+ this._flashMessagesService.show(data.msg, { cssClass: 'alert-success', timeout: 2000});
+ this.router.navigate(['/profile']);
+ });
+ }
}
diff --git a/codecamp-front/src/app/components/footer/footer.component.css b/codecamp-front/src/app/components/footer/footer.component.css
new file mode 100644
index 0000000..1cf01d1
--- /dev/null
+++ b/codecamp-front/src/app/components/footer/footer.component.css
@@ -0,0 +1,27 @@
+.footer {
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ height: 20%!important;
+ background: radial-gradient( #c5ced0 0%, #f4faf5 100%);
+ color: rgb(21, 62, 245);
+ text-align: center;
+}
+.design{
+ padding-right: 5%;
+ float: right;
+}
+img{
+ height: 50px;
+}
+#image{
+ height:60px;
+ width: 140px;
+}
+.col-md-3{
+ padding-top: 20px;
+ text-align: center;
+}
+i{
+ padding-left:5px;
+}
diff --git a/codecamp-front/src/app/components/footer/footer.component.html b/codecamp-front/src/app/components/footer/footer.component.html
new file mode 100644
index 0000000..4bc317e
--- /dev/null
+++ b/codecamp-front/src/app/components/footer/footer.component.html
@@ -0,0 +1,18 @@
+
+
diff --git a/codecamp-front/src/app/components/footer/footer.component.spec.ts b/codecamp-front/src/app/components/footer/footer.component.spec.ts
new file mode 100644
index 0000000..2ca6c45
--- /dev/null
+++ b/codecamp-front/src/app/components/footer/footer.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { FooterComponent } from './footer.component';
+
+describe('FooterComponent', () => {
+ let component: FooterComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ FooterComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FooterComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/codecamp-front/src/app/components/footer/footer.component.ts b/codecamp-front/src/app/components/footer/footer.component.ts
new file mode 100644
index 0000000..67f1378
--- /dev/null
+++ b/codecamp-front/src/app/components/footer/footer.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-footer',
+ templateUrl: './footer.component.html',
+ styleUrls: ['./footer.component.css']
+})
+export class FooterComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/codecamp-front/src/app/components/forgot-password/forgot-password.component.css b/codecamp-front/src/app/components/forgot-password/forgot-password.component.css
new file mode 100644
index 0000000..849b889
--- /dev/null
+++ b/codecamp-front/src/app/components/forgot-password/forgot-password.component.css
@@ -0,0 +1,31 @@
+card-body{
+ padding: 3%;
+ }
+ .card {
+ margin: 3% 10%;
+ box-shadow: 0 1px 15px 1px rgba(39,39,39,.1);
+ }
+
+ .form-control{
+ border-radius: 1.5rem;
+ }
+
+ label{
+ padding-top: 6px;
+ }
+
+ .sub{
+ margin-left: 13.7rem;
+ }
+ .form-control:focus{
+ border-color: none;
+ box-shadow: none;
+ }
+
+ .btn-primary {
+ background: #2ca8ff;
+ right: 0;
+ border-color: #2ca8ff;
+ border-radius: 0;
+ }
+
diff --git a/codecamp-front/src/app/components/forgot-password/forgot-password.component.html b/codecamp-front/src/app/components/forgot-password/forgot-password.component.html
new file mode 100644
index 0000000..65bf618
--- /dev/null
+++ b/codecamp-front/src/app/components/forgot-password/forgot-password.component.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
Enter the email address associated with your HackerCamp account.
+
+
+
+
+
+
+
+
diff --git a/codecamp-front/src/app/components/forgot-password/forgot-password.component.spec.ts b/codecamp-front/src/app/components/forgot-password/forgot-password.component.spec.ts
new file mode 100644
index 0000000..9c1a932
--- /dev/null
+++ b/codecamp-front/src/app/components/forgot-password/forgot-password.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ForgotPasswordComponent } from './forgot-password.component';
+
+describe('ForgotPasswordComponent', () => {
+ let component: ForgotPasswordComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ForgotPasswordComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ForgotPasswordComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/codecamp-front/src/app/components/forgot-password/forgot-password.component.ts b/codecamp-front/src/app/components/forgot-password/forgot-password.component.ts
new file mode 100644
index 0000000..06d814a
--- /dev/null
+++ b/codecamp-front/src/app/components/forgot-password/forgot-password.component.ts
@@ -0,0 +1,46 @@
+import { Component, OnInit } from '@angular/core';
+import { FormGroup, FormBuilder, Validators } from '@angular/forms';
+import { Router } from '@angular/router';
+import { FlashMessagesService } from 'angular2-flash-messages';
+import { AuthService } from '../../services/auth.service';
+
+@Component({
+ selector: 'app-forgot-password',
+ templateUrl: './forgot-password.component.html',
+ styleUrls: ['./forgot-password.component.css']
+})
+export class ForgotPasswordComponent implements OnInit {
+ form: FormGroup;
+ constructor(
+ private authService: AuthService,
+ private router: Router,
+ private formBuilder: FormBuilder,
+ private _flashMessagesService: FlashMessagesService
+ ) {
+ this.createForm();
+ }
+
+ ngOnInit() {
+ }
+ createForm() {
+ this.form = this.formBuilder.group({
+ email_id: ['', Validators.required]
+ });
+}
+onForgot() {
+ const user = {
+ email_id: this.form.get('email_id').value, // Email input field
+ };
+ this.authService.forgetPassword(user).subscribe(data => {
+ if (data.success) {
+ this._flashMessagesService.show(data.msg, { cssClass: 'alert-success', timeout: 2000 });
+ this.router.navigate(['/login']);
+ } else {
+ this._flashMessagesService.show(data.msg, { cssClass: 'alert-danger', timeout: 2000 });
+ }
+ });
+
+ //console.log(user);
+
+}
+}
diff --git a/codecamp-front/src/app/components/home/home.component.css b/codecamp-front/src/app/components/home/home.component.css
index ac3df0b..aa9f549 100644
--- a/codecamp-front/src/app/components/home/home.component.css
+++ b/codecamp-front/src/app/components/home/home.component.css
@@ -42,3 +42,15 @@
max-width: 500px;
margin: 10px auto 0;
}
+
+.col-md-9,.col-md-3{
+ padding: 0%;
+}
+
+.alert{
+ border-radius: 0;
+}
+
+.alert-light{
+ padding: 4.1% 10px;
+}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/home/home.component.html b/codecamp-front/src/app/components/home/home.component.html
index 90cfc7f..9f26823 100644
--- a/codecamp-front/src/app/components/home/home.component.html
+++ b/codecamp-front/src/app/components/home/home.component.html
@@ -5,12 +5,54 @@
-
CodeCamp
+ HackerCamp
-
Eat, Code, Sleep and Repeat
-
\ No newline at end of file
+
+
+
+
+
+ New to Coding and want to know where to start from?
+ Get Started
+
+
+
+
+
+
HackerCamp - A Platform for Aspiring Programmers
+
+
+ HackerCamp was created as a platform to help programmers make it big in the world of algorithms, computer programming and programming contests.
+ At HackerCamp we work hard to revive the geek in you by hosting a programming contest at the start of the month and another smaller programming challenge in the middle of the month. We also aim to have training sessions and discussions related to algorithms, binary search, technicalities like array size and the likes. Apart from providing a platform for programming competitions, and forum discussions to help those who are new to the world of computer programming.
+
+
+
+ Practice Section - A Place to home your 'Computer Programming Skills'
+ Try your hand at one of our many practice problems and submit your solution in a language of your choice. Our programming contest judge accepts solutions in over 4 programming languages. Preparing for coding contests were never this much fun!. Use our practice section to better prepare yourself for the multiple programming challenges that take place through-out the month on HackerCamp.
+
+ Compete - Monthly Programming Contests
+ Here is where you can show off your computer programming skills.
+
+
diff --git a/codecamp-front/src/app/components/home/home.component.ts b/codecamp-front/src/app/components/home/home.component.ts
index 33fd770..59c9470 100644
--- a/codecamp-front/src/app/components/home/home.component.ts
+++ b/codecamp-front/src/app/components/home/home.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
@Component({
selector: 'app-home',
@@ -7,9 +8,13 @@ import { Component, OnInit } from '@angular/core';
})
export class HomeComponent implements OnInit {
- constructor() { }
+ constructor(
+ private router: Router
+ ) { }
ngOnInit() {
}
-
+ onGetStarted(){
+ this.router.navigate(['/practice']);
+ }
}
diff --git a/codecamp-front/src/app/components/ide/ide.component.css b/codecamp-front/src/app/components/ide/ide.component.css
index 8fad2a6..163df3f 100644
--- a/codecamp-front/src/app/components/ide/ide.component.css
+++ b/codecamp-front/src/app/components/ide/ide.component.css
@@ -1,23 +1,56 @@
-.file-upload{
- padding: 10px;
- background: red;
- display: table;
- color: #fff;
-}
+.insingleblock{
+ box-shadow: 0 1px 15px 1px rgba(14, 14, 14, 0.1);
+ border-radius: 4px;
+ background-color: white;
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
+ }
-input[type="file"] {
- display: none;
+.ace-editor{
+ font-size: 18px!important;
}
textarea{
overflow-x: hidden;
+ padding: 5px;
+ width:100%;
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.select {
- margin: 2% 1%;
+ margin: 0px;
+ margin-bottom: 4px;
+ padding: 1%;
+ padding-left: 2%;
+ background: gray;
+ color: white;
+}
+.choose{
+ margin: 2%;
+ margin-bottom: 0;
+ padding-bottom: 2%;
}
-
.options{
- margin-left: 2%;
-}
\ No newline at end of file
+ margin-left: 2%;
+}
+#text{
+ width:100%;
+
+}
+
+.sub{
+ margin-bottom: 2%;
+}
+#myOutputArea{
+ border: 1px solid black;
+ background:aliceblue;
+ padding-top: 2%;
+ padding-left: 3%;
+ padding-right: 3%;
+ padding-bottom: 3%;
+ font-size: 18px;
+}
+
+.output{
+ background: blue;
+}
diff --git a/codecamp-front/src/app/components/ide/ide.component.html b/codecamp-front/src/app/components/ide/ide.component.html
index 4c23b3c..2d5c9a3 100644
--- a/codecamp-front/src/app/components/ide/ide.component.html
+++ b/codecamp-front/src/app/components/ide/ide.component.html
@@ -1,9 +1,8 @@
-
+
+
+
+
Status: {{output.msg}}
+
Time: {{output.time}}
+
+
+
+
+
+
+
+
+
+
diff --git a/codecamp-front/src/app/components/ide/ide.component.ts b/codecamp-front/src/app/components/ide/ide.component.ts
index 7e892a9..0a37ae8 100644
--- a/codecamp-front/src/app/components/ide/ide.component.ts
+++ b/codecamp-front/src/app/components/ide/ide.component.ts
@@ -1,7 +1,9 @@
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, OnInit, ViewChild,NgModule } from '@angular/core';
import { EventEmitter } from '@angular/core';
-import { Router } from '@angular/router';
+import { Router, ActivatedRoute } from '@angular/router';
import { AceEditorModule } from 'ng2-ace-editor';
+import { FormsModule } from '@angular/forms';
+import { ContestService } from '../../services/contest.service';
declare var jquery: any;
declare var $: any;
@@ -11,28 +13,37 @@ declare var $: any;
styleUrls: ['./ide.component.css']
})
export class IdeComponent implements OnInit {
-/*
+
selectedLanguage = 'c_cpp';
content: string;
+ test;
currentFileUpload;
value;
ace;
- constructor() {
+ output;
+ input;
+ description;
+ language: string;
+ constructor(
+ private contestService: ContestService,
+ private route: ActivatedRoute,
+ private router: Router
+ ) {
this.content =
`#include
int main()
{
- printf("Welcome To CodeCamp");
+ printf("Welcome To HackerCamp");
} `;
}
-*/
+
ngOnInit() {
}
-/*
+
selectLanguage(event) {
this.selectedLanguage = event.target.value;
@@ -44,108 +55,56 @@ int main()
int main()
{
- printf("Welcome To CodeCamp");
+ printf("Welcome To HackerCamp");
return 0;
}`;
} else if (this.selectedLanguage === 'java') {
this.content =
`import java.util.*;
-public class Solution {
+public class Main {
public static void main(String[] args) {
- System.out.print("Welcome To CodeCamp");
+ System.out.print("Welcome To HackerCamp");
}
}
`;
} else if (this.selectedLanguage === 'python') {
- this.content = `print("Welcome To CodeCamp")`;
+ this.content = `print("Welcome To HackerCamp")`;
}
}
-onRun() {
- const lang = $('#select').val();
- const editor = this.ace.edit('description');
- this.content = editor.getValue('description');
- const p = this.content;
- this.currentFileUpload = btoa(p);
-}
-*/
-}
-
-
-
-
-/*
-
-import { Component, OnInit, ViewChild, Output} from '@angular/core';
-import { ActivatedRoute } from '@angular/router';
-import { AuthService } from '../../services/auth.service';
-import { ContestService } from '../../services/contest.service';
-import { EventEmitter } from '@angular/core';
-import { Router } from '@angular/router';
-import { AceEditorModule } from 'ng2-ace-editor';
-declare var jquery: any;
-declare var $: any;
-
-@Component({
- selector: 'app-solultion-submit',
- templateUrl: './solultion-submit.component.html',
- styleUrls: ['./solultion-submit.component.css']
-})
-export class SolultionSubmitComponent implements OnInit {
- selectedLanguage = 'c_cpp';
- content;
- problem;
- contest;
- username;
- solution;
- language: string;
- currentFileUpload;
- value;
- @ViewChild('userFile') user_file;
- constructor(
- private contestService: ContestService,
- private route: ActivatedRoute,
- private authService: AuthService,
-
-
-
- onFileChange(event){
- let reader = new FileReader();
- if (event.target.files && event.target.files.length > 0) {
- let file = event.target.files[0];
- reader.readAsDataURL(file);
- reader.onload = () => {
- this.value = reader.result.split(',')[1];
- };
+ myFunction() {
+ const checkBox = document.getElementById('myCheck');
+ const text = document.getElementById('input');
+ if (checkBox.checked === true) {
+ text.style.display = 'block';
+ } else {
+ text.style.display = 'none';
}
}
- onClickSubmit() {
- const lang = $('#select').val();
- const editor =ace.edit('description');
- this.content = editor.getValue('description');
- const p = this.content;
- if (this.value) {
- this.currentFileUpload = this.value;
- } else {
+ onRun() {
+ const lang = $('#select').val();
+ const p = this.content;
+ this.test = (document.getElementById('myTextarea') as HTMLInputElement).value;
this.currentFileUpload = btoa(p);
- }
- const solution = {
- problem : this.problem,
- contest: this.contest,
- username: this.username,
- language: lang,
- description: this.currentFileUpload
- };
- this.contestService.addSolution(solution).subscribe(data => {
- this.contestService.setSolution(data.msg);
- this.router.navigate(['/submit/complete']);
- });
+ const test1 = {
+ input: this.test,
+ language : lang,
+ description: this.currentFileUpload
+ };
+ this.contestService.addTest(test1).subscribe(data => {
+ this.output = this.contestService.getTest();
+ //console.log(this.output)
+ });
+ const text = document.getElementById('myOutputArea');
+ text.style.display = 'block';
}
+
}
-*/
+
+
diff --git a/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.css b/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.css
new file mode 100644
index 0000000..62f779b
--- /dev/null
+++ b/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.css
@@ -0,0 +1,31 @@
+
+.card {
+ background: #fff;
+ -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
+}
+.card img {
+ width: 100%;
+}
+
+[class*="row"] {
+ margin-bottom: 1em;
+ -webkit-box-pack: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+}
+
+[class*="col-"] {
+ padding-top: .75rem;
+ padding-bottom: .75rem;
+ width: 100%;
+}
+
+.card-block{
+ padding: 3%;
+}
+
+
+.ques{
+ min-height: 800px;
+}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.html b/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.html
new file mode 100644
index 0000000..bf475f4
--- /dev/null
+++ b/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.html
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{i.name}}
+
{{i.description}}
+
Grab Me!!
+
+
+
+
+
+
+
+
diff --git a/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.ts b/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.ts
new file mode 100644
index 0000000..9fc7d6b
--- /dev/null
+++ b/codecamp-front/src/app/components/iwedge/contestiw/contestiw.component.ts
@@ -0,0 +1,36 @@
+import { Component, OnInit } from '@angular/core';
+import { AuthService } from '../../../services/auth.service';
+import { ContestService } from '../../../services/contest.service';
+import { Router } from '@angular/router';
+
+@Component({
+ selector: 'app-contestiw',
+ templateUrl: './contestiw.component.html',
+ styleUrls: ['./contestiw.component.css']
+})
+export class ContestiwComponent implements OnInit {
+
+ contest;
+ contestname;
+ constructor(
+ public authService: AuthService,
+ private contestService: ContestService,
+ private router: Router
+ ) { }
+
+ ngOnInit() {
+ this.contestService.getContest().subscribe(
+ contest => {
+ this.contest = contest.contests;
+ });
+ }
+ onAddContest() {
+ this.router.navigate(['/contest/add-contest']);
+ }
+ onClickGrab(i){
+ this.contestname = i.name;
+ this.contestService.changeContest(this.contestname);
+ this.router.navigate(['/contest', i.id]);
+ }
+
+}
diff --git a/codecamp-front/src/app/components/iwedge/iwedge.component.css b/codecamp-front/src/app/components/iwedge/iwedge.component.css
new file mode 100644
index 0000000..e91000b
--- /dev/null
+++ b/codecamp-front/src/app/components/iwedge/iwedge.component.css
@@ -0,0 +1,53 @@
+
+.sample-header {
+ position: fixed;
+ top: 0;
+ width: 100%;
+ background-image: url(../../../assets/infinitywars.jpg);
+ background-position: center;
+ background-size: cover;
+ background-repeat: no-repeat;
+ height: 90vh;
+ }
+ .sample-header::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ opacity: 0.3;
+ }
+ .sample-header-section {
+ position: relative;
+ padding: 15% 0 10%;
+ max-width: 640px;
+ margin-left: auto;
+ margin-right: auto;
+ color: white;
+ }
+ h1 {
+ font-weight: 500;
+ }
+ h2 {
+ font-weight: 400;
+ }
+ .sample-section-wrap {
+ margin-top: 20rem!important;
+ position: relative;
+ background-color: white;
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
+ margin: 20rem 12%!important;
+ border-radius: 5px;
+
+}
+ .sample-section {
+ position: relative;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 40px;
+ }
+
+
+
+
+
diff --git a/codecamp-front/src/app/components/iwedge/iwedge.component.html b/codecamp-front/src/app/components/iwedge/iwedge.component.html
new file mode 100644
index 0000000..6f52388
--- /dev/null
+++ b/codecamp-front/src/app/components/iwedge/iwedge.component.html
@@ -0,0 +1,65 @@
+
+
+
+
Infinity War
+
+
+
+
ABOUT
+
+
Welcome to Infinity War, Online Coding event of EDGE'18 presented by Team Compute@id.
+ A 3-day event which is full of excitement and an arena is set to fight out.
+ Dive into this arena of battle to face off THANOS by forming your own AVENGERS team.
+
+ The more the strength of the team, more time you are going to get to knock THANOS out.
+
+ Compete against others and the one with the more problems solved will emerge as the Ultimate Savior of the Universe.
+
+
+
BRIEF ABOUT INFINITY WAR
+
+
As the Avengers and their allies have continued to protect the world from threats that are too large for any hero to handle, a new danger has emerged from the cosmic shadows: Thanos.
+ A despot of intergalactic infamy, his goal is to collect all six Infinity Stones, artifacts of unimaginable power, and use them to inflict his twisted will on all of reality.
+ Everything the Avengers have fought for has led up to this moment - the fate of Earth and its existence has never been more uncertain.
+
+
RULES
+
+
+ The Portal for Coding will come live on 30th March, 2018 at 19:00 IST.
+ You have got 10 AVENGERS character and 36 HRS to compete for and form a team of AVENGERS with as many characters you can.
+ The Characters are divided into three Grades which will have their own sets of Questions to solve.
+ The Third Grades slots are opened first. It will contain 4 characters Captain America, Ant Man, Spider Man and Black Widow.
+ Each will contain 3 Problems to solve.
+ The Second Grade slots are opened after 8 HRS of start. It will contain 3 characters Doctor Strange, Black Panther and Star Lord .
+ Each will contain 4 Problems to solve.
+
+ Note: You can still solve any of the grades all slots are opened anytime during first 36 HRS
+
+
+ The First and Final Grade slots are started after 16 HRS of start. It will contain 3 Major characters Iron Man, HULK and Thor .
+ Each will contain 4 Problems to solve.
+
+ Category wise rules are given inside contest.
+
+ FINAL SHOWDOWN
+
+ Scorelist freezes after First 36 HRS of the event and whatever be your score on basis of that, time will be calculated and that will
+ be the time limit to participate in the final showdown.
+
+ The Final Showdown will start at 19:00 IST on 1st April, 2018.
+ This round will be of 6 Problems to be solved. Each Wrong Subission or a TLE will fetch you a penalty. Be Confident on your algorithm.
+ The Tie breaker will be decided on penalties and Time taken for submission.
+ The One on the top of the Ranklist at the end would emerge as the Ultimate Winner of the Conquest against THANOS.
+
+
+
+
+ Participate
+
+
+
+
+
diff --git a/codecamp-front/src/app/components/iwedge/iwedge.component.ts b/codecamp-front/src/app/components/iwedge/iwedge.component.ts
new file mode 100644
index 0000000..a2baa4b
--- /dev/null
+++ b/codecamp-front/src/app/components/iwedge/iwedge.component.ts
@@ -0,0 +1,22 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+
+
+@Component({
+ selector: 'app-iwedge',
+ templateUrl: './iwedge.component.html',
+ styleUrls: ['./iwedge.component.css']
+})
+export class IwedgeComponent implements OnInit {
+
+ constructor(
+ private router: Router
+ ) { }
+
+ ngOnInit() {
+
+ }
+ onParticipateClick(){
+ this.router.navigate(['/iwedge/contest']);
+ }
+}
diff --git a/codecamp-front/src/app/components/login/login.component.css b/codecamp-front/src/app/components/login/login.component.css
index fab34af..328560b 100644
--- a/codecamp-front/src/app/components/login/login.component.css
+++ b/codecamp-front/src/app/components/login/login.component.css
@@ -15,7 +15,7 @@ label{
}
.sub{
- margin-left: 13.7rem;
+ margin-left: 13.7rem;
}
.form-control:focus{
border-color: none;
@@ -26,4 +26,19 @@ label{
background: #2ca8ff;
border-color: #2ca8ff;
border-radius: 0;
+}
+.fa {
+ float: right;
+ margin-right: 15px;
+ margin-top: -27px;
+ position: relative;
+ z-index: 2;
+ color: black;
+}
+.col-md-3{
+ padding: 1%;
+}
+
+.top{
+ min-height: 800px;
}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/login/login.component.html b/codecamp-front/src/app/components/login/login.component.html
index a740d04..6fb44ea 100644
--- a/codecamp-front/src/app/components/login/login.component.html
+++ b/codecamp-front/src/app/components/login/login.component.html
@@ -1,42 +1,52 @@
+
-
+
-
+
@@ -45,21 +55,21 @@ SIGN IN
+
-
-
+
+
+
-
+
-
\ No newline at end of file
+
diff --git a/codecamp-front/src/app/components/login/login.component.ts b/codecamp-front/src/app/components/login/login.component.ts
index 3eb104c..bf7ef5d 100644
--- a/codecamp-front/src/app/components/login/login.component.ts
+++ b/codecamp-front/src/app/components/login/login.component.ts
@@ -3,6 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';
import { FlashMessagesService } from 'angular2-flash-messages';
+import { NavbarComponent } from '../navbar/navbar.component';
@Component({
selector: 'app-login',
@@ -13,7 +14,9 @@ export class LoginComponent implements OnInit {
form: FormGroup;
message = false;
messageClass;
-
+ showPassword = false;
+ text = 'password';
+ iconOfHide = 'fa-eye-slash';
constructor(
private authService: AuthService,
private router: Router,
@@ -46,9 +49,20 @@ export class LoginComponent implements OnInit {
this._flashMessagesService.show(data.msg, { cssClass: 'alert-danger', timeout: 2000});
} else {
this.authService.storeUserData(data.token, data.user);
- this.authService.name.next(data.user);
+ NavbarComponent.updateName.next(true); // here!
this.router.navigate(['/']);
} // Navigate to dashboard view
});
}
+ onClick() {
+ this.showPassword = !this.showPassword;
+ // console.log(this.showPassword);
+ if ( this.showPassword ) {
+ this.text = 'text';
+ this.iconOfHide = 'fa-eye';
+ } else {
+ this.text = 'password';
+ this.iconOfHide = 'fa-eye-slash';
+ }
+ }
}
diff --git a/codecamp-front/src/app/components/navbar/navbar.component.css b/codecamp-front/src/app/components/navbar/navbar.component.css
index c8e38a9..9fc21b5 100644
--- a/codecamp-front/src/app/components/navbar/navbar.component.css
+++ b/codecamp-front/src/app/components/navbar/navbar.component.css
@@ -40,4 +40,4 @@
-ms-flex-negative: 0;
flex-shrink: 0;
}
-}
\ No newline at end of file
+}
diff --git a/codecamp-front/src/app/components/navbar/navbar.component.html b/codecamp-front/src/app/components/navbar/navbar.component.html
index 6f22b56..58f57c2 100644
--- a/codecamp-front/src/app/components/navbar/navbar.component.html
+++ b/codecamp-front/src/app/components/navbar/navbar.component.html
@@ -7,27 +7,29 @@
-
-->
-
+
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/navbar/navbar.component.ts b/codecamp-front/src/app/components/navbar/navbar.component.ts
index 2efb65f..bd84967 100644
--- a/codecamp-front/src/app/components/navbar/navbar.component.ts
+++ b/codecamp-front/src/app/components/navbar/navbar.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit, trigger, transition, animate, style,state } from '@a
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';
import { ContestService } from '../../services/contest.service';
+import { Subject } from 'rxjs/Subject';
@Component({
@@ -23,9 +24,10 @@ import { ContestService } from '../../services/contest.service';
})
export class NavbarComponent implements OnInit{
- user: any;
+ user: string;
users;
toggle = true;
+ public static updateName: Subject = new Subject();
constructor(
public authService: AuthService,
private router: Router,
@@ -34,14 +36,18 @@ export class NavbarComponent implements OnInit{
/*this.authService.name.subscribe(value => {
this.user = value ;
});*/
- this.users = authService.getProfile().subscribe(profile => {
+ NavbarComponent.updateName.subscribe(res => {
+ this.user = JSON.parse(localStorage.getItem('user'));
+ })
+ /*this.users = authService.getProfile().subscribe(profile => {
this.user = profile.msg.username;
//console.log(this.user);
- });
+ });*/
//console.log(this.user);
}
ngOnInit() {
+ this.user = JSON.parse(localStorage.getItem('user'))
this.contestService.toggle.subscribe(toggle => this.toggle = toggle);
}
@@ -49,12 +55,11 @@ export class NavbarComponent implements OnInit{
this.authService.logout(); // Logout user
this.router.navigate(['/']); // Navigate back to home page
}
- undefined() {
-
- }
- onToggle(){
+ onToggle() {
this.toggle = this.toggle? false:true;
this.contestService.ontoggle(this.toggle);
}
-
-}
+ onNotify() {
+ alert('I was clicked');
+ }
+}
\ No newline at end of file
diff --git a/judge/result/output/MARCH18/11.txt b/codecamp-front/src/app/components/notification/notification.component.css
similarity index 100%
rename from judge/result/output/MARCH18/11.txt
rename to codecamp-front/src/app/components/notification/notification.component.css
diff --git a/codecamp-front/src/app/components/notification/notification.component.html b/codecamp-front/src/app/components/notification/notification.component.html
new file mode 100644
index 0000000..eee340e
--- /dev/null
+++ b/codecamp-front/src/app/components/notification/notification.component.html
@@ -0,0 +1,3 @@
+
+ notification works!
+
diff --git a/codecamp-front/src/app/components/notification/notification.component.spec.ts b/codecamp-front/src/app/components/notification/notification.component.spec.ts
new file mode 100644
index 0000000..69192c5
--- /dev/null
+++ b/codecamp-front/src/app/components/notification/notification.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { NotificationComponent } from './notification.component';
+
+describe('NotificationComponent', () => {
+ let component: NotificationComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ NotificationComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(NotificationComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/codecamp-front/src/app/components/notification/notification.component.ts b/codecamp-front/src/app/components/notification/notification.component.ts
new file mode 100644
index 0000000..aedfe75
--- /dev/null
+++ b/codecamp-front/src/app/components/notification/notification.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-notification',
+ templateUrl: './notification.component.html',
+ styleUrls: ['./notification.component.css']
+})
+export class NotificationComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/codecamp-front/src/app/components/practice/practice.component.css b/codecamp-front/src/app/components/practice/practice.component.css
index af64cdb..c0ee3c3 100644
--- a/codecamp-front/src/app/components/practice/practice.component.css
+++ b/codecamp-front/src/app/components/practice/practice.component.css
@@ -1,22 +1,52 @@
-p{
- margin: 8px 0;
+.container{
+ min-height: 800px;
}
-.title{
- padding-top: 10px;
- background: #343a40;
- color: white;
+.problem{
+ background: white;
+ border-bottom: 1px solid rgba(39,39,39,.1);
+ padding: 1% 0.5%;
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
+ cursor: pointer;
}
-a{
- color: black;
- padding: 0;
+
+.breadcrumb{
+ background-color: inherit;
+ padding-top: 2%;
+ margin: 0;
}
-hr{
+.head {
+ padding: 2%;
+ font-size: 14px;
+ font-weight: bold;
+ background: #111;
+ color: #fff;
+}
+.row{
margin: 0;
- border: 0.5px solid grey;
}
-.problem{
+
+.col-md-3 {
+ text-align: center;
+}
+
+.display-4{
+ padding-left: 1%;
+}
+.main {
+ margin-top: 1%;
background: white;
-}
\ No newline at end of file
+ padding: 2%;
+ border: 4px;
+}
+
+#timer{
+ color: red;
+ margin-right: 13px;
+}
+button.btn.btn-info{
+ margin-top:4%;
+}
+
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/practice/practice.component.html b/codecamp-front/src/app/components/practice/practice.component.html
index 9cca746..469fea3 100644
--- a/codecamp-front/src/app/components/practice/practice.component.html
+++ b/codecamp-front/src/app/components/practice/practice.component.html
@@ -1,28 +1,30 @@
-
-
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/practice/practice.component.ts b/codecamp-front/src/app/components/practice/practice.component.ts
index 562bf15..140845e 100644
--- a/codecamp-front/src/app/components/practice/practice.component.ts
+++ b/codecamp-front/src/app/components/practice/practice.component.ts
@@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
+import { ContestService } from '../../services/contest.service';
+import { AuthService } from '../../services/auth.service';
+import { Router } from '@angular/router';
@Component({
selector: 'app-practice',
@@ -7,8 +10,21 @@ import { Component, OnInit } from '@angular/core';
})
export class PracticeComponent implements OnInit {
- constructor() { }
+ problems;
+ p;
+ constructor(
+ private contestService: ContestService,
+ private authService: AuthService,
+ private router: Router
+ ) { }
ngOnInit() {
+ this.contestService.getPracticeProblems().subscribe((data) => {
+ this.problems = data.msg;
+ })
}
+
+ onSelectProblem(contest,code){
+ this.router.navigate(['/practice', contest,code]);
+ }
}
diff --git a/codecamp-front/src/app/components/problem/problem.component.css b/codecamp-front/src/app/components/problem/problem.component.css
index 6222c1c..1be0f6e 100644
--- a/codecamp-front/src/app/components/problem/problem.component.css
+++ b/codecamp-front/src/app/components/problem/problem.component.css
@@ -1,6 +1,6 @@
.main {
background: white;
- box-shadow: 0 1px 15px 1px rgba(39,39,39,.1);
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
padding-top: 30px;
}
@@ -16,9 +16,6 @@ h6{
font-weight: bold;
}
-button{
- margin-left: 3.5%;
-}
p{
font-size: 15px;
}
@@ -26,4 +23,26 @@ p{
border: 1px solid #111;
padding: 5%;
background-color: rgb(201, 252, 235);
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
+}
+
+
+.side{
+ height: 60vh;
+ overflow-y: scroll;
+ overflow-x: hidden;
}
+
+.head {
+ padding: 2%;
+ font-size: 14px;
+ font-weight: bold;
+ background: #2c3e50;
+ color: #fff;
+ text-align: center;
+}
+
+.score{
+ font-size: 18px;
+ font-weight: bolder;
+}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/problem/problem.component.html b/codecamp-front/src/app/components/problem/problem.component.html
index c2bcf44..baae179 100644
--- a/codecamp-front/src/app/components/problem/problem.component.html
+++ b/codecamp-front/src/app/components/problem/problem.component.html
@@ -1,57 +1,75 @@
+
-
-
{{ problem?.name }}
-
-
-
Problem Code: {{ problem?.code }}
+
+
+
{{ problem?.name }}
+
+
+
Problem Code: {{ problem?.code }}
+
-
-
- Submit
-
-
-
+
+
+ Submit
+
+
-
Problem Statement:
-
{{ problem?.description}}
+
Input
-
{{ problem?.input_format}}
+
Output
-
{{ problem?.output_format }}
+
Constraints
-
{{problem?.constraints}}
+
-
+
+
+
+ Time/Date
+
+
+ Res
+
+
+ Lang
+
+
+ Code
+
+
+
@@ -59,9 +77,16 @@
Explanations
Time Limit: ms
- Source Limit: byte
+ Source Limit: byte
Author:
Languages: C, C++, Java, Python
+
+
+
+
diff --git a/codecamp-front/src/app/components/problem/problem.component.ts b/codecamp-front/src/app/components/problem/problem.component.ts
index acfd0be..6ccf0d3 100644
--- a/codecamp-front/src/app/components/problem/problem.component.ts
+++ b/codecamp-front/src/app/components/problem/problem.component.ts
@@ -16,6 +16,8 @@ export class ProblemComponent implements OnInit {
contest;
problem;
base64Image;
+ showComment = false;
+ caretType = 'fa-caret-right';
constructor(
private route: ActivatedRoute,
private router: Router,
@@ -26,13 +28,16 @@ export class ProblemComponent implements OnInit {
}
ngOnInit() {
- this.code = this.route.snapshot.params['problem'];
- this.contest = this.route.snapshot.params['contest'];
+ this.code = this.route.snapshot.params['problem'];
+ this.contest = this.route.snapshot.params['contest'];
this.contestService.getProblem(this.code, this.contest).subscribe(data => {
this.problem = data.problem;
this.base64Image = this.problem.image;
- this.base64Image = this.domSanitizer.bypassSecurityTrustResourceUrl('data:image/jpg;base64,'
+ if(this.base64Image !== undefined) {
+ this.base64Image = this.domSanitizer.bypassSecurityTrustResourceUrl('data:image/jpg;base64,'
+ this.base64Image);
+ }
+
});
}
@@ -40,4 +45,14 @@ export class ProblemComponent implements OnInit {
onSelectSubmit() {
this.router.navigate([this.contest, 'submit', this.code]);
}
+
+ showComments() {
+ if (this.showComment) {
+ this.showComment = !(this.showComment);
+ this.caretType = 'fa-caret-right';
+ } else {
+ this.showComment = !(this.showComment);
+ this.caretType = 'fa-caret-down';
+ }
+ }
}
diff --git a/codecamp-front/src/app/components/problems/problems.component.css b/codecamp-front/src/app/components/problems/problems.component.css
index 665d63a..055ea71 100644
--- a/codecamp-front/src/app/components/problems/problems.component.css
+++ b/codecamp-front/src/app/components/problems/problems.component.css
@@ -2,7 +2,7 @@
background: white;
border-bottom: 1px solid rgba(39,39,39,.1);
padding: 1% 0.5%;
- box-shadow: 0 1px 15px 1px rgba(39,39,39,.1);
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
cursor: pointer;
}
@@ -26,14 +26,32 @@
.col-md-3 {
text-align: center;
+ padding-right:0% !important;
}
.display-4{
- padding-left: 1%;
+ padding-left: 1%;
}
.main {
margin-top: 1%;
background: white;
padding: 2%;
border: 4px;
-}
\ No newline at end of file
+ min-height: 800px;
+}
+
+
+button.btn.btn-info{
+ margin-top:4%;
+}
+
+#box-el{
+ padding:0.5rem!important;
+ color: rgb(15, 15, 15);
+ background: rgb(231, 240, 55);
+
+}
+
+.fa-check{
+ color: green;
+}
diff --git a/codecamp-front/src/app/components/problems/problems.component.html b/codecamp-front/src/app/components/problems/problems.component.html
index 3909c4f..3880634 100644
--- a/codecamp-front/src/app/components/problems/problems.component.html
+++ b/codecamp-front/src/app/components/problems/problems.component.html
@@ -1,23 +1,17 @@
+
Add Problems
- Delete Contest
-
Time to start
+
{{typeOfNow}}
+
- {{times}}
+
+
+
+ {{time_day}}
+
+ D
+
+
+ {{time_hr}}
+
+ H
+
+
+ {{time_min}}
+
+ M
+
+
+ {{time_sec}}
+
+ S
+
+
+
- Contest Rankings
+
+ Contest Rankings
diff --git a/codecamp-front/src/app/components/problems/problems.component.ts b/codecamp-front/src/app/components/problems/problems.component.ts
index 2718696..09a76af 100644
--- a/codecamp-front/src/app/components/problems/problems.component.ts
+++ b/codecamp-front/src/app/components/problems/problems.component.ts
@@ -21,20 +21,28 @@ export class ProblemsComponent implements OnInit {
contestname;
time;
- //Called after the constructor, initializing input properties, and the first call to ngOnChanges.
- //Add 'implements OnInit' to the class.
+ // Called after the constructor, initializing input properties, and the first call to ngOnChanges.
+ // Add 'implements OnInit' to the class.
countDownDate;
now;
end;
distance;
- days= 0;
+ days = 0;
hours;
minutes;
seconds;
times;
+ time_hr;
+ time_day;
+ time_min;
+ time_sec;
start;
x;
- ticks= 0;
+ ticks = 0;
+ typeOfNow = 'Contest Will Start In';
+ conditionToShowProblem = false;
+ user;
+ username;
constructor(
private contestService: ContestService,
private router: Router,
@@ -46,23 +54,33 @@ export class ProblemsComponent implements OnInit {
ngOnInit() {
this.contest = this.route.snapshot.params['contest'];
+
this.contestService.getProblems(this.contest).subscribe((contest) => {
this.problems = contest.msg[0].questions;
this.start = new Date(contest.msg[0].startTime);
this.end = new Date(contest.msg[0].endTime);
+ // console.log(this.start);
+ // console.log(this.end);
var timer;
- if (this.start > new Date())
- var compareDate = this.start;
- else
- var compareDate = this.end;
- //compareDate.setDate(this.end.getDate()); //just for this demo today + 7 days
- //console.log(compareDate);
+ if (this.start > new Date()) {
+ var compareDate = this.start;
+ } else if (this.start <= new Date() && this.end >= new Date()) {
+ this.typeOfNow = 'Contest Will End In';
+ var compareDate = this.end;
+ this.conditionToShowProblem = true;
+ } else {
+ this.typeOfNow = 'Contest Ended';
+ this.conditionToShowProblem = true;
+ }
+ // compareDate.setDate(this.end.getDate()); //just for this demo today + 7 days
+ // console.log(compareDate);
/* timer = setInterval(function() {
timeBetweenDates(compareDate);
}, 1000);*/
- setInterval((()=>{
- var dateEntered = compareDate;
+ setInterval((() => {
+ if (compareDate) {
+ var dateEntered = new Date(compareDate);
var now = new Date();
var difference = dateEntered.getTime() - now.getTime();
@@ -70,7 +88,7 @@ export class ProblemsComponent implements OnInit {
// Timer done
clearInterval(timer);
-
+ this.times = '';
} else {
var second = Math.floor(difference / 1000);
@@ -81,7 +99,7 @@ export class ProblemsComponent implements OnInit {
hour %= 24;
minute %= 60;
second %= 60;
- //console.log(day,hour,minute,second);
+ // console.log(day,hour,minute,second);
// this.days = day;
// this.hours = hour;
// this.minutes = minute;
@@ -93,18 +111,27 @@ export class ProblemsComponent implements OnInit {
var temp = String(day) + ' days ' + String(hour) + ' hr ' +String(minute) + ' min ' +String(second) + ' sec';
////this.contestService.time.next(temp);
//this.contestService.time.subscribe(value => this.times = value);*/
- this.times = String(day) + ' days ' + String(hour) + ' hr ' +String(minute) + ' min ' +String(second) + ' sec';
-
+ this.time_day = day ;
+ this.time_hr = hour ;
+ this.time_min = minute ;
+ this.time_sec = second ;
+ this.times = String(day) + ' days ' + String(hour) + ' hr ' + String(minute) + ' min ' + String(second) + ' sec';
+ }
}
- }),1000);
-
+ }), 1000);
});
this.contestService.currentContest.subscribe(contest => this.contestname = contest);
}
- tickerFunc(tick){
+
+ ngOnDestroy() {
+ //Called once, before the instance is destroyed.
+ //Add 'implements OnDestroy' to the class.
+
+ }
+ tickerFunc(tick) {
this.ticks = tick;
}
onAddProblem() {
diff --git a/codecamp-front/src/app/components/profile/profile.component.css b/codecamp-front/src/app/components/profile/profile.component.css
index 271ca9a..86e4342 100644
--- a/codecamp-front/src/app/components/profile/profile.component.css
+++ b/codecamp-front/src/app/components/profile/profile.component.css
@@ -1,14 +1,35 @@
.circle{
margin-top: 40px;
- width: 80%;
+ width: 30%;
border-radius: 120px;
- margin-left: 25%;
+ margin-left: 40%;
+}
+.col-md-6{
+ margin-top: 7%;
+}
+.col-md-2{
+ margin-top:2%;
}
.bold{
text-align: center;
- font-size:35px !important;
+ font-size:30px !important;
}
-.college{
+#college{
text-align: center;
- font-size: 15px;
+ font-size: 20px;
+}
+#user{
+ margin-left: 60%;
+}
+
+.container1{
+ margin-left:10%;
+ margin-right:15%;
+ box-sizing: border-box;
+ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
+ background: #fff;
+ min-height: 800px;
+}
+.list-group-item{
+ border: rgb(165, 162, 162);
}
diff --git a/codecamp-front/src/app/components/profile/profile.component.html b/codecamp-front/src/app/components/profile/profile.component.html
index 19fe18e..126c615 100644
--- a/codecamp-front/src/app/components/profile/profile.component.html
+++ b/codecamp-front/src/app/components/profile/profile.component.html
@@ -1,28 +1,49 @@
-
+
-
-
{{user.name}} ( {{user.username}})
- Edit
-
- {{user.college}}
-
+
+
+
-
-
-
- Email: {{user.email_id}}
- Date Of Birth: {{ user.dob }}
- City: {{ user.city }}
- Gender: {{ user.gender }}
- JoinedOn: {{ user.joinedOn }}
-
+
+
+
+
+
+
+
+ Name:
+ UserName:
+ College:
+ Email:
+ Contact Number
+ Date Of Birth:
+ City:
+ Gender:
+ JoinedOn:
+
+
+
+
+ {{user.name}}
+ {{user.username}}
+ {{user.college}}
+ {{user.email_id}}
+ {{user.contact_number}}
+ {{user.dob}}
+ {{ user.city }}
+ {{ user.gender }}
+ {{ user.joinedOn }}
+
+
+
diff --git a/codecamp-front/src/app/components/profile/profile.component.ts b/codecamp-front/src/app/components/profile/profile.component.ts
index 5d0e588..ec7b787 100644
--- a/codecamp-front/src/app/components/profile/profile.component.ts
+++ b/codecamp-front/src/app/components/profile/profile.component.ts
@@ -10,21 +10,28 @@ import { Router } from '@angular/router';
export class ProfileComponent implements OnInit {
user;
+ dob;
constructor(
private authService: AuthService,
private router: Router
) {
this.user = authService.getProfile().subscribe(profile => {
this.user = profile.msg;
- //console.log(JSON.stringify(this.user));
+ this.user.dob = this.replaceTZ(this.user.dob);
+ this.user.joinedOn = this.replaceTZ(this.user.joinedOn);
});
- //console.log(this.user);
}
ngOnInit() {
- console.log(this.user);
}
onSubmitSel() {
this.router.navigate([this.user.username, 'edit-profile']);
}
+ replaceTZ(time) {
+ if(time !== undefined ){
+ let t1 = time.replace(/[TZ]|.000/g , ' ');
+ t1 = t1.split(' ');
+ return t1[0];
+ }
+ }
}
diff --git a/codecamp-front/src/app/components/ranklist/ranklist.component.css b/codecamp-front/src/app/components/ranklist/ranklist.component.css
index e69de29..ae542a5 100644
--- a/codecamp-front/src/app/components/ranklist/ranklist.component.css
+++ b/codecamp-front/src/app/components/ranklist/ranklist.component.css
@@ -0,0 +1,7 @@
+.main{
+ min-height: 800px;
+}
+
+.reload{
+ color: gray;
+}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/ranklist/ranklist.component.html b/codecamp-front/src/app/components/ranklist/ranklist.component.html
index 183765d..f9de386 100644
--- a/codecamp-front/src/app/components/ranklist/ranklist.component.html
+++ b/codecamp-front/src/app/components/ranklist/ranklist.component.html
@@ -1,9 +1,13 @@
-
-
+
-
No Successful Solutions Submitted Yet.
-
+
+
Page Reloads in 10 seconds!!
+
+
+
+ No Successful Solutions Submitted Yet.
+
-
+
#
@@ -28,13 +32,14 @@
-
- {{i}}
- {{rank.name}}
- {{rank.score}}
-
+
+ {{i+1}}
+ {{rnk.name}}
+ {{rnk.score}}
+
+
-
\ No newline at end of file
+
diff --git a/codecamp-front/src/app/components/ranklist/ranklist.component.ts b/codecamp-front/src/app/components/ranklist/ranklist.component.ts
index 84bb144..0d3293f 100644
--- a/codecamp-front/src/app/components/ranklist/ranklist.component.ts
+++ b/codecamp-front/src/app/components/ranklist/ranklist.component.ts
@@ -1,29 +1,51 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
import { ContestService } from '../../services/contest.service';
import { Router } from '@angular/router';
import { AuthService } from '../../services/auth.service';
import { ActivatedRoute } from '@angular/router';
+import { Observable } from 'rxjs';
+import { IntervalObservable } from 'rxjs/observable/IntervalObservable';
@Component({
selector: 'app-ranklist',
templateUrl: './ranklist.component.html',
styleUrls: ['./ranklist.component.css']
})
-export class RanklistComponent implements OnInit {
+export class RanklistComponent implements OnInit, OnDestroy {
contest;
+ ranks;
problems;
+ rank = [];
+ private alive: boolean;
constructor(
private contestService: ContestService,
private router: Router,
private authService: AuthService,
- private route: ActivatedRoute ) { }
+ private route: ActivatedRoute
+ ) {
+ this.alive = true;
+ }
ngOnInit() {
this.contest = this.route.snapshot.params['contest'];
this.contestService.getRankings(this.contest).subscribe(contest => {
- this.problems = contest.msg;
- });
+ this.ranks = contest.msg;
+ this.ranks.map( x=>{
+ if(x.score > 0)
+ this.rank.push(x)
+ })
+ })
+ IntervalObservable.create(10000)
+ .takeWhile(() => this.alive) // only fires when component is alive
+ .subscribe(() => {
+ this.contestService.getRankings(this.contest).subscribe(contest => {
+ this.ranks = contest.msg;
+ });
+ });
+ }
+ ngOnDestroy() {
+ this.alive = false;
}
}
diff --git a/codecamp-front/src/app/components/register/register.component.css b/codecamp-front/src/app/components/register/register.component.css
index 43c48cb..d4d83b1 100644
--- a/codecamp-front/src/app/components/register/register.component.css
+++ b/codecamp-front/src/app/components/register/register.component.css
@@ -27,4 +27,13 @@ label{
background: #2ca8ff;
border-color: #2ca8ff;
border-radius: 0;
+}
+
+.fa {
+ float: right;
+ margin-right: 15px;
+ margin-top: -27px;
+ position: relative;
+ z-index: 2;
+ color: black;
}
\ No newline at end of file
diff --git a/codecamp-front/src/app/components/register/register.component.html b/codecamp-front/src/app/components/register/register.component.html
index 6e55d74..a7949cc 100644
--- a/codecamp-front/src/app/components/register/register.component.html
+++ b/codecamp-front/src/app/components/register/register.component.html
@@ -95,6 +95,19 @@ SIGN UP
+
{{comment.username}}
++ {{comment.comment}} +
+ ++