Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1 @@
# SignVideo

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.4.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
Bangla Sign Language
4 changes: 2 additions & 2 deletions backend/Mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
def send_mail(content, to):
message = MIMEText(content)
message['Subject'] = "Test email"
message['From'] = "labonnya1234@outlook.com"
message['From'] = "abj-paul@outlook.com"
message['To'] = to

# Send message
with smtplib.SMTP('smtp-mail.outlook.com', 587) as smtp:
smtp.starttls()
smtp.login('labonnya1234@outlook.com', 'bsse1208@gmail.com')
smtp.login('abj-paul@outlook.com', 'bristi pothe mukti dilo gaan_12')
smtp.send_message(message)

Binary file added backend/__pycache__/AuthServices.cpython-310.pyc
Binary file not shown.
Binary file added backend/__pycache__/Mail.cpython-310.pyc
Binary file not shown.
Binary file added backend/__pycache__/Model.cpython-310.pyc
Binary file not shown.
Binary file added backend/__pycache__/User.cpython-310.pyc
Binary file not shown.
Binary file added backend/__pycache__/constants.cpython-310.pyc
Binary file not shown.
Binary file added backend/__pycache__/main.cpython-310.pyc
Binary file not shown.
Binary file added backend/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified backend/bsl.db
Binary file not shown.
38 changes: 19 additions & 19 deletions backend/dhandaquery.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,41 @@ CREATE TABLE IF NOT EXISTS questions (
);

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 1, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 1, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/12.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/12.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 2, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 2, ' এর জন্য ইশারা ভাষা কোনটি?', '../../assets/1.jpg', '../../assets/2.jpg', '../../assets/3.jpg',
'../../assets/4.jpg', '../../assets/1.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 3, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 3, ' এর জন্য ইশারা ভাষা কোনটি?', '../../assets/5.jpg', '../../assets/6.jpg', '../../assets/7.jpg',
'../../assets/8.jpg', '../../assets/7.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 4, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 4, ' এর জন্য ইশারা ভাষা কোনটি?', '../../assets/9.jpg', '../../assets/10.jpg', '../../assets/11.jpg',
'../../assets/12.jpg', '../../assets/9.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 5, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
values( 5, '১৩ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 6, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 6, '১৪ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/17.jpg', '../../assets/18.jpg', '../../assets/19.jpg',
'../../assets/20.jpg', '../../assets/20.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 7, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 7, '১৬ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/21.jpg', '../../assets/20.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/21.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 8, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 8, 'আম এর জন্য ইশারা ভাষা কোনটি?', '../../assets/21.jpg', '../../assets/20.jpg', '../../assets/19.jpg',
'../../assets/18.jpg', '../../assets/20.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 9, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 9, ' এর জন্য ইশারা ভাষা কোনটি?', '../../assets/1.jpg', '../../assets/2.jpg', '../../assets/8.jpg',
'../../assets/16.jpg', '../../assets/8.jpg');

insert into questions (id, label, choice1, choice2, choice3, choice4, answer)
values( 10, '১২ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/13.jpg', '../../assets/14.jpg', '../../assets/15.jpg',
'../../assets/16.jpg', '../../assets/13.jpg');
values( 10, '১৮ এর জন্য ইশারা ভাষা কোনটি?', '../../assets/5.jpg', '../../assets/6.jpg', '../../assets/3.jpg',
'../../assets/4.jpg', '../../assets/4.jpg');
Empty file.
19 changes: 19 additions & 0 deletions src/app/answers/answers.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container" *ngFor="let question of randomQuestions; let i = index">
<h2>{{i+1}}. {{ question.label }}</h2>
<div class="container">
<img [src]="question.answer" height="100px" width="100px"><br>
</div>
</div>
<p> You've got {{ score }} points.</p>
</body>
</html>
23 changes: 23 additions & 0 deletions src/app/answers/answers.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AnswersComponent } from './answers.component';

describe('AnswersComponent', () => {
let component: AnswersComponent;
let fixture: ComponentFixture<AnswersComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AnswersComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(AnswersComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
23 changes: 23 additions & 0 deletions src/app/answers/answers.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Component, OnInit } from '@angular/core';
import { QuestionsService } from '../questions.service';
import { Router } from '@angular/router';
import { Question } from '../quiz.model';

@Component({
selector: 'app-answers',
templateUrl: './answers.component.html',
styleUrls: ['./answers.component.css']
})
export class AnswersComponent implements OnInit{

constructor(private questionsService: QuestionsService, private router: Router) { }

randomQuestions: Question[]=[];
score: number = 0;

ngOnInit(): void {
this.randomQuestions=this.questionsService.getRandomQuestions();
this.score=this.questionsService.getScore();
}

}
4 changes: 3 additions & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ProfileComponent } from './profile/profile.component';
import { RegisterComponent } from './register/register.component';
import { TeacherDashboardComponent } from './teacher-dashboard/teacher-dashboard.component';
import { QuestionsComponent } from './questions/questions.component';
import { AnswersComponent } from './answers/answers.component';

const routes: Routes = [
{path:"", component:HomeComponent},
Expand All @@ -32,7 +33,8 @@ const routes: Routes = [
{path: "otp-verification", component: OtpVerificationComponent},
{path: "forgot-password", component: ForgotPasswordComponent},
{path: "teacher-dashboard", component: TeacherDashboardComponent},
{path: "quiz", component: QuestionsComponent}
{path: "quiz", component: QuestionsComponent},
{path: "answers", component: AnswersComponent}
];

@NgModule({
Expand Down
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { ProfileComponent } from './profile/profile.component';
import { ForgotPasswordComponent } from './forgot-password/forgot-password.component';
import { InvalidCredentialsComponent } from './login/invalid-credentials/invalid-credentials.component';
import { QuestionsComponent } from './questions/questions.component';
import { AnswersComponent } from './answers/answers.component';

@NgModule({
declarations: [
Expand All @@ -45,7 +46,8 @@ import { QuestionsComponent } from './questions/questions.component';
ProfileComponent,
ForgotPasswordComponent,
InvalidCredentialsComponent,
QuestionsComponent
QuestionsComponent,
AnswersComponent
],
imports: [
BrowserModule,
Expand Down
19 changes: 18 additions & 1 deletion src/app/questions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export class QuestionsService {

public apiUrl = "http://localhost:8000";

questions: Question[]=[]
questions: Question[]=[];
score: number = 0;

getQuestions(){
// return this.http.get<Question[]>(`{this.apiUrl}/getquestions`);
Expand All @@ -21,4 +22,20 @@ export class QuestionsService {
});

}

getRandomQuestions(): Question[]{
return this.questions;
}

setRandomQuestions(questions: Question[]): void{
this.questions=questions;
}

getScore(): number{
return this.score;
}

setScore(score: number): void{
this.score=score;
}
}
27 changes: 1 addition & 26 deletions src/app/questions/questions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,7 @@ <h2>{{i+1}}. {{ question.label }}</h2>
</div>
</div>

<div class="container">
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Submit</button>

<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>

</div>
</div>

</div>
<button (click)="checkAnswer()">Submit</button>

</body>
</html>
18 changes: 11 additions & 7 deletions src/app/questions/questions.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Question, Quiz, Answers } from '../quiz.model';
import { QuestionsService } from '../questions.service';
import { Router } from '@angular/router';

@Component({
selector: 'app-questions',
Expand All @@ -10,9 +11,10 @@ import { QuestionsService } from '../questions.service';

export class QuestionsComponent implements OnInit{

constructor(private questionsService: QuestionsService) { }
constructor(private questionsService: QuestionsService, private router: Router) { }

questions: Question[] = [];
randomQuestions: Question[] = [];
answers: string[] = [];
score: number = 0;
selectedChoice: string[]=[];
Expand All @@ -23,28 +25,30 @@ export class QuestionsComponent implements OnInit{
this.questionsService.getQuestions().subscribe(
(response:any) => {
this.questions = response;
for(let i=0;i<this.questions.length;i++)
this.randomQuestions = this.questions.sort(() => Math.random() - 0.5);
for(let i=0;i<this.randomQuestions.length;i++)
{

this.answers[i]=this.questions[i].answer;
this.answers[i]=this.randomQuestions[i].answer;
}
});
}





checkAnswer() {

this.score=0;

for(let i=0;i<this.questions.length;i++)
for(let i=0;i<this.randomQuestions.length;i++)
{
if (this.answers[i]==this.selectedChoice[i]) {
this.score++;
}
}
this.questionsService.setRandomQuestions(this.randomQuestions);
this.questionsService.setScore(this.score);
this.router.navigate(["answers"]);

}
}

Expand Down