Skip to content
Snippets Groups Projects
Commit 97e0f3b2 authored by ywb16155's avatar ywb16155
Browse files

commit #37 - styling, refactoring

parent 768958de
No related branches found
No related tags found
No related merge requests found
#submission-view {
margin-top: 2%;
margin-left: 25%;
margin-left: 35%;
margin-right: 0;
}
#question-header {
}
#pair-row {
margin-top: 2%;
margin-left: 0;
}
#submission-button-row {
margin-top: 2%;
}
#submit-button {
}
......
<app-student-navbar></app-student-navbar>
<div id="submission-view" class="container">
<div class="row">
<div id="question-header" class="row">
<h4>{{currentPaper.name}}</h4>
</div>
<div class="row">
<h4>Write a response about {{currentPaper.topic}} for {{currentPaper.classCode}}</h4>
</div>
<div class="row">
<div id="pair-row" class="row">
<div *ngIf="questionAnswerPairs.length == 0">
<h4>No questions found...</h4>
</div>
......@@ -18,7 +18,7 @@
</div>
<div class="row">
<label for="{{i}}">{{pair.question.questionText}}</label>
<textarea id="{{i}}" class="form-control" type="text" rows="3" name="{{i}}"
<textarea id="{{i}}" class="form-control" type="text" rows="3" cols="50" name="{{i}}"
[(ngModel)]="pair.answer.answerText" placeholder="Start typing your response here.."></textarea>
</div>
</div>
......
......@@ -59,6 +59,9 @@ export class StudentSubmissionViewComponent implements OnInit, OnDestroy {
for (let i = 0; i < this.questionList.length; i++) {
if (this.questionList[i] && this.answerList[i]) {
this.questionAnswerPairs.push(new QuestionAnswerPairDao(this.questionList[i], this.answerList[i]));
} else if (this.questionList[i]) {
this.questionAnswerPairs.push(new QuestionAnswerPairDao(this.questionList[i],
new AnswerDao('0', '', this.studentId, this.currentPaper.paperId, this.questionList[i].questionId, false, '0000-00-00')));
}
}
}
......
import {Optional} from '@angular/core';
export class AnswerDao {
answerId: String;
......@@ -9,10 +7,9 @@ export class AnswerDao {
questionId: String;
submitted: Boolean;
submissionDate: String;
draft: String;
constructor(answerId: String, answerText: String, username: String,
paperId: String, questionId: String, submitted: Boolean, submissionDate: String, @Optional() draft: String) {
paperId: String, questionId: String, submitted: Boolean, submissionDate: String) {
this.answerId = answerId;
this.answerText = answerText;
this.username = username;
......@@ -20,6 +17,5 @@ export class AnswerDao {
this.questionId = questionId;
this.submitted = submitted;
this.submissionDate = submissionDate;
this.draft = draft;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment