Validator
Constructor Summary
Public Constructor | ||
public |
constructor(set: *) |
Member Summary
Public Members | ||
public |
Ex1: * |
|
public |
Ex2: * |
|
public |
Ex3: * |
|
public |
Ex4: * |
|
public |
|
|
public |
|
|
public |
session: * |
|
public |
set: * Class parameters |
|
public |
|
|
public |
validFinalSet: *[] |
|
public get |
validSet: * Getter for final valid set for exercise generator |
|
public get |
validSize: * Getter for final valid size of the generated bookmarks |
Method Summary
Public Methods | ||
public |
The function caches imports in local scope for later to be referenced as a string |
|
public |
enoughBookmarks(set: *): * number of bookmarks >= requested number simply generate exercises Assumes the given set has valid minimal sizes for exercises |
|
public |
getBookmarks(totalSize: *): * Ajax get request to the Zeeguu API to get new bookmarks |
|
public |
getValidBookMarks(args: *): * |
|
public |
isProperEx(exNum,: int, exSize,: int): * Compares the minimum requirement for the given ex and the assigned amount |
|
public |
Number of bookmarks == 0 then show no bookmarks page Signals the generator to terminate, load no bookmark page |
|
public |
notEnoughBookmarks(bookmarkLength: *, set: *): Array Number of bookmarks < requested number, generate exercises that fit |
|
public |
validateSet(totalSetLength: *, data: *): Array Given the set and the bookmarks create a new set for generator Three possibilities: number of bookmarks == 0 then show no bookmarks page number of bookmarks < requested number then generate exercises that fit number of bookmarks >= requested number simply generate exercises |
Public Constructors
public constructor(set: *) source
Params:
Name | Type | Attribute | Description |
set | * |
Public Members
public Ex1: * source
public Ex2: * source
public Ex3: * source
public Ex4: * source
public loadingAnimation: * source
public session: * source
public validFinalSet: *[] source
Public Methods
public cacheExerciseImports() source
The function caches imports in local scope for later to be referenced as a string
public enoughBookmarks(set: *): * source
number of bookmarks >= requested number simply generate exercises Assumes the given set has valid minimal sizes for exercises
Params:
Name | Type | Attribute | Description |
set | * |
Return:
* |
public getBookmarks(totalSize: *): * source
Ajax get request to the Zeeguu API to get new bookmarks
Params:
Name | Type | Attribute | Description |
totalSize | * |
Return:
* |
public getValidBookMarks(args: *): * source
Params:
Name | Type | Attribute | Description |
args | * | is matrix of exercise name and number of bookmarks, example: [[1,3],[2,4]] 3 bookmarks for ex1 and 4 bookmarks for ex2 |
Return:
* | matrix of exercises similar to its input |
public isProperEx(exNum,: int, exSize,: int): * source
Compares the minimum requirement for the given ex and the assigned amount
Params:
Name | Type | Attribute | Description |
exNum, | int | the id of the ex |
|
exSize, | int | the amount the ex is generated |
Return:
* | {boolean}, true if the minReq >= givenAmount, else false |
Example:
this.isProperEx(1,2), Ex1 2 times
public noBookmarkPage(): Array source
Number of bookmarks == 0 then show no bookmarks page Signals the generator to terminate, load no bookmark page
public notEnoughBookmarks(bookmarkLength: *, set: *): Array source
Number of bookmarks < requested number, generate exercises that fit
Params:
Name | Type | Attribute | Description |
bookmarkLength | * | ||
set | * |
public validateSet(totalSetLength: *, data: *): Array source
Given the set and the bookmarks create a new set for generator Three possibilities: number of bookmarks == 0 then show no bookmarks page number of bookmarks < requested number then generate exercises that fit number of bookmarks >= requested number simply generate exercises
Params:
Name | Type | Attribute | Description |
totalSetLength | * | ||
data | * |