chore(backend): Aanpassingen Dwengo Learning-Object-Repository
Processing uit Dwengo Learning-Object-Repository geconverteerd naar TypeScript en aangepast aan onze app. Functionaliteit van Dwengo Learning-Object-Repository in ons project gekopiëerd en deels aanBestanden die enkel types of interfaces exporteren hernoemd naar *.d.tsgepast aan TypeScript en ons project.
This commit is contained in:
parent
ba3da01d2d
commit
463c8c9fc0
45 changed files with 1258 additions and 3747 deletions
|
@ -0,0 +1,9 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {Category} from "gift-pegjs";
|
||||
import {ProcessingError} from "../../processing-error";
|
||||
|
||||
export class CategoryQuestionRenderer extends GIFTQuestionRenderer<Category> {
|
||||
render(question: Category): string {
|
||||
throw new ProcessingError("The question type 'Category' is not supported yet!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {Description} from "gift-pegjs";
|
||||
import {ProcessingError} from "../../processing-error";
|
||||
|
||||
export class DescriptionQuestionRenderer extends GIFTQuestionRenderer<Description> {
|
||||
render(question: Description): string {
|
||||
throw new ProcessingError("The question type 'Description' is not supported yet!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {Essay} from "gift-pegjs";
|
||||
|
||||
export class EssayQuestionRenderer extends GIFTQuestionRenderer<Essay> {
|
||||
render(question: Essay): string {
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
import {GIFTQuestion} from "gift-pegjs";
|
||||
|
||||
/**
|
||||
* Subclasses of this class are renderers which can render a specific type of GIFT questions to HTML.
|
||||
*/
|
||||
export abstract class GIFTQuestionRenderer<T extends GIFTQuestion> {
|
||||
/**
|
||||
* Render the given question to HTML.
|
||||
* @param question The question.
|
||||
* @returns The question rendered as HTML.
|
||||
*/
|
||||
abstract render(question: T): string;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {Matching} from "gift-pegjs";
|
||||
import {ProcessingError} from "../../processing-error";
|
||||
|
||||
export class MatchingQuestionRenderer extends GIFTQuestionRenderer<Matching> {
|
||||
render(question: Matching): string {
|
||||
throw new ProcessingError("The question type 'Matching' is not supported yet!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {MultipleChoice} from "gift-pegjs";
|
||||
|
||||
export class MultipleChoiceQuestionRenderer extends GIFTQuestionRenderer<MultipleChoice> {
|
||||
render(question: MultipleChoice): string {
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {Numerical} from "gift-pegjs";
|
||||
import {ProcessingError} from "../../processing-error";
|
||||
|
||||
export class NumericalQuestionRenderer extends GIFTQuestionRenderer<Numerical> {
|
||||
render(question: Numerical): string {
|
||||
throw new ProcessingError("The question type 'Numerical' is not supported yet!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {ShortAnswer} from "gift-pegjs";
|
||||
import {ProcessingError} from "../../processing-error";
|
||||
|
||||
export class ShortQuestionRenderer extends GIFTQuestionRenderer<ShortAnswer> {
|
||||
render(question: ShortAnswer): string {
|
||||
throw new ProcessingError("The question type 'ShortAnswer' is not supported yet!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import {GIFTQuestionRenderer} from "./gift-question-renderer";
|
||||
import {TrueFalse} from "gift-pegjs";
|
||||
import {ProcessingError} from "../../processing-error";
|
||||
|
||||
export class TrueFalseQuestionRenderer extends GIFTQuestionRenderer<TrueFalse> {
|
||||
render(question: TrueFalse): string {
|
||||
throw new ProcessingError("The question type 'TrueFalse' is not supported yet!");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue