change repo

This commit is contained in:
Ruben Kallinich
2024-07-11 10:44:44 +02:00
commit 4a034b660f
88 changed files with 21963 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, combineLatest, map } from 'rxjs';
import { Question } from '../Model/question';
@Injectable({
providedIn: 'root',
})
export class DataInput {
constructor(private http: HttpClient) {}
private katalog1Url = 'assets/LPI-2019-1-101d-QA.json';
private katalog2Url = 'assets/LPI-2019-1-102d-QA.json';
getQuestion1(): Observable<Question[]> {
return this.http.get<Question[]>(this.katalog1Url);
}
getQuestion2(): Observable<Question[]> {
return this.http.get<Question[]>(this.katalog2Url);
}
getKatalog1Url(): string {
return this.katalog1Url;
}
getKaltalog2Url(): string {
return this.katalog2Url;
}
getAllQuestions(): Observable<Question[]>{
const question1 = this.getQuestion1();
const question2 = this.getQuestion2();
return combineLatest([question1, question2]).pipe(
map(([question1,question2]) => [...question1, ...question2])
);
}
}