magister.js
Version:
A JavaScript implementation of the Magister 6 API
176 lines (139 loc) • 2.85 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _magisterThing = _interopRequireDefault(require("./magisterThing"));
var _util = require("./util");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class GradeType extends _magisterThing.default {
/**
* @private
* @param {Magister} magister
* @param {Object} raw
*/
constructor(magister, raw) {
super(magister);
/**
* @type {String}
* @readonly
*/
this.id = (0, _util.toString)(raw.Id);
/**
* @type {String}
* @readonly
*/
this.name = raw.KolomNaam;
/**
* @type {Number}
* @readonly
*/
this.number = raw.KolomNummer;
/**
* @type {String}
* @readonly
*/
this.header = raw.KolomKop;
/**
* @type {Boolean}
* @readonly
*/
this.isAtLaterDate = raw.IsHerkansingKolom;
/**
* @type {Boolean}
* @readonly
*/
this.isTeacher = raw.IsDocentKolom;
/**
* @type {Boolean}
* @readonly
*/
this.hasNestedTypes = raw.HeeftOndeliggendeKolommen;
/**
* @type {Boolean}
* @readonly
*/
this.isPTA = raw.IsPTAKolom;
/**
* Value will be set by {@link Grade.fill}
* @type {Number}
* @default undefined
*/
this.level = undefined;
/**
* Value will be set by {@link Grade.fill}
* @type {String}
* @default ''
*/
this.description = '';
/**
* @type {Number}
* @private
* @readonly
*/
this._type = raw.KolomSoort;
}
/**
* @type {string}
* @readonly
*/
get type() {
switch (this._type) {
case 0:
return 'unknown';
// Unkown
case 1:
return 'grade';
// Cijfer
case 2:
return 'average';
// Gemiddelde
case 3:
return 'maximum';
// Maximum
case 4:
return 'formula';
// Formule
case 5:
return 'minimum';
// Minimum
case 6:
return 'sum';
// Som
case 7:
return 'count';
// Tel
case 8:
return 'cevo';
// Cevo
case 9:
return 'text';
// Vrije tekst
case 10:
return 'cevocpe';
// Cevo CPE
case 11:
return 'cevocie';
// Cevo CIE
case 12:
return 'weight';
// Weegfactor
case 13:
return 'end';
// Eind cijfer
case 14:
return 'deficit';
// Tekortpunten
case 15:
return 'tree top';
// Boom top
case 16:
return 'subject requirement';
// Vak voorwaarde
default:
return 'unknown';
}
}
}
var _default = GradeType;
exports.default = _default;