@obe-loms/coms-parser 1.6.15 → 1.6.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DataTable/models/DataTable.d.ts +8 -1
- package/DataTable/models/PoaepDT.d.ts +1 -0
- package/DataTable/models/validators/coaep/MinCOtaxo.d.ts +0 -1
- package/DataTable/models/validators/coaep/MinILOPerfTarget.d.ts +18 -0
- package/DataTable/models/validators/poaep/MinPIPerfTarget.d.ts +18 -0
- package/DataTable/models/validators/poaep/MinPItaxo.d.ts +4 -5
- package/bundle.js +34 -32
- package/package.json +1 -1
|
@@ -7,6 +7,13 @@ export type DataTableInfo<RowType = any[]> = {
|
|
|
7
7
|
table: RowType[];
|
|
8
8
|
state: Record<string, any>;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* An abstract class that wraps a tabular data structure
|
|
12
|
+
* and provides methods for state management, validation, CSV parsing, and JSON conversion.
|
|
13
|
+
*
|
|
14
|
+
* @template Obj - The type of the DataTable JSON output.
|
|
15
|
+
* @template RowType - The type of each row of the inner table.
|
|
16
|
+
*/
|
|
10
17
|
export declare abstract class DataTable<Obj, RowType> {
|
|
11
18
|
protected name: string;
|
|
12
19
|
protected headers: string[];
|
|
@@ -21,7 +28,7 @@ export declare abstract class DataTable<Obj, RowType> {
|
|
|
21
28
|
* @template RowType - The type of each row of the inner table.
|
|
22
29
|
*
|
|
23
30
|
* @param {string} _name - The name of the DataTable. Defaults to "DataTable".
|
|
24
|
-
* @param {string[]} _headers -
|
|
31
|
+
* @param {string[]} _headers - String containing the headers of the DataTable.
|
|
25
32
|
*/
|
|
26
33
|
constructor(_name: string | undefined, _headers: string[]);
|
|
27
34
|
/**
|
|
@@ -7,7 +7,6 @@ export declare class MinCOtaxo extends DTValidator<CoaepDT, COAEP> {
|
|
|
7
7
|
/**
|
|
8
8
|
* Validate the COAEP object.
|
|
9
9
|
* Checks if every Course Outcome has a taxonomy level of "Applying" or higher.
|
|
10
|
-
* This is done by checking for "Remembering" and "Understanding" as errors.
|
|
11
10
|
*
|
|
12
11
|
* @param {string[]} validMsgs - Array of valid messages.
|
|
13
12
|
* @param {DataTableException[]} tableErrors - Array of table errors.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { COAEP } from "../../../../types/coaep";
|
|
2
|
+
import DataTableException from "../../../types/DataTableException";
|
|
3
|
+
import { CoaepDT } from "../../CoaepDT";
|
|
4
|
+
import { DTValidator } from "../../DTValidator";
|
|
5
|
+
export declare class MinILOPerfTarget extends DTValidator<CoaepDT, COAEP> {
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Validate the COAEP object.
|
|
9
|
+
* Checks if every ILO has a performance target and pass score of at least 50.
|
|
10
|
+
*
|
|
11
|
+
* @param {string[]} validMsgs - Array of valid messages.
|
|
12
|
+
* @param {DataTableException[]} tableErrors - Array of table errors.
|
|
13
|
+
* @param {CoaepDT} coaepDT - COAEP DataTable.
|
|
14
|
+
* @param {COAEP | null} coaepObj - COAEP object.
|
|
15
|
+
* @returns {Promise<void>} - Promise that resolves when validation is complete.
|
|
16
|
+
*/
|
|
17
|
+
validate(validMsgs: string[], tableErrors: DataTableException[], coaepDT: CoaepDT, coaepObj: COAEP | null): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import DataTableException from "../../../types/DataTableException";
|
|
2
|
+
import { DTValidator } from "../../DTValidator";
|
|
3
|
+
import { PoaepDT } from "../../PoaepDT";
|
|
4
|
+
import { POAEP } from "../../../../types/poaep";
|
|
5
|
+
export declare class MinPIPerfTarget extends DTValidator<PoaepDT, POAEP> {
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Validate the POAEP object.
|
|
9
|
+
* Checks if every Performance Indicator has a performance target and pass score of 50 or higher.
|
|
10
|
+
*
|
|
11
|
+
* @param {string[]} validMsgs - Array of valid messages.
|
|
12
|
+
* @param {DataTableException[]} tableErrors - Array of table errors.
|
|
13
|
+
* @param {PoaepDT} poaepDT - POAEP DataTable.
|
|
14
|
+
* @param {POAEP | null} poaepObj - POAEP object.
|
|
15
|
+
* @returns {Promise<void>} - Promise that resolves when validation is complete.
|
|
16
|
+
*/
|
|
17
|
+
validate(validMsgs: string[], tableErrors: DataTableException[], poaepDT: PoaepDT, poaepObj: POAEP | null): Promise<void>;
|
|
18
|
+
}
|
|
@@ -5,14 +5,13 @@ import { POAEP } from "../../../../types/poaep";
|
|
|
5
5
|
export declare class MinPItaxo extends DTValidator<PoaepDT, POAEP> {
|
|
6
6
|
constructor();
|
|
7
7
|
/**
|
|
8
|
-
* Validate the
|
|
9
|
-
* Checks if every
|
|
10
|
-
* This is done by checking for "Remembering" and "Understanding" as errors.
|
|
8
|
+
* Validate the POAEP object.
|
|
9
|
+
* Checks if every Performance Indicator has a taxonomy level of "Applying" or higher.
|
|
11
10
|
*
|
|
12
11
|
* @param {string[]} validMsgs - Array of valid messages.
|
|
13
12
|
* @param {DataTableException[]} tableErrors - Array of table errors.
|
|
14
|
-
* @param {
|
|
15
|
-
* @param {
|
|
13
|
+
* @param {PoaepDT} poaepDT - POAEP DataTable.
|
|
14
|
+
* @param {POAEP | null} poaepObj - POAEP object.
|
|
16
15
|
* @returns {Promise<void>} - Promise that resolves when validation is complete.
|
|
17
16
|
*/
|
|
18
17
|
validate(validMsgs: string[], tableErrors: DataTableException[], poaepDT: PoaepDT, poaepObj: POAEP | null): Promise<void>;
|
package/bundle.js
CHANGED
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x868906 from 'papaparse';
|
|
2
|
+
import * as _0x3f317d from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x1d6efe){let _0x46a656='',_0x3f01ad='',_0x1cae0a=0x0,_0x45371b=null;const _0x2fed50=[];return _0x868906['parse'](_0x1d6efe,{'skipEmptyLines':!![],'complete':_0x5867a8=>{_0x5867a8['data']['forEach'](_0x530de4=>{const _0x15663c=_0x530de4['map'](_0x23c1e1=>(_0x23c1e1??'')['toString']()['trim']()),_0x3ed175=_0x15663c[0x0]??'';if(_0x3ed175['includes']('Rev#')){const _0x55e953=_0x3ed175['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x55e953&&(_0x46a656=_0x55e953[0x1]?.['trim']()??'',_0x3f01ad=_0x55e953[0x2]?.['trim']()??'',_0x1cae0a=parseInt(_0x55e953[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x3ed175)){_0x45371b=0x1;return;}if(/SECOND YEAR/i['test'](_0x3ed175)){_0x45371b=0x2;return;}if(/THIRD YEAR/i['test'](_0x3ed175)){_0x45371b=0x3;return;}if(/FOURTH YEAR/i['test'](_0x3ed175)){_0x45371b=0x4;return;}if(/FIFTH YEAR/i['test'](_0x3ed175)){_0x45371b=0x5;return;}if(/First Semester/i['test'](_0x3ed175)||/Second Semester/i['test'](_0x3ed175)||/Summer/i['test'](_0x3ed175))return;const _0x54cfc5=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x54cfc5['forEach'](({sem:_0x4512be,offset:_0x3eda05})=>{const _0x391a02=_0x15663c[_0x3eda05]??'',_0x23eebe=_0x15663c[_0x3eda05+0x1]??'',_0x40cf94=_0x15663c[_0x3eda05+0x2]??'',_0x5ca895=_0x15663c[_0x3eda05+0x3]??'',_0x2673ba=_0x15663c[_0x3eda05+0x4]??'';_0x391a02&&_0x45371b&&_0x2fed50['push']({'curr_id':_0x46a656,'program_name':_0x3f01ad,'revision_no':_0x1cae0a,'year_level':_0x45371b,'sem':_0x4512be,'course_id':_0x391a02,'course_desc':_0x23eebe,'total_units':_0x40cf94,'lec_unit':_0x5ca895,'lab_unit':_0x2673ba});});});}}),_0x2fed50;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x248aa1,_0x49c65a){return new Promise((_0x54cde9,_0x1801ff)=>{const _0x2fc4cc=new FileReader();_0x2fc4cc['onload']=_0xfa95ef=>{const _0x3646a2=_0xfa95ef['target']?.['result'];if(!_0x3646a2){_0x1801ff(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x19c9b6=_0x3f317d['read'](_0x3646a2,{'type':'array'});!_0x49c65a&&(_0x49c65a=_0x19c9b6['SheetNames'][0x0]);if(!_0x49c65a){_0x1801ff(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x2ce524=_0x19c9b6['Sheets'][_0x49c65a];if(!_0x2ce524){_0x1801ff(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0xa9e2bf=_0x3f317d['utils']['sheet_to_csv'](_0x2ce524,{'strip':!![]}),_0x29c9f5=_0x248aa1['name']['replace'](/\.[^/.]+$/,'.csv'),_0x5c7845=new File([_0xa9e2bf],_0x29c9f5,{'type':'text/csv','lastModified':Date['now']()});_0x54cde9(_0x5c7845);}catch(_0x116701){_0x1801ff(_0x116701);}},_0x2fc4cc['onerror']=()=>{_0x1801ff(new Error('File\x20reading\x20failed'));},_0x2fc4cc['readAsArrayBuffer'](_0x248aa1);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x4e8c8a,_0x5c7cec){try{const _0x3df797=await convertToCSVFile(_0x5c7cec),_0x3133c9=await _0x3df797['text'](),_0x3981e8=parseCurriculum(_0x3133c9),_0x22f8de=_0x868906['unparse'](_0x3981e8),_0x166963=new File([_0x22f8de],_0x3df797['name'],{'type':'text/csv'}),_0x1eac56=new FormData();_0x1eac56['append']('csvFile',_0x166963);const _0x4ee99b=await fetch(_0x4e8c8a+'/curr-courses/upload',{'method':'POST','body':_0x1eac56});if(!_0x4ee99b['ok']){const _0x29a6e8=await _0x4ee99b['json']();throw _0x29a6e8;}return _0x4ee99b['json']();}catch(_0x439564){throw _0x439564;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x19e531){let _0xa417c1='',_0x2bbf85='';const _0x1e9ac2=[],_0x154f1b=_0x868906['parse'](_0x19e531,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x270186=_0x154f1b['data'];for(let _0x4df401=0x0;_0x4df401<Math['min'](0x5,_0x270186['length']);_0x4df401++){const _0x3d0676=_0x270186[_0x4df401];if(_0x3d0676&&_0x3d0676['length']>0x0){const _0x27046f=_0x3d0676[0x0]?.['toString']()||'',_0x3e96b3=_0x27046f['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x3e96b3){_0xa417c1=_0x3e96b3[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x3e96b3[0x2]){const _0x5053cd=_0x3e96b3[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x5053cd&&_0x5053cd[0x2]&&_0x5053cd[0x4]&&(_0x2bbf85=_0x5053cd[0x2]+_0x5053cd[0x4]);}}}}let _0x1372e7=-1;for(let _0x141770=0x0;_0x141770<_0x270186['length'];_0x141770++){const _0x2127de=_0x270186[_0x141770];if(_0x2127de&&_0x2127de['some'](_0x1acdbe=>_0x1acdbe?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x1372e7=_0x141770;break;}}if(_0x1372e7===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x1f9421={'code':'','description':'','unit':0x0};for(let _0x2259b5=_0x1372e7+0x1;_0x2259b5<_0x270186['length'];_0x2259b5++){const _0x18f3ce=_0x270186[_0x2259b5];if(!_0x18f3ce||_0x18f3ce['length']<0x8)continue;const _0xc7bca5=_0x18f3ce[0x1]?.['toString']()['trim']()||'',_0x197817=_0x18f3ce[0x4]?.['toString']()['trim']()||'',_0x605bb8=_0x18f3ce[0x5]?.['toString']()['trim']()||'',_0x255a68=_0x18f3ce[0x6]?.['toString']()['trim']()||'',_0xa0c02c=_0x18f3ce[0x7]?.['toString']()['trim']()||'',_0x292ed5=_0x18f3ce[0x3]?.['toString']()['trim']()||'';let _0x115e22=_0x18f3ce[0x0]?.['toString']()['trim']()||'',_0x2fceb3=_0x18f3ce[0x2]?.['toString']()['trim']()||'';if(!_0xc7bca5)continue;if(!_0x115e22)_0x115e22=_0x1f9421['code'];if(!_0x2fceb3)_0x2fceb3=_0x1f9421['description'];let _0x120719=_0x1f9421['unit'];if(_0x292ed5){const _0x2cb05a=_0x292ed5['match'](/(\d+)/);_0x2cb05a&&_0x2cb05a[0x1]&&(_0x120719=parseInt(_0x2cb05a[0x1],0xa));}const _0x438f3a={'sem':_0xa417c1,'school_year':_0x2bbf85,'code':_0x115e22,'course_no':_0xc7bca5,'course_desc':_0x2fceb3,'unit':_0x120719,'time':_0x197817,'days':_0x605bb8,'faculty':_0x255a68,'room':_0xa0c02c};_0x1f9421['code']=_0x115e22,_0x1f9421['description']=_0x2fceb3,_0x1f9421['unit']=_0x120719,_0x1e9ac2['push'](_0x438f3a);}return _0x1e9ac2;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x10aac8,_0x3a2d8d){try{const _0x4ac1bf=await convertToCSVFile(_0x3a2d8d),_0x48839e=await _0x4ac1bf['text'](),_0x4ba398=parseCourseOffering(_0x48839e),_0x5ec9c9=_0x868906['unparse'](_0x4ba398),_0x58093c=new File([_0x5ec9c9],_0x4ac1bf['name'],{'type':'text/csv'}),_0x5d24f1=new FormData();_0x5d24f1['append']('csvFile',_0x58093c);const _0x5e3df5=await fetch(_0x10aac8+'/course-offerings/upload',{'method':'POST','body':_0x5d24f1});if(!_0x5e3df5['ok']){const _0x25adb4=await _0x5e3df5['json']();throw _0x25adb4;}return _0x5e3df5['json']();}catch(_0xeca3c5){throw _0xeca3c5;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x51871c){if(!_0x51871c)return {'performance_target':null,'passing_score':null};const _0x395fd0=_0x51871c['match'](/\d+/g);return {'performance_target':_0x395fd0?.[0x0]?parseInt(_0x395fd0[0x0],0xa):null,'passing_score':_0x395fd0?.[0x1]?parseInt(_0x395fd0[0x1],0xa):null};}
|
|
15
15
|
|
|
16
|
-
const HEADERS$1={'co':['course\x20outcome','co\x20statement','outcome\x20statement'],'ilo':['intended\x20learning','ilo','learning\x20outcome'],'assessTool':['assessment\x20tool','assessment\x20method','tool'],'perfTarget':['performance\x20target','target','passing']};function getCoaepHeader(
|
|
16
|
+
const HEADERS$1={'co':['course\x20outcome','co\x20statement','outcome\x20statement'],'ilo':['intended\x20learning','ilo','learning\x20outcome'],'assessTool':['assessment\x20tool','assessment\x20method','tool'],'perfTarget':['performance\x20target','target','passing']};function getCoaepHeader(_0x48e520){let _0x5c26a2={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x4a5ddf=0x0;_0x4a5ddf<Math['min'](_0x48e520['length'],0x14);_0x4a5ddf++){const _0x1a426e=(_0x48e520[_0x4a5ddf]??[])['map'](_0xcdd0a0=>_0xcdd0a0['toLowerCase']()['trim']()),_0x58c19b=_0x1a426e['findIndex'](_0x3293f5=>HEADERS$1['co']['some'](_0x1054c0=>_0x3293f5['includes'](_0x1054c0))),_0x5c4b81=_0x1a426e['findIndex'](_0x1386c5=>HEADERS$1['ilo']['some'](_0x38b52c=>_0x1386c5['includes'](_0x38b52c))),_0x4342b8=_0x1a426e['findIndex'](_0x3c0219=>HEADERS$1['assessTool']['some'](_0xe7d95a=>_0x3c0219['includes'](_0xe7d95a))),_0x2a5839=_0x1a426e['findIndex'](_0x189e30=>HEADERS$1['perfTarget']['some'](_0x58ee42=>_0x189e30['includes'](_0x58ee42))),_0x44241f=[_0x58c19b,_0x5c4b81,_0x4342b8,_0x2a5839]['filter'](_0x376873=>_0x376873!==-1)['length'];if(_0x44241f>=0x3){_0x5c26a2={'headerRowIndex':_0x4a5ddf,'coIdx':_0x58c19b,'iloIdx':_0x5c4b81,'assessToolIdx':_0x4342b8,'perfTargetIdx':_0x2a5839};break;}}return _0x5c26a2;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x24f06b){const _0x146d9d={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x24f06b['trim']()},_0x2b4205=_0x24f06b['match'](/^\((I|E|D)\)/);_0x2b4205&&(_0x146d9d['cognitive_level']=_0x2b4205[0x1],_0x146d9d['rest']=_0x24f06b['slice'](_0x2b4205[0x0]['length'])['trim']());const _0x5f041d=_0x146d9d['rest']?.['match'](/^(.*?)\:/);_0x5f041d&&(_0x146d9d['taxonomy_level']=_0x5f041d[0x1]['trim']()['toLowerCase']()||null,_0x146d9d['rest']=_0x146d9d['rest']?.['slice'](_0x5f041d[0x0]['length'])['trim']()||null);const _0x268ffe=_0x146d9d['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x268ffe)_0x146d9d['verb']=_0x268ffe[0x1]['trim']()['toLowerCase']()||null;else {const _0x2a4f91=_0x146d9d['rest']?.['match'](/^\w+/);if(_0x2a4f91)_0x146d9d['verb']=_0x2a4f91[0x0]['trim']()['toLowerCase']()||null;}return _0x146d9d;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x51cb08){const _0xf9478b=_0x868906['parse'](_0x51cb08,{'skipEmptyLines':![]})['data'],_0x1d876e={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x2585be,coIdx:_0xdac635,iloIdx:_0x416ed1,assessToolIdx:_0x40cfd1,perfTargetIdx:_0x750ccb}=getCoaepHeader(_0xf9478b);if(_0x2585be===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0xf9478b['forEach'](_0x2c5616=>{const _0x543443=_0x2c5616['indexOf']('Name\x20of\x20Faculty:'),_0x45c5cc=_0x2c5616['indexOf']('School\x20Year'),_0x1be773=_0x2c5616['indexOf']('Course:'),_0xa9199f=_0x2c5616['indexOf']('Semester');_0x543443!==-1&&(_0x1d876e['COAEP']['faculty']=_0x2c5616[_0x543443+0x1]?.['trim']()||_0x1d876e['COAEP']['faculty']);_0x45c5cc!==-1&&(_0x1d876e['COAEP']['sy']=_0x2c5616[_0x45c5cc+0x1]?.['trim']()||_0x1d876e['COAEP']['sy']);_0x1be773!==-1&&(_0x1d876e['COAEP']['course']=_0x2c5616[_0x1be773+0x1]?.['trim']()||_0x1d876e['COAEP']['course']);if(_0xa9199f!==-1){const _0xa7280f=_0x2c5616[_0xa9199f+0x1]?.['trim']()||'',_0x2db431=_0xa7280f['match'](/\d+/)?.[0x0];_0x1d876e['COAEP']['semester']=_0x2db431?parseInt(_0x2db431,0xa):_0x1d876e['COAEP']['semester'];}});let _0x14fe4e=null;return _0xf9478b['forEach']((_0x91a4b4,_0x467ba7)=>{if(_0x467ba7<=_0x2585be)return;let _0x3857b4=_0x91a4b4[_0xdac635-0x1]?.['trim']()||'',_0x497ec5=_0x91a4b4[_0xdac635]?.['trim']()||'';/^\d+$/['test'](_0x91a4b4[_0xdac635]?.['trim']()||'')&&(_0x3857b4=_0x91a4b4[_0xdac635]?.['trim']()||'',_0x497ec5=_0x91a4b4[_0xdac635+0x1]?.['trim']()||'');const _0x5522bf=_0x91a4b4[_0x416ed1]?.['trim']()||'',_0x39a14d=_0x91a4b4[_0x40cfd1]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x318b20=_0x91a4b4[_0x750ccb]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x3857b4&&/^\d+$/['test'](_0x3857b4)){_0x14fe4e&&_0x1d876e['COAEP']['co']['push'](_0x14fe4e);const _0x4c6cb1=_0x497ec5,{verb:_0x97b22,cognitive_level:_0x2e0903,taxonomy_level:_0xaee26a}=extractFromObjective(_0x4c6cb1);if(!_0x97b22)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x3857b4+'\x20is\x20in\x20the\x20correct\x20format.'};_0x14fe4e={'statement':_0x4c6cb1,'ilo':[],'verb':_0x97b22,'cognitive_level':_0x2e0903,'taxonomy_level':_0xaee26a};}if(_0x14fe4e&&_0x5522bf&&_0x318b20){const _0x155aaa=_0x5522bf['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x155aaa['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x155aaa['length']<0xa)return;let _0x59fcb7=_0x39a14d;if(!_0x59fcb7&&_0x155aaa['includes'](':')){const _0x3fe41c=_0x155aaa['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x3fe41c&&(_0x59fcb7=_0x3fe41c[0x1]?.['trim']()||'');}const {performance_target:_0x474cb9,passing_score:_0x182f32}=performaceTarget(_0x318b20),{verb:_0x4acdf0,cognitive_level:_0x4066ee,taxonomy_level:_0x2839a3}=extractFromObjective(_0x155aaa);_0x14fe4e['ilo']['push']({'statement':_0x155aaa,'assessment_tool':_0x59fcb7,'performance_target':_0x474cb9,'passing_score':_0x182f32,'verb':_0x4acdf0,'cognitive_level':_0x4066ee,'taxonomy_level':_0x2839a3});}}),_0x14fe4e&&_0x1d876e['COAEP']['co']['push'](_0x14fe4e),_0x1d876e;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x3fb61a,_0x4894fa,_0x13db79){try{const _0x4ebc20=await convertToCSVFile(_0x4894fa),_0x1b72b5=await _0x4ebc20['text'](),_0x350e4e=parseCOAEP(_0x1b72b5);console['log'](_0x350e4e);const _0x1c8ec1=await fetch(_0x3fb61a+'/coaeps/upload?course_id='+_0x13db79,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x350e4e)});if(!_0x1c8ec1['ok']){const _0x2deca9=await _0x1c8ec1['json']();throw _0x2deca9;}return _0x1c8ec1['json']();}catch(_0x5071e2){throw _0x5071e2;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x5675df,_0x41d3ac){try{const _0x4756f2=await convertToCSVFile(_0x41d3ac),_0x1ede71=new FormData();_0x1ede71['append']('csvFile',_0x4756f2);const _0x504dd7=await fetch(_0x5675df+'/enrolled-students/upload',{'method':'POST','body':_0x1ede71});if(!_0x504dd7['ok']){const _0x58fe3e=await _0x504dd7['json']();throw _0x58fe3e;}return _0x504dd7['json']();}catch(_0x5ed9da){throw _0x5ed9da;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x9a4575){const _0x320619=_0x868906['parse'](_0x9a4575,{'skipEmptyLines':!![]})['data'];let _0x3a3080='',_0x28fe8c='',_0x4154ff='';const _0x598b48=[];return _0x320619['forEach'](_0x5f15a9=>{const _0x2ced9e=_0x5f15a9['map'](_0x53b644=>(_0x53b644??'')['toString']()['trim']()),_0x335cdb=_0x2ced9e[0x0]??'';if(_0x335cdb['startsWith']('Course\x20No:')){const _0x116fa8=_0x335cdb['replace']('Course\x20No:','')['trim'](),_0x23a961=_0x116fa8['split'](/\s+/);_0x4154ff=_0x23a961[0x0]??'';const [_0x4b8742,_0x317608]=(_0x23a961[0x1]??'')['split']('-');_0x28fe8c=_0x4b8742??'';const _0x41173b=(_0x317608??'')['match'](/[a-z]$/);_0x3a3080=_0x41173b?_0x41173b[0x0]:'';}if(/^\d+$/['test'](_0x335cdb)){const _0x577439=_0x2ced9e[0x2]??'';_0x598b48['push']({'subj_code':_0x4154ff,'student_no':_0x577439,'course_id':_0x28fe8c,'section':_0x3a3080});}}),{'enrolledCourses':_0x598b48};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x19e53d,_0x41d1f5,_0x391545,_0x54bd0d){try{const _0x132efa=await convertToCSVFile(_0x41d1f5),_0xbaefa3=await _0x132efa['text'](),_0x5c6093=parseClassList(_0xbaefa3),_0x15daa1='subj_code='+_0x391545+'&period_id='+_0x54bd0d,_0x4c48c4=await fetch(_0x19e53d+'/enrolled-courses/upload?'+_0x15daa1,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x5c6093)});if(!_0x4c48c4['ok']){const _0x1dda5a=await _0x4c48c4['json']();throw _0x1dda5a;}return _0x4c48c4['json']();}catch(_0xb5a12d){throw _0xb5a12d;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x29e7bb){const {data:_0x528984}=_0x868906['parse'](_0x29e7bb,{'skipEmptyLines':!![]}),_0x3f9655=_0x528984['filter'](_0x4af39a=>_0x4af39a['length']>0x0),_0x5277af=_0x3f9655['find'](_0xd94ed2=>_0xd94ed2['some'](_0x223d08=>_0x223d08?.['includes']('Faculty'))),_0x54ba1d=_0x5277af?_0x5277af['findIndex'](_0x39f44c=>_0x39f44c?.['includes']('Faculty')):-1,_0xce239c=_0x54ba1d!==-1&&_0x5277af?_0x5277af[_0x54ba1d+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x74efd6=_0x3f9655['find'](_0x96a95b=>_0x96a95b['some'](_0x2dd68f=>_0x2dd68f?.['includes']('Semester'))),_0xb05b59=_0x74efd6?_0x74efd6['findIndex'](_0x361ecc=>_0x361ecc?.['includes']('Semester')):-1,_0x16bf59=_0xb05b59!==-1&&_0x74efd6?_0x74efd6[_0xb05b59+0x2]?.['trim']()??'':'',_0xd96b01=_0x16bf59['includes']('1st')?0x1:_0x16bf59['includes']('2nd')?0x2:0x0,_0x4bb8ad=_0x3f9655['find'](_0x50b4f8=>_0x50b4f8['some'](_0x24081f=>_0x24081f?.['includes']('Course\x20&\x20Sec'))),_0x14b698=_0x4bb8ad?_0x4bb8ad['findIndex'](_0x1b18ad=>_0x1b18ad?.['includes']('Course\x20&\x20Sec')):-1,_0x16ff23=_0x14b698!==-1&&_0x4bb8ad?_0x4bb8ad[_0x14b698+0x2]?.['trim']()??'':'';let _0x19859d='',_0x2cd8e4='';if(_0x16ff23){const _0x13e748=_0x16ff23['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x13e748&&(_0x19859d=_0x13e748[0x1]??'',_0x13e748[0x2]&&(_0x2cd8e4=_0x13e748[0x2]['replace'](/^OC/i,'')));}const _0x5af3c4=_0x3f9655['find'](_0x2e0a01=>_0x2e0a01['some'](_0x17c8cd=>_0x17c8cd?.['includes']('School\x20Year'))),_0x2f2aa5=_0x5af3c4?_0x5af3c4['findIndex'](_0x16bb22=>_0x16bb22?.['includes']('School\x20Year')):-1,_0x45cc43=_0x2f2aa5!==-1&&_0x5af3c4?_0x5af3c4[_0x2f2aa5+0x2]?.['trim']()??'':'';let _0x37792b=0x0;if(_0x45cc43){const _0x2755dc=_0x45cc43['match'](/(\d{4})-(\d{4})/);if(_0x2755dc){const _0x3f088b=(_0x2755dc[0x1]??'')['slice'](0x2),_0x57092e=(_0x2755dc[0x2]??'')['slice'](0x2);_0x37792b=parseInt(_0x3f088b+_0x57092e,0xa);}}const _0x5b59f1={'faculty':_0xce239c,'course':_0x19859d,'section':_0x2cd8e4,'semester':_0xd96b01,'sy':_0x37792b},_0x57d704=_0x3f9655['findIndex'](_0x17f3a9=>_0x17f3a9['some'](_0x27181a=>_0x27181a?.['trim']()==='CO\x20#'));if(_0x57d704===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x4273b7=_0x3f9655[_0x57d704+0x1];if(!_0x4273b7)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x3abf94={};let _0x4b2a7f=0x1,_0x1b1e01=0x1;for(let _0x348108=0x3;_0x348108<_0x4273b7['length'];_0x348108++){const _0x3b2a8c=_0x4273b7[_0x348108];if(!_0x3b2a8c)continue;const _0x13cc69='co'+_0x4b2a7f;if(!_0x3abf94[_0x13cc69])_0x3abf94[_0x13cc69]=[];_0x3abf94[_0x13cc69]['push']('ilo'+_0x1b1e01),_0x1b1e01++,_0x1b1e01>0x3&&(_0x4b2a7f++,_0x1b1e01=0x1);}const _0x1a5aac=_0x3f9655['findIndex'](_0xffdd56=>_0xffdd56['includes']('Name\x20of\x20Students'));if(_0x1a5aac===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x1ede6f=_0x3f9655[_0x1a5aac];if(!_0x1ede6f)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x3d3ef6=_0x1ede6f['findIndex'](_0x37d874=>_0x37d874?.['includes']('Name\x20of\x20Students'));if(_0x3d3ef6===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x19c6c2=_0x3d3ef6+0x2,_0x3dcd37=[];for(let _0x5452e1=_0x1a5aac+0x1;_0x5452e1<_0x3f9655['length'];_0x5452e1++){const _0xd3bf80=_0x3f9655[_0x5452e1];if(!_0xd3bf80)continue;if(_0xd3bf80['some'](_0x161dd9=>_0x161dd9?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x161dd9?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x161dd9?.['toUpperCase']()['includes']('INACTIVE')||_0x161dd9?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0xd3bf80[_0x3d3ef6])continue;const _0x19f692=_0xd3bf80[_0x3d3ef6]['replace'](/"/g,'')['trim'](),_0x3f3a93=_0xd3bf80['slice'](_0x19c6c2)['map'](_0x5995ea=>_0x5995ea===null?null:!isNaN(Number(_0x5995ea))?parseFloat(_0x5995ea):0x0);let _0x36a371=0x0;const _0x126ca4={};Object['entries'](_0x3abf94)['forEach'](([_0x5618cf,_0x37e9dd])=>{const _0x58ec60={};_0x37e9dd['forEach'](_0x496a44=>{_0x58ec60[_0x496a44]=_0x3f3a93[_0x36a371]??0x0,_0x36a371++;}),_0x126ca4[_0x5618cf]={'transmuted_score':_0x58ec60};}),_0x3dcd37['push']({'student_name':_0x19f692,'coaep':_0x126ca4});}const _0x29a6c8=_0x3f9655['find'](_0x2f04dd=>_0x2f04dd['some'](_0x445b97=>_0x445b97?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x14ccd4=_0x3f9655['find'](_0x15b5e9=>_0x15b5e9['some'](_0x104974=>_0x104974?.['includes']('AVERAGE'))),_0x3e5cbd=_0x29a6c8?_0x29a6c8['slice'](_0x19c6c2)['map'](_0xe529a1=>_0xe529a1&&!isNaN(Number(_0xe529a1))?parseInt(_0xe529a1):0x0):[],_0x3673e7=_0x14ccd4?_0x14ccd4['slice'](_0x19c6c2)['map'](_0x3fa51a=>_0x3fa51a&&_0x3fa51a!=='#DIV/0!'&&!isNaN(Number(_0x3fa51a))?parseInt(_0x3fa51a):0x0):[],_0x52c64f={};let _0x5bcbca=0x0;return Object['entries'](_0x3abf94)['forEach'](([_0x3226c0,_0x2c1eb0])=>{if(!_0x52c64f[_0x3226c0])_0x52c64f[_0x3226c0]={};_0x2c1eb0['forEach'](_0x16bcb6=>{_0x52c64f[_0x3226c0][_0x16bcb6]={'achievedMinimum':_0x3e5cbd[_0x5bcbca]??0x0,'average':_0x3673e7[_0x5bcbca]??0x0},_0x5bcbca++;});}),{'assessmentData':{'classAssignment':_0x5b59f1,'student':_0x3dcd37,'total':_0x52c64f}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0xec2fb6,_0x217b50){try{const _0x4c9e8b=await convertToCSVFile(_0x217b50),_0x169708=await _0x4c9e8b['text'](),_0x414409=parseAssessmentCsv(_0x169708),_0x782041=await fetch(_0xec2fb6+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x414409)});if(!_0x782041['ok']){const _0x507566=await _0x782041['json']();throw _0x507566;}return _0x782041['json']();}catch(_0x237a20){throw _0x237a20;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x2da486,_0x1b416b){try{const _0x42daba=await convertToCSVFile(_0x1b416b),_0x105c3a=new FormData();_0x105c3a['append']('csvFile',_0x42daba);const _0xae686f=await fetch(_0x2da486+'/dept-faculties/upload',{'method':'POST','body':_0x105c3a});if(!_0xae686f['ok']){const _0x316791=await _0xae686f['json']();throw _0x316791;}return _0xae686f['json']();}catch(_0x1f2ed9){throw _0x1f2ed9;}}
|
|
35
35
|
|
|
36
|
-
const HEADERS={'po':['program\x20outcome','po\x20statement','outcome\x20statement'],'tl':['taxonomy','level'],'pi':['performance\x20indicator'],'fc':['formative'],'sc':['summative'],'at':['assessment\x20tool','assessment\x20method','tool'],'pt':['performance\x20target','target','passing']};function getPoaepHeader(
|
|
36
|
+
const HEADERS={'po':['program\x20outcome','po\x20statement','outcome\x20statement'],'tl':['taxonomy','level'],'pi':['performance\x20indicator'],'fc':['formative'],'sc':['summative'],'at':['assessment\x20tool','assessment\x20method','tool'],'pt':['performance\x20target','target','passing']};function getPoaepHeader(_0x7c67c){let _0x187d4b={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x116a8d=0x0;_0x116a8d<Math['min'](_0x7c67c['length'],0x14);_0x116a8d++){const _0x51e0a2=(_0x7c67c[_0x116a8d]??[])['map'](_0x28c14d=>_0x28c14d['toLowerCase']()['trim']()),_0x548ce8=_0x51e0a2['findIndex'](_0x39f860=>HEADERS['po']['some'](_0x1091e1=>_0x39f860['toLowerCase']()['includes'](_0x1091e1))),_0x574b05=_0x51e0a2['findIndex'](_0x473a22=>HEADERS['tl']['some'](_0x50a27e=>_0x473a22['toLowerCase']()['includes'](_0x50a27e))),_0x3752d0=_0x51e0a2['findIndex'](_0x2327e0=>HEADERS['pi']['some'](_0x5a7c98=>_0x2327e0['toLowerCase']()['includes'](_0x5a7c98))),_0x367367=_0x51e0a2['findIndex'](_0x4a7b4a=>HEADERS['fc']['some'](_0x3b3e6f=>_0x4a7b4a['toLowerCase']()['includes'](_0x3b3e6f))),_0x564d37=_0x51e0a2['findIndex'](_0x1e9c72=>HEADERS['sc']['some'](_0x346a98=>_0x1e9c72['toLowerCase']()['includes'](_0x346a98))),_0x2a8590=_0x51e0a2['findIndex'](_0x2603c8=>HEADERS['at']['some'](_0xbf4db1=>_0x2603c8['toLowerCase']()['includes'](_0xbf4db1))),_0xbef18c=_0x51e0a2['findIndex'](_0x27f004=>HEADERS['pt']['some'](_0x1326c3=>_0x27f004['toLowerCase']()['includes'](_0x1326c3))),_0x3abd85=[_0x548ce8,_0x574b05,_0x3752d0,_0x367367,_0x564d37,_0x2a8590,_0xbef18c]['filter'](_0x1b352c=>_0x1b352c!==-1)['length'];if(_0x3abd85>=0x3){_0x187d4b={'headerIdx':_0x116a8d,'poIdx':_0x548ce8,'tlIdx':_0x574b05,'piIdx':_0x3752d0,'fcIdx':_0x367367,'scIdx':_0x564d37,'atIdx':_0x2a8590,'ptIdx':_0xbef18c};break;}}if(_0x187d4b['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x187d4b;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0xd79826=>{let _0x41fe17=_0xd79826['split'](',')['reduce']((_0xbc98ac,_0x8feafd)=>{const _0x541ce0=_0x8feafd['trim']();if(_0x541ce0)_0xbc98ac['push'](_0x541ce0);return _0xbc98ac;},[]);return _0x41fe17;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x314350=>{try{const _0x4f435e=_0x868906['parse'](_0x314350,{'skipEmptyLines':![]})['data'],{headerIdx:_0x58f620,poIdx:_0x1d375b,tlIdx:_0x52ab2e,piIdx:_0x901a76,fcIdx:_0x5970cd,scIdx:_0x2b7d3d,atIdx:_0x43912c,ptIdx:_0x242496}=getPoaepHeader(_0x4f435e),_0x11fc94=[];let _0x322b4b={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x311db5='',_0x445f9c='',_0x3ee2d1='';for(let _0x29eea0=_0x58f620+0x1;_0x29eea0<_0x4f435e['length'];_0x29eea0++){const _0x739c0=_0x4f435e[_0x29eea0];if(!_0x739c0)break;const _0x2d59db=_0x739c0[_0x1d375b]?.['trim']()||'';_0x2d59db!==''&&(_0x322b4b={'po_desc':_0x2d59db,'seq_no':_0x322b4b['seq_no']+0x1,'PerfIndicators':[]},_0x11fc94['push'](_0x322b4b),_0x311db5='',_0x445f9c='',_0x3ee2d1='');if(_0x322b4b['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x29eea0+'.');const _0x113dce=_0x739c0[_0x901a76]?.['trim']()||'';if(_0x113dce==='')break;const _0xf70d62=_0x739c0[_0x5970cd]?.['trim']()||'';if(_0xf70d62==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x29eea0+'.');const _0x31566c=_0x739c0[_0x2b7d3d]?.['trim']()||_0x311db5;if(_0x31566c==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x29eea0+'.');_0x311db5=_0x31566c;const _0x489208=_0x739c0[_0x43912c]?.['trim']()||_0x445f9c;if(_0x489208==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x29eea0+'.');_0x445f9c=_0x489208;const _0x545d46=_0x739c0[_0x242496]?.['trim']()||_0x3ee2d1;if(_0x545d46==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x29eea0+'.');_0x3ee2d1=_0x545d46;const _0x2d25f6=parseFormativeCourses(_0xf70d62);if(_0x2d25f6['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x29eea0+'.');const _0x911980=performaceTarget(_0x545d46);if(!_0x911980['performance_target']||!_0x911980['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x29eea0+'.');const _0x479388={'pi_desc':_0x113dce,'FormativeCourses':_0x2d25f6['map'](_0x5cc1d7=>({'course_id':_0x5cc1d7,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x31566c},'TaxonomyLevel':null,'AssessmentTool':{'at_desc':_0x489208},'PerformanceTargets':{'target_percent':_0x911980['performance_target'],'min_score':_0x911980['passing_score']}};_0x322b4b['PerfIndicators']['push'](_0x479388);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x11fc94}};}catch(_0x395793){return {'success':![],'error':_0x395793 instanceof Error?_0x395793['message']:_0x395793,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x22a6ef,_0x32aae0,_0x5ec9d9,_0x2b6ccd,_0x35e1d1){try{const _0x17573e=await convertToCSVFile(_0x32aae0),_0x3a4118=await _0x17573e['text'](),_0x302630=parsePOAEP(_0x3a4118),_0x5c75bc=await fetch(_0x22a6ef+'/program-outcomes/poaep/upload?curr_id='+_0x2b6ccd+'&period_id='+_0x35e1d1,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x5ec9d9},'credentials':'include','body':JSON['stringify'](_0x302630)});if(!_0x5c75bc['ok']){const _0x405802=await _0x5c75bc['json']();throw _0x405802;}return _0x5c75bc['json']();}catch(_0x459b16){throw _0x459b16;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(_0x1c19a2='DataTable',_0x5251c6){this['name']=_0x1c19a2,this['headers']=_0x5251c6,this['table']=[],this['validators']=[],this['state']={};}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getState'](){return this['state'];}['setState']=async _0x277c94=>{await this['assertInitialized'](),this['state']=_0x277c94;};['getTable'](){if(this['table']['length']===0x0)return {'success':![],'message':'Datatable\x20is\x20unset.'};return {'success':!![],'message':'Successfully\x20fetched\x20datatable.','data':{'name':this['name'],'headers':this['headers'],'table':this['table'],'state':this['state']}};}async['setTable'](_0x1faa50){await this['assertInitialized'](),this['table']=_0x1faa50;}async['initializeTable'](_0x4cf528,_0x5ae69b){try{let _0x480d18;if(_0x4cf528 instanceof File)_0x480d18=await this['fromXML'](_0x4cf528,_0x5ae69b);else _0x480d18=await this['fromCSVString'](_0x4cf528);if(!_0x480d18['success']||!_0x480d18['data'])return _0x480d18;if(_0x480d18['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x480d18['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x4df3a1){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x4df3a1};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x1bc85c,_0x2823c1){const _0x2e9d29=await convertToCSVFile(_0x1bc85c,_0x2823c1),_0x183164=await _0x2e9d29['text']();return this['fromCSVString'](_0x183164);}async['findValue'](_0x2b7976){let [_0x4dfb21,_0x3a1693]=[-1,-1];if(!_0x2b7976)return {'row':_0x4dfb21,'column':_0x3a1693};for(let _0x4cdac5=0x0;_0x4cdac5<this['table']['length'];_0x4cdac5++){const _0x46fb9d=this['table'][_0x4cdac5];for(let _0x4c6c27=0x0;_0x4c6c27<_0x46fb9d['length'];_0x4c6c27++){if(typeof _0x2b7976==='string'){if(_0x46fb9d[_0x4c6c27]===_0x2b7976)return {'row':_0x4cdac5,'column':_0x4c6c27};}else {if(_0x46fb9d[_0x4c6c27]){if(_0x46fb9d[_0x4c6c27]===_0x2b7976)return {'row':_0x4cdac5,'column':_0x4c6c27};}}}}return {'row':_0x4dfb21,'column':_0x3a1693};}async['validate'](){const _0xca36b9=[],_0x26b704=[];try{await this['assertInitialized']()['then'](()=>{_0xca36b9['push']('Table\x20is\x20initialized.');})['catch'](_0x485d3e=>_0x26b704['push'](_0x485d3e));if(_0x26b704['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0xca36b9,_0x26b704);const {success:_0x5b677d,message:_0x3c4ede,error:_0x2095b8,data:_0x41ba0d}=await this['toJson']();if(!_0x41ba0d)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0xca36b9['push'](..._0x41ba0d['validMsgs']),_0x26b704['push'](..._0x41ba0d['tableErrors']);const {jsonObj:_0x63187d}=_0x41ba0d;for(const _0x57635e of this['validators']){await _0x57635e['validate'](_0xca36b9,_0x26b704,this,_0x63187d);}let _0xc720c5=this['name']+'\x20ran\x20its\x20validations.';if(_0xca36b9['length']>0x0)_0xc720c5+='\x20'+_0xca36b9['length']+'\x20validations\x20were\x20successful.';if(_0x26b704['length']>0x0)_0xc720c5+='\x20'+_0x26b704['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0xc720c5,'data':{'validMsgs':_0xca36b9,'tableErrors':_0x26b704}};}catch(_0x39209a){return _0x26b704['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x39209a}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0xca36b9,'tableErrors':_0x26b704}};}}['useValidator'](_0x32b6be){this['validators']['push'](_0x32b6be);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0xa873d4){this['name']=_0xa873d4;}['getName'](){return this['name'];}['report'](_0x2aaf50,_0x2c433b,_0x43c44c){if(_0x2aaf50['length']>0x0)_0x43c44c['push'](..._0x2aaf50);else _0x2c433b['push'](this['name']+'\x20successfully\x20validated.');}}
|
|
47
47
|
|
|
48
|
-
class LastILOTaxo extends DTValidator{constructor(){super('LAST_ILO_TAXO');}async['validate'](
|
|
48
|
+
class LastILOTaxo extends DTValidator{constructor(){super('LAST_ILO_TAXO');}async['validate'](_0x20eb64,_0xe30ab0,_0x565a1f,_0x36de25){const _0x5b8d1f=[];if(!_0x36de25){_0xe30ab0['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x3406ac=0x0;_0x3406ac<_0x36de25['co']['length'];_0x3406ac++){const _0x3d59d9=_0x36de25['co'][_0x3406ac];if(!_0x3d59d9){const {row:_0x4102ac,column:_0x2e0a4b}=await _0x565a1f['findValue'](_0x3406ac+0x1+'');_0x5b8d1f['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x3406ac+0x1)+'.','row':_0x4102ac,'column':_0x2e0a4b+0x1,'from':this['name']});continue;}if(!_0x3d59d9?.['ilo']){const {row:_0x3e5937,column:_0x5bcda8}=await _0x565a1f['findValue'](_0x3d59d9['statement']);_0x5b8d1f['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x3406ac+0x1)+'.','row':_0x3e5937,'column':_0x5bcda8,'from':this['name']});continue;}const _0x46af46=_0x3d59d9['ilo']['length']-0x1,_0x565980=_0x3d59d9['ilo'][_0x46af46];if(!_0x565980['taxonomy_level']){const {row:_0x4cad3b,column:_0x5ca9c5}=await _0x565a1f['findValue'](_0x565980['statement']);_0x5b8d1f['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x3406ac+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x4cad3b,'column':_0x5ca9c5,'from':this['name']});continue;}if(_0x565980['taxonomy_level']!==_0x3d59d9['taxonomy_level']){const {row:_0x1c451b,column:_0x15907b}=await _0x565a1f['findValue'](_0x565980['statement']);_0x5b8d1f['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x3406ac+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x565980['taxonomy_level']+'\x20!==\x20'+_0x3d59d9['taxonomy_level']+')','row':_0x1c451b,'column':_0x15907b,'from':this['name']});}}this['report'](_0x5b8d1f,_0x20eb64,_0xe30ab0);}}
|
|
49
49
|
|
|
50
|
-
const whitelist$1=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](
|
|
50
|
+
const whitelist$1=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](_0x1ed820,_0x589ce7,_0xd4fe85,_0x3bca99){const _0x24a99a=[];if(!_0x3bca99){_0x589ce7['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x56e5eb=0x0;_0x56e5eb<_0x3bca99['co']['length'];_0x56e5eb++){const _0x27ae0b=_0x3bca99['co'][_0x56e5eb];if(!_0x27ae0b['taxonomy_level']){_0x24a99a['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x56e5eb+0x1),'from':this['name']});continue;}if(!whitelist$1['includes'](_0x27ae0b['taxonomy_level'])){const {row:_0x5733ce,column:_0x81353}=await _0xd4fe85['findValue'](_0x27ae0b['statement']);let _0x31a315={'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x27ae0b['taxonomy_level']['toUpperCase'](),'from':this['name']};(_0x5733ce!==-1||_0x81353!==-1)&&(_0x31a315['row']=_0x5733ce,_0x31a315['column']=_0x81353),_0x24a99a['push'](_0x31a315);}}this['report'](_0x24a99a,_0x1ed820,_0x589ce7);return;}}
|
|
51
51
|
|
|
52
52
|
const taxoOrder={'remembering':0x1,'understanding':0x2,'applying':0x3,'analyzing':0x4,'evaluating':0x5,'creating':0x6};
|
|
53
53
|
|
|
54
|
-
class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](
|
|
54
|
+
class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](_0x3c2d23,_0xab4a20,_0x28ef3c,_0x2de467){const _0x48edc8=[];if(!_0x2de467){_0xab4a20['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x3af490=0x0;_0x3af490<_0x2de467['co']['length'];_0x3af490++){const _0x487fac=_0x2de467['co'][_0x3af490];if(!_0x487fac){const {row:_0x27237e,column:_0x4276e1}=await _0x28ef3c['findValue'](_0x3af490+0x1+'');_0x48edc8['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x3af490+0x1)+'.','row':_0x27237e,'column':_0x4276e1+0x1,'from':this['name']});continue;}if(!_0x487fac?.['ilo']){const {row:_0x49ccac,column:_0x26ad0c}=await _0x28ef3c['findValue'](_0x487fac['statement']);_0x48edc8['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x3af490+0x1)+'.','row':_0x49ccac,'column':_0x26ad0c,'from':this['name']});continue;}const _0x2ada2f=await _0x28ef3c['findValue'](_0x487fac['ilo'][0x0]['statement']),_0x373bcf=_0x487fac['ilo']['map'](_0x3b7237=>taxoOrder[_0x3b7237['taxonomy_level']]);let _0x270789=_0x373bcf[0x0];for(let _0x11f318=0x1;_0x11f318<_0x373bcf['length'];_0x11f318++){if(_0x373bcf[_0x11f318]<_0x270789){_0x48edc8['push']({'error':'Under\x20CO\x20'+(_0x3af490+0x1)+',\x20ILO\x20'+(_0x11f318+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x11f318+'\x27s.','row':_0x2ada2f['row'],'column':_0x2ada2f['column']+_0x11f318,'from':this['name']});continue;}_0x270789=_0x373bcf[_0x11f318];}}this['report'](_0x48edc8,_0x3c2d23,_0xab4a20);}}
|
|
55
55
|
|
|
56
|
-
const minPerfTarget=0x32,minPassScore=0x32;class
|
|
56
|
+
const minPerfTarget$1=0x32,minPassScore$1=0x32;class MinILOPerfTarget extends DTValidator{constructor(){super('MIN_ILO_PERF_TARGET');}async['validate'](_0x1786e9,_0x148195,_0x1d485e,_0x47f8c6){const {success:_0x1a9335,data:_0x5ade13}=_0x1d485e['getTable'](),_0x57ec90=[];if(!_0x1a9335){_0x57ec90['push']({'error':'Unable\x20to\x20access\x20COAEP\x20table.','from':this['name']});return;}const {table:_0x1fc1ce}=_0x5ade13;for(let _0x26e5a6=0x0;_0x26e5a6<_0x1fc1ce['length'];_0x26e5a6++){const _0x5ec270=_0x1fc1ce[_0x26e5a6],[_0x82d6f1,_0x12c5e9]=_0x5ec270[0x4];if(!_0x82d6f1)_0x57ec90['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x26e5a6,'column':0x4,'from':this['name']});else _0x82d6f1<minPerfTarget$1&&_0x57ec90['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget$1+'.','row':_0x26e5a6,'column':0x4,'from':this['name']});if(!_0x12c5e9)_0x57ec90['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x26e5a6,'column':0x6,'from':this['name']});else _0x12c5e9<minPassScore$1&&_0x57ec90['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore$1+'.','row':_0x26e5a6,'column':0x6,'from':this['name']});}this['report'](_0x57ec90,_0x1786e9,_0x148195);}}
|
|
57
57
|
|
|
58
|
-
const coaepHeaders=['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target'];class CoaepDT extends DataTable{constructor(){super('CoaepDT',coaepHeaders),this['state']={'faculty':null,'course':null,'sy':null,'semester':null},this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new
|
|
58
|
+
const coaepHeaders=['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target'];class CoaepDT extends DataTable{constructor(){super('CoaepDT',coaepHeaders),this['state']={'faculty':null,'course':null,'sy':null,'semester':null},this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinILOPerfTarget());}async['validateFields'](_0x15e7d4,_0x5cf936){await this['assertInitialized']()['catch'](_0x312972=>{_0x5cf936['push'](_0x312972);return;});const _0x24186e=[];let _0x12ea33=null,_0x4df2f3=null;for(let _0x233734=0x0;_0x233734<this['table']['length'];_0x233734++){const _0x4b5799=[],_0x6fe96=this['table'][_0x233734],_0x56aca3=_0x6fe96[0x0]||_0x12ea33,_0x413b3b=_0x6fe96[0x1]||_0x4df2f3,_0x23bbdd=_0x6fe96[0x2],_0x1dee5b=_0x6fe96[0x3],_0x54ca0b=_0x6fe96[0x4];if(!_0x56aca3)_0x4b5799['push'](0x0);if(!_0x413b3b)_0x4b5799['push'](0x1);if(!_0x23bbdd)_0x4b5799['push'](0x2);if(!_0x1dee5b)_0x4b5799['push'](0x3);if(!_0x54ca0b)_0x4b5799['push'](0x4);if(_0x4df2f3!==_0x413b3b)this['validateObjectiveGrammar'](_0x413b3b,_0x233734,0x1,_0x5cf936);_0x12ea33=_0x56aca3,_0x4df2f3=_0x413b3b;for(const _0x612395 of _0x4b5799){_0x24186e['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x612395],'row':_0x233734,'column':_0x612395});}if(_0x23bbdd)this['validateObjectiveGrammar'](_0x23bbdd,_0x233734,0x2,_0x5cf936);}if(_0x24186e['length']>0x0)_0x5cf936['push'](..._0x24186e);else _0x15e7d4['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x73a6e7){try{const _0x13b5a4=[],_0x10591a=_0x868906['parse'](_0x73a6e7,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x4ce3be,coIdx:_0x2fb149,iloIdx:_0x3eefae,assessToolIdx:_0x439416,perfTargetIdx:_0xfe009f}=getCoaepHeader(_0x10591a);if(_0x4ce3be===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x10591a['forEach'](_0x216f06=>{const _0x37a6db=_0x216f06['indexOf']('Name\x20of\x20Faculty:'),_0x267113=_0x216f06['indexOf']('School\x20Year'),_0x5a5910=_0x216f06['indexOf']('Course:'),_0x2ea3bb=_0x216f06['indexOf']('Semester');_0x37a6db!==-0x1&&(this['state']['faculty']=_0x216f06[_0x37a6db+0x1]?.['trim']()||this['state']['faculty']);_0x267113!==-0x1&&(this['state']['sy']=_0x216f06[_0x267113+0x1]?.['trim']()||this['state']['sy']);_0x5a5910!==-0x1&&(this['state']['course']=_0x216f06[_0x5a5910+0x1]?.['trim']()||this['state']['course']);if(_0x2ea3bb!==-0x1){const _0x445fe6=_0x216f06[_0x2ea3bb+0x1]?.['trim']()||'',_0x4e9858=_0x445fe6['match'](/\d+/)?.[0x0];this['state']['semester']=_0x4e9858?parseInt(_0x4e9858,0xa):this['state']['semester'];}});for(let _0x47c26d=0x0;_0x47c26d<=_0x10591a['length'];_0x47c26d++){const _0x5e804f=_0x10591a[_0x47c26d];if(!_0x5e804f)break;if(_0x47c26d<=_0x4ce3be)continue;if(!_0x5e804f[_0x3eefae])break;let _0x58f00b=_0x5e804f[_0x2fb149-0x1]?.['trim']()||'',_0x2fff3a=_0x5e804f[_0x2fb149]?.['trim']()||'',_0x2db04c=_0x5e804f[_0x3eefae]?.['trim']()||'';/^\d+$/['test'](_0x5e804f[_0x2fb149]?.['trim']()||'')&&(_0x58f00b=_0x5e804f[_0x2fb149]?.['trim']()||'',_0x2fff3a=_0x5e804f[_0x2fb149+0x1]?.['trim']()||'');let _0x120d3d=null;if(_0x2fff3a){const {cognitive_level:_0x251952,taxonomy_level:_0x49e1d4,verb:_0x4bb53f,rest:_0x39e00f}=extractFromObjective(_0x2fff3a);_0x120d3d=[_0x251952,_0x49e1d4,_0x4bb53f,_0x39e00f];}let _0x5a33ee;{const {cognitive_level:_0x16a123,taxonomy_level:_0x431bab,verb:_0x5dc9b8,rest:_0x47e133}=extractFromObjective(_0x2db04c);_0x5a33ee=[_0x16a123,_0x431bab,_0x5dc9b8,_0x47e133];}const _0x39d683=_0x5e804f[_0xfe009f]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0xc3c540,passing_score:_0x413248}=performaceTarget(_0x39d683);_0x13b5a4['push']([_0x58f00b,_0x120d3d,_0x5a33ee,_0x5e804f[_0x439416]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0xc3c540,_0x413248]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x13b5a4};}catch(_0x46eca2){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x46eca2};}}async['toJson'](){const _0x42a1f5=[],_0x517788=[],_0x227b76='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x2d48aa={'faculty':this['state']['faculty'],'course':this['state']['course'],'sy':this['state']['sy'],'semester':this['state']['semester'],'co':[]};let _0x3cc767=null,_0x5414bc='',_0x3d002e=[null,null];this['table']['forEach']((_0x5045d6,_0x3cf79a)=>{if(_0x3cf79a===0x0&&!_0x5045d6[0x1])_0x517788['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x227b76});_0x5045d6[0x1]&&(_0x5414bc='',_0x3d002e=[null,null]);const _0x127ffc=_0x5045d6[0x1],_0x172da3=_0x5045d6[0x2],_0x482275=_0x5045d6[0x3]||_0x5414bc,_0xb0bafb=_0x5045d6[0x4]||_0x3d002e;if(!_0x172da3)_0x517788['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x227b76});if(!_0x482275)_0x517788['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x3cf79a,'column':0x3,'from':_0x227b76});if(!_0xb0bafb)_0x517788['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x3cf79a,'column':0x4,'from':_0x227b76});if(_0x127ffc){const [_0x50949a,_0x1618ba,_0x39dfdb,_0x204738]=_0x127ffc,_0x4540e1={'statement':_0x204738,'ilo':[],'taxonomy_level':_0x1618ba,'cognitive_level':_0x50949a,'verb':_0x39dfdb};_0x3cc767=_0x4540e1,_0x2d48aa['co']['push'](_0x4540e1);}const [_0x424cca,_0x1ca198,_0x460363,_0x270cfb]=_0x172da3,[_0x5d6324,_0x36299b]=_0xb0bafb,_0xb03a4f={'statement':_0x270cfb,'assessment_tool':_0x482275,'performance_target':_0x5d6324,'passing_score':_0x36299b,'cognitive_level':_0x424cca,'taxonomy_level':_0x1ca198,'verb':_0x460363};_0x3cc767['ilo']['push'](_0xb03a4f);});if(_0x517788['length'])return _0x517788['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x227b76}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x2d48aa,'validMsgs':_0x42a1f5,'tableErrors':_0x517788}};return _0x42a1f5['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x2d48aa,'validMsgs':_0x42a1f5,'tableErrors':_0x517788}};}catch(_0x13781b){return _0x517788['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x227b76}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x13781b,'data':{'jsonObj':null,'tableErrors':_0x517788}};}}['validateObjectiveGrammar'](_0x573e21,_0x3e18fd,_0x57bb0c,_0x597d0f){if(!_0x573e21){_0x597d0f['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x3e18fd,'column':_0x57bb0c,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x9d2d11,_0x516ff8,_0x1d30db,_0x35781b]=_0x573e21,_0x5f0a30=[];if(!_0x9d2d11)_0x5f0a30['push']('Cognitive\x20Level');if(!_0x516ff8)_0x5f0a30['push']('Taxonomy\x20Level');if(!_0x1d30db)_0x5f0a30['push']('Verb');if(!_0x5f0a30['length'])return;_0x597d0f['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x5f0a30['join'](',\x20')+'.','row':_0x3e18fd,'column':_0x57bb0c,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}}
|
|
59
59
|
|
|
60
|
-
const whitelist=['applying','analyzing','evaluating','creating'];class MinPItaxo extends DTValidator{constructor(){super('MIN_PI_TAXO');}async['validate'](
|
|
60
|
+
const whitelist=['applying','analyzing','evaluating','creating'];class MinPItaxo extends DTValidator{constructor(){super('MIN_PI_TAXO');}async['validate'](_0x13e092,_0x11c508,_0x1991d7,_0xef0f50){const _0x774054=[],{success:_0x5f2e20,data:_0x26983d}=_0x1991d7['getTable']();if(!_0x5f2e20){_0x11c508['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x28fa01}=_0x26983d;for(let _0xd20a5b=0x0;_0xd20a5b<_0x28fa01['length'];_0xd20a5b++){const _0x35042a=_0x28fa01[_0xd20a5b],_0x4b673e=_0x35042a[0x1]?.['toLowerCase']();if(!_0x4b673e)continue;!whitelist['includes'](_0x4b673e)&&_0x774054['push']({'error':'Cannot\x20have\x20PO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x4b673e['toUpperCase'](),'row':_0xd20a5b,'column':0x1,'from':this['name']});}this['report'](_0x774054,_0x13e092,_0x11c508);return;}}
|
|
61
61
|
|
|
62
|
-
const
|
|
62
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPIPerfTarget extends DTValidator{constructor(){super('MIN_PI_PERF_TARGET');}async['validate'](_0x3317f9,_0x2f8737,_0x5ed794,_0x2525fc){const _0x6f877b=[],{success:_0x5bf021,data:_0x3738a3}=_0x5ed794['getTable']();if(!_0x5bf021){_0x2f8737['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x5b4bc0}=_0x3738a3;for(let _0x4fc96c=0x0;_0x4fc96c<_0x5b4bc0['length'];_0x4fc96c++){const _0x399373=_0x5b4bc0[_0x4fc96c],[_0x5b6021,_0x5d46ed]=_0x399373[0x6];if(!_0x5b6021)_0x6f877b['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x4fc96c,'column':0x6,'from':this['name']});else _0x5b6021<minPerfTarget&&_0x6f877b['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x4fc96c,'column':0x6,'from':this['name']});if(!_0x5d46ed)_0x6f877b['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x4fc96c,'column':0x6,'from':this['name']});else _0x5d46ed<minPassScore&&_0x6f877b['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x4fc96c,'column':0x6,'from':this['name']});}this['report'](_0x6f877b,_0x3317f9,_0x2f8737);return;}}
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
const poaepHeaders=['Program\x20Outcome','Taxonomy\x20Level','Performance\x20Indicator','Formative\x20Course','Summative\x20Course','Assessment\x20Tool','Performance\x20Target'];class PoaepDT extends DataTable{constructor(){super('PoaepDT',poaepHeaders),this['state']={'program':null},this['useValidator'](new MinPItaxo()),this['useValidator'](new MinPIPerfTarget());}async['fromCSVString'](_0x5a5dbe){try{const _0x3c1136=[],_0x87fd02=_0x868906['parse'](_0x5a5dbe,{'skipEmptyLines':![]})['data'];_0x87fd02['forEach'](_0x32d0cd=>{_0x32d0cd['forEach'](_0x3e107e=>{_0x3e107e['includes']('PROGRAM:')&&(this['state']['program']=_0x3e107e['replace']('PROGRAM:','')['trim']()['toUpperCase']());});});const {headerIdx:_0x587945,poIdx:_0x84a138,tlIdx:_0x4ba2d2,piIdx:_0x4560eb,fcIdx:_0x3e468b,scIdx:_0xaabda9,atIdx:_0x2b45a7,ptIdx:_0x7d6432}=getPoaepHeader(_0x87fd02);if(_0x587945===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20check\x20the\x20CSV.');let _0x533868='',_0xbe901='',_0x57af24='';for(let _0x561a30=_0x587945+0x1;_0x561a30<_0x87fd02['length'];_0x561a30++){const _0x1d4357=_0x87fd02[_0x561a30];if(!_0x1d4357)break;if(_0x561a30<=_0x587945)continue;let _0x2b4c3e=_0x1d4357[_0x84a138]?.['trim']()||'';if(_0x2b4c3e){_0x533868='',_0xbe901='',_0x57af24='';const [_0x4a401b,_0x1fbd72]=this['extractPoDesc'](_0x2b4c3e);if(_0x1fbd72)_0x2b4c3e=_0x1fbd72;}const _0x457fe4=_0x1d4357[_0x4ba2d2]?.['trim']()['toLowerCase']()||null,_0x4d503b=_0x1d4357[_0x4560eb]?.['trim']()||'',_0x18babc=_0x1d4357[_0x3e468b]?.['trim']()||'',_0x2a777f=_0x1d4357[_0xaabda9]?.['trim']()||_0x533868,_0x4998a8=_0x1d4357[_0x2b45a7]?.['trim']()||_0xbe901,_0x148970=_0x1d4357[_0x7d6432]?.['trim']()||_0x57af24,{performance_target:_0x186071,passing_score:_0x2cd085}=performaceTarget(_0x148970);if(!_0x18babc)break;const _0xdbd8c4=_0x18babc['split'](',')['map'](_0x364e22=>_0x364e22['trim']());_0x3c1136['push']([_0x2b4c3e,_0x457fe4,_0x4d503b,_0xdbd8c4,_0x2a777f,_0x4998a8,[_0x186071,_0x2cd085]]),_0x533868=_0x2a777f,_0xbe901=_0x4998a8,_0x57af24=_0x148970;}if(_0x3c1136['length']===0x0)throw new Error('No\x20data\x20parsed.\x20Please\x20check\x20the\x20CSV.');return {'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':_0x3c1136};}catch(_0x2ee78b){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x2ee78b};}}async['toJson'](){const _0x541ce4=[],_0x1d7122=[],_0x5860ef='POAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x164d33={'po':[]};let _0x16ad2d={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x511c97=null,_0x2f202=null,_0x381270=null;for(let _0x270ee2=0x0;_0x270ee2<this['table']['length'];_0x270ee2++){const _0x4e5962=this['table'][_0x270ee2],_0x57a5a9=[],_0x578188=_0x4e5962[0x0]?.['trim']()||null;_0x578188&&_0x578188!==_0x16ad2d['po_desc']&&(_0x16ad2d={'po_desc':_0x578188,'seq_no':_0x16ad2d['seq_no']+0x1,'PerfIndicators':[]},_0x164d33['po']['push'](_0x16ad2d),_0x511c97=null,_0x2f202=null,_0x381270=null);if(_0x16ad2d['po_desc']==='')_0x1d7122['push']({'error':'Cannot\x20start\x20with\x20empty\x20Program\x20Outcome.','row':_0x270ee2,'column':0x0,'from':_0x5860ef});const _0x3efdb7=_0x4e5962[0x1]||null,_0x1290a8=_0x4e5962[0x2]||null,_0x57d67b=_0x4e5962[0x3]||null,_0xcee9dd=_0x4e5962[0x4]||_0x511c97,_0x42bb48=_0x4e5962[0x5]||_0x2f202,_0x4dd320=_0x4e5962[0x6]||_0x381270;(!_0x57d67b||_0x57d67b['length']===0x0)&&_0x1d7122['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x270ee2,'column':0x3,'from':_0x5860ef});!_0x4dd320&&_0x1d7122['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x270ee2,'column':0x6,'from':_0x5860ef});if(_0x57a5a9['length']>0x0){_0x1d7122['push'](..._0x57a5a9);continue;}const _0xc8d99c={'pi_desc':_0x1290a8,'FormativeCourses':_0x57d67b['map'](_0x345063=>({'course_id':_0x345063,'cognitive_level':null})),'SummativeCourse':{'course_id':_0xcee9dd},'TaxonomyLevel':_0x3efdb7?{'label':_0x3efdb7}:null,'AssessmentTool':{'at_desc':_0x42bb48},'PerformanceTargets':{'target_percent':_0x4dd320[0x0],'min_score':_0x4dd320[0x1]}};_0x16ad2d['PerfIndicators']['push'](_0xc8d99c);}if(_0x1d7122['length']>0x0)return _0x1d7122['push']({'error':'Converted\x20POAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x5860ef}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x164d33,'validMsgs':_0x541ce4,'tableErrors':_0x1d7122}};return _0x541ce4['push']('Successfully\x20converted\x20POAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':{'jsonObj':_0x164d33,'validMsgs':_0x541ce4,'tableErrors':_0x1d7122}};}catch(_0xa0e97e){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0xa0e97e};}}async['validateFields'](_0x4b9e14,_0x16ad1b){await this['assertInitialized']()['catch'](_0x546c67=>{_0x16ad1b['push'](_0x546c67);return;});const _0x3441ea=[];let _0x24f247=null,_0xd009dd=null,_0x2aa7ba=null,_0x171928=null;for(let _0x3ec7f9=0x0;_0x3ec7f9<this['table']['length'];_0x3ec7f9++){const _0x3e686b=[],_0x143783=this['table'][_0x3ec7f9];_0x143783[0x0]&&_0x143783[0x0]!==_0x24f247&&(_0xd009dd=null,_0x2aa7ba=null,_0x171928=null);const _0x594125=_0x143783[0x0]||_0x24f247,_0x3f1aff=_0x143783[0x1]||null,_0x2a1380=_0x143783[0x2]||null,_0x2f252c=_0x143783[0x3]||null,_0x3768dd=_0x143783[0x4]||_0xd009dd,_0x4e61a2=_0x143783[0x5]||_0x2aa7ba,_0x3f6804=_0x143783[0x6]||_0x171928;if(!_0x594125)_0x3e686b['push'](0x0);if(!_0x3f1aff)_0x3e686b['push'](0x1);if(!_0x2a1380)_0x3e686b['push'](0x2);if(!_0x2f252c)_0x3e686b['push'](0x3);if(!_0x3768dd)_0x3e686b['push'](0x4);if(!_0x4e61a2)_0x3e686b['push'](0x5);if(!_0x3f6804)_0x3e686b['push'](0x6);_0x3e686b['length']>0x0&&_0x3e686b['forEach'](_0x59e570=>{_0x3441ea['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x59e570]+'.','row':_0x3ec7f9,'column':_0x59e570,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'});}),_0x2f252c?.['length']===0x0&&_0x3441ea['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x3ec7f9,'column':0x3,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'}),_0x24f247=_0x594125,_0xd009dd=_0x3768dd,_0x2aa7ba=_0x4e61a2,_0x171928=_0x3f6804;}if(_0x3441ea['length']>0x0)_0x16ad1b['push'](..._0x3441ea);else _0x4b9e14['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}['extractPoDesc'](_0x57d99a){const _0x27f235=/^.*(PO\d+):(.*)$/,_0x7d25f4=_0x27f235['exec'](_0x57d99a['trim']());return _0x7d25f4?_0x7d25f4['slice'](0x1):['',_0x57d99a['trim']()];}}
|
|
65
|
+
|
|
66
|
+
class Client{['BASE_URL'];constructor(_0x41cff6){this['BASE_URL']=_0x41cff6;}['Parser'](){return {'curriculum':async _0x35fd32=>{const _0x47ef6f=await uploadCurriculum(this['BASE_URL'],_0x35fd32);return _0x47ef6f;},'courseOffering':async _0x3075fe=>{const _0x2f55eb=await uploadCourseOffering(this['BASE_URL'],_0x3075fe);return _0x2f55eb;},'coaep':async(_0x378eb6,_0x4806d9)=>{const _0x35e52b=await uploadCOAEP(this['BASE_URL'],_0x378eb6,_0x4806d9);return _0x35e52b;},'enrolledStudent':async _0x64665c=>{const _0x4f35a5=await uploadEnrolledStudent(this['BASE_URL'],_0x64665c);return _0x4f35a5;},'classlist':async(_0x41514e,_0x1a34f4,_0x4d1882)=>{const _0x4caf1a=await uploadClassList(this['BASE_URL'],_0x41514e,_0x1a34f4,_0x4d1882);return _0x4caf1a;},'assessmentData':async _0x4cf1bc=>{const _0x3b9dd0=await uploadAssessmentData(this['BASE_URL'],_0x4cf1bc);return _0x3b9dd0;},'deptFaculty':async _0x38e12e=>{const _0x1e67bc=await uploadDeptFaculty(this['BASE_URL'],_0x38e12e);return _0x1e67bc;},'poaep':async(_0x487158,_0x275b10,_0x1917cb,_0x48d3be)=>{const _0x8b23eb=await uploadPOAEP(this['BASE_URL'],_0x487158,_0x275b10,_0x1917cb,_0x48d3be);return _0x8b23eb;},'CoaepDT':CoaepDT,'PoaepDT':PoaepDT};}}
|
|
65
67
|
|
|
66
68
|
export { Client as default };
|