File

src/app/core/models/question.model.ts

Properties

position
position: number
Type : number
question
question: Question
Type : Question
question_id
question_id: number
Type : number
survey_id
survey_id: number
Type : number
import { Answer } from "./answer.model";
import { User } from "./user.model";

export class Question {

    constructor(description: string, subject: string, type: string, answer_time: number, answers: Answer[], resource: string, user_creator_id: number) {
        this.description = description;
        this.subject = subject;
        this.type = type;
        this.answer_time = answer_time;
        this.answers = answers;
        this.resource = resource;
        this.user_creator_id = user_creator_id;
    }

    id: number = 0;
    description: string = '';
    subject: string = '';
    type: string = '';
    answer_time: number = 0;
    answers: Answer[] = []
    resource: string = '';
    user_creator_id: number = 0;
    position?: number;
}

export enum Type {
    multioption = 'multioption',
    true_false = 'true_false',
    short = 'short'
}

export interface QuestionSurvey {
    question_id: number;
    survey_id: number;
    position: number;
    question: Question;
}

export function equals(question1: Question, question2: Question): boolean {
    if (question1.id != question2.id)
        return false
    if (question1.description != question2.description)
        return false
    if (question1.type != question2.type)
        return false
    return true;
}

results matching ""

    No results matching ""