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
6 changes: 3 additions & 3 deletions src/app/data-structure/has-id-and-title.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export class HasIdAndTitle {
public id: string;
public title: string;
public link: string;
public id: string = "";
public title: string = "";
public link: string = "";
}
18 changes: 9 additions & 9 deletions src/app/data-structure/login-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export class LoginInfo {
return plainToClass(LoginInfo, obj as object);
}

public loggedIn: boolean;
public nickname: string;
public loggedIn: boolean = false;
public nickname: string = "";

public googleLinked: boolean;
public googleProfileUrl: string;
public gitHubLinked: boolean;
public gitHubProfileUrl: string;
public facebookLinked: boolean;
public facebookProfileUrl: string;
public googleLinked: boolean = false;
public googleProfileUrl: string = "";
public gitHubLinked: boolean = false;
public gitHubProfileUrl: string = "";
public facebookLinked: boolean = false;
public facebookProfileUrl: string = "";

public errorMessage: string;
public errorMessage: string = "";
}
4 changes: 2 additions & 2 deletions src/app/data-structure/quiz-text.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class QuizText {
public text: string;
public isHtml: boolean;
public text: string = "";
public isHtml: boolean = false;
}
4 changes: 2 additions & 2 deletions src/app/data-structure/quiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class Quiz extends HasIdAndTitle {
return plainToClass(Quiz, obj as object);
}

public isPrivate: boolean;
public usesMathML: boolean;
public isPrivate: boolean = false;
public usesMathML: boolean = false;

@Type(() => QuizSection)
public sections: QuizSection[];
Expand Down
2 changes: 1 addition & 1 deletion src/app/data-structure/submission-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class SubmissionResult {
return plainToClass(SubmissionResult, obj as object);
}

public result: boolean;
public result: boolean = false;

@Type(() => QuizText)
public correctAnswer: QuizText;
Expand Down
2 changes: 1 addition & 1 deletion src/app/data-structure/submission.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export class Submission {
public answer: string;
public answer: string = "";
}
4 changes: 2 additions & 2 deletions src/app/data-structure/user-history-sections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class UserHistorySections {
@Type(() => LoginInfo)
public loginInfo: LoginInfo;

public quizId: string;
public quizTitle: string;
public quizId: string = "";
public quizTitle: string = "";

// Only used when parsing from JSON.
@Type(() => UserStats)
Expand Down
6 changes: 3 additions & 3 deletions src/app/data-structure/user-question-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export class UserQuestionHistory {
return result;
}

public questionId: string;
public questionId: string = "";

@Type(() => QuizText)
public questionTitle: QuizText;

public sectionId: string;
public subSectionTitle: string;
public sectionId: string = "";
public subSectionTitle: string = "";

public answeredCorrectlyOnce = false;
public countAnsweredWrong = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/app/data-structure/user-stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export class UserStats {
return Number((part / total) * 100).toFixed(2) + "%";
}

public quizId: string;
public quizTitle: string;
public sectionId: string;
public sectionTitle: string;
public quizId: string = "";
public quizTitle: string = "";
public sectionId: string = "";
public sectionTitle: string = "";

public answered = 0;
public correct = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/app/history.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { UserHistorySectionsComponent } from "./user-history-sections.component"
})
export class HistoryComponent extends BaseComponent {

public quizId: string;
public quizTitle: string;
public quizId: string = "";
public quizTitle: string = "";
@ViewChild(UserHistorySectionsComponent, { static: true })
private sectionsComponent: UserHistorySectionsComponent;

Expand Down
6 changes: 3 additions & 3 deletions src/app/question.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class QuestionComponent extends BaseComponent implements OnInit {
return text;
}

public quizId: string;
public quizId: string = "";

public question: QuizQuestion;
public submissionResult: SubmissionResult;
Expand All @@ -88,8 +88,8 @@ export class QuestionComponent extends BaseComponent implements OnInit {

// The section to show questions from.
// Not just the section ID of the question.
public sectionId: string;
private questionId: string;
public sectionId: string = "";
private questionId: string = "";

constructor(private quizService: QuizService,
private questionService: QuestionService,
Expand Down