Skip to content

Commit ae4fe14

Browse files
committed
minor changes
1 parent 4d3247c commit ae4fe14

File tree

6 files changed

+11
-60
lines changed

6 files changed

+11
-60
lines changed

Frontend/src/app/pages/admin/update-questions-of-question-paper/update-questions-of-question-paper.component.html

+1-25
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,4 @@ <h2 class="theme-text text-center">Update Question</h2>
4444
</mat-card>
4545
</div>
4646

47-
<div class="mt-3 text-center" *ngFor="let subQuestion of question.subQuestions; let i = index">
48-
<hr>
49-
<mat-form-field style="margin-right: 20px;">
50-
<mat-label class="theme-text">Sub-Question {{ i + 1 }}</mat-label>
51-
<input type="text" name="Sub-Question {{ i + 1 }}" matInput [(ngModel)]="subQuestion.questionContent">
52-
</mat-form-field>
53-
<mat-form-field style="margin-right: 20px;">
54-
<mat-label class="theme-text">Marks</mat-label>
55-
<input type="number" name="Marks" matInput [(ngModel)]="subQuestion.marks">
56-
</mat-form-field>
57-
<mat-form-field style="margin-right: 20px;">
58-
<mat-label class="theme-text">CO</mat-label>
59-
<input type="text" matInput name="CO" [(ngModel)]="subQuestion.co">
60-
</mat-form-field>
61-
<mat-form-field style="margin-right: 20px;">
62-
<mat-label class="theme-text">BTL</mat-label>
63-
<input type="text" matInput name="BTL" [(ngModel)]="subQuestion.btl">
64-
</mat-form-field>
65-
</div>
66-
67-
68-
<div class="container text-center mt-3">
69-
<button mat-raised-button color="primary" (click)="addSubQuestion()">Add Sub-Question</button>
70-
</div>
71-
47+

Frontend/src/app/pages/admin/update-questions-of-question-paper/update-questions-of-question-paper.component.ts

+2-28
Original file line numberDiff line numberDiff line change
@@ -61,38 +61,12 @@ export class UpdateQuestionsOfQuestionPaperComponent implements OnInit {
6161
this.questionsService.updateQuestion(this.question.qid, this.question).subscribe(
6262
(updatedQuestion) => {
6363
this.router.navigate(['/adminDashboard/questionPapers/view-questionPaper-questions',this.questionPaperId]);
64-
this.addSubQuestions(this.question.qid);
64+
6565
},
6666
(error) => {
6767
console.error('Error updating question:', error);
6868
}
6969
);
7070
}
7171

72-
addSubQuestions(questionId: number) {
73-
74-
this.question.subQuestions.forEach((subQuestion: any) => {
75-
subQuestion.parentQuestion = { qid: questionId };
76-
this.subQuestionService.addSubQuestion(subQuestion).subscribe(
77-
(data) => {
78-
console.log('Sub-question added successfully:', data);
79-
},
80-
(error) => {
81-
console.error('Error adding sub-question:', error);
82-
}
83-
);
84-
});
85-
86-
this.router.navigate(['/adminDashboard/questionPapers/viewQuestionPaper', this.questionPaperId]);
87-
}
88-
89-
addSubQuestion() {
90-
91-
this.question.subQuestions.push({
92-
marks: 0,
93-
co: '',
94-
btl: '',
95-
questionContent: ''
96-
});
97-
}
98-
}
72+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.example-full-width{
2+
margin-right: 10px !important;
3+
}

Frontend/src/app/pages/admin/update-sub-question/update-sub-question.component.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
<div class="container">
2+
<div class="container text-center">
33
<h2>Update Sub-Question</h2>
44

55
<form (submit)="updateSubQuestion()">
@@ -18,11 +18,12 @@ <h2>Update Sub-Question</h2>
1818
<input matInput placeholder="BTL" name="btl" [(ngModel)]="subQuestion.btl">
1919
</mat-form-field>
2020

21-
<mat-form-field class="example-full-width">
21+
<div>
22+
<mat-form-field style="width: 50%;">
2223
<mat-label>Question Content</mat-label>
2324
<textarea matInput placeholder="Question Content" name="questionContent" [(ngModel)]="subQuestion.questionContent" rows="5"></textarea>
2425
</mat-form-field>
25-
26+
</div>
2627

2728
<button mat-raised-button color="primary" type="submit">Update</button>
2829
</form>

Frontend/src/app/pages/admin/view-quiz-questions/view-quiz-questions.component.html

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ <h2 class="text-center theme-text" style="color: white;">Questions of {{qTitle}}
2929
</div>
3030
</mat-card-content>
3131
<mat-card-actions>
32-
<button mat-button color="primary">Update</button>
3332
<button (click)="deleteQuestion(q.qid)" mat-button color="warn" style="margin-left: 5px;">Delete</button>
3433
</mat-card-actions>
3534
</mat-card>

Frontend/src/app/profile/profile.component.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,5 @@ <h3 style="margin-top: 30px;font-size: x-large;font-weight: bold;text-align: cen
4343

4444

4545
</mat-card-content>
46-
<mat-card-actions class="mat-card-actions">
47-
<button mat-raised-button color="primary" style="margin-right: 12px;">Update</button>
48-
</mat-card-actions>
46+
4947
</mat-card>

0 commit comments

Comments
 (0)