@obe-loms/coms-parser 1.6.15 → 1.6.17
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 _0x409e19 from 'papaparse';
|
|
2
|
+
import * as _0x1eaca6 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x3af260){let _0x1dfc01='',_0x3a730f='',_0x5ae6fe=0x0,_0x3be1b2=null;const _0x13f4bd=[];return _0x409e19['parse'](_0x3af260,{'skipEmptyLines':!![],'complete':_0x4e8d8f=>{_0x4e8d8f['data']['forEach'](_0x28f0f4=>{const _0xf0f1b0=_0x28f0f4['map'](_0x2f6a47=>(_0x2f6a47??'')['toString']()['trim']()),_0x7e9906=_0xf0f1b0[0x0]??'';if(_0x7e9906['includes']('Rev#')){const _0x5ab2d3=_0x7e9906['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x5ab2d3&&(_0x1dfc01=_0x5ab2d3[0x1]?.['trim']()??'',_0x3a730f=_0x5ab2d3[0x2]?.['trim']()??'',_0x5ae6fe=parseInt(_0x5ab2d3[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x7e9906)){_0x3be1b2=0x1;return;}if(/SECOND YEAR/i['test'](_0x7e9906)){_0x3be1b2=0x2;return;}if(/THIRD YEAR/i['test'](_0x7e9906)){_0x3be1b2=0x3;return;}if(/FOURTH YEAR/i['test'](_0x7e9906)){_0x3be1b2=0x4;return;}if(/FIFTH YEAR/i['test'](_0x7e9906)){_0x3be1b2=0x5;return;}if(/First Semester/i['test'](_0x7e9906)||/Second Semester/i['test'](_0x7e9906)||/Summer/i['test'](_0x7e9906))return;const _0x5cff3a=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x5cff3a['forEach'](({sem:_0x989bc5,offset:_0x1b6d4e})=>{const _0x288438=_0xf0f1b0[_0x1b6d4e]??'',_0x327ad4=_0xf0f1b0[_0x1b6d4e+0x1]??'',_0x4614fb=_0xf0f1b0[_0x1b6d4e+0x2]??'',_0x28649c=_0xf0f1b0[_0x1b6d4e+0x3]??'',_0x2db0f6=_0xf0f1b0[_0x1b6d4e+0x4]??'';_0x288438&&_0x3be1b2&&_0x13f4bd['push']({'curr_id':_0x1dfc01,'program_name':_0x3a730f,'revision_no':_0x5ae6fe,'year_level':_0x3be1b2,'sem':_0x989bc5,'course_id':_0x288438,'course_desc':_0x327ad4,'total_units':_0x4614fb,'lec_unit':_0x28649c,'lab_unit':_0x2db0f6});});});}}),_0x13f4bd;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x2b6098,_0x17cd0a){return new Promise((_0x23cdef,_0x473c02)=>{const _0x1e54eb=new FileReader();_0x1e54eb['onload']=_0x35b5df=>{const _0x4c9938=_0x35b5df['target']?.['result'];if(!_0x4c9938){_0x473c02(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0xd375d8=_0x1eaca6['read'](_0x4c9938,{'type':'array'});!_0x17cd0a&&(_0x17cd0a=_0xd375d8['SheetNames'][0x0]);if(!_0x17cd0a){_0x473c02(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x23107b=_0xd375d8['Sheets'][_0x17cd0a];if(!_0x23107b){_0x473c02(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x246bfc=_0x1eaca6['utils']['sheet_to_csv'](_0x23107b,{'strip':!![]}),_0x10da65=_0x2b6098['name']['replace'](/\.[^/.]+$/,'.csv'),_0x1a4916=new File([_0x246bfc],_0x10da65,{'type':'text/csv','lastModified':Date['now']()});_0x23cdef(_0x1a4916);}catch(_0x28608d){_0x473c02(_0x28608d);}},_0x1e54eb['onerror']=()=>{_0x473c02(new Error('File\x20reading\x20failed'));},_0x1e54eb['readAsArrayBuffer'](_0x2b6098);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x180611,_0x5a35be){try{const _0x3061c=await convertToCSVFile(_0x5a35be),_0x459e5c=await _0x3061c['text'](),_0x14c46c=parseCurriculum(_0x459e5c),_0x3739c9=_0x409e19['unparse'](_0x14c46c),_0x18f85f=new File([_0x3739c9],_0x3061c['name'],{'type':'text/csv'}),_0x5d6f96=new FormData();_0x5d6f96['append']('csvFile',_0x18f85f);const _0x1b4941=await fetch(_0x180611+'/curr-courses/upload',{'method':'POST','body':_0x5d6f96});if(!_0x1b4941['ok']){const _0x4b0cfd=await _0x1b4941['json']();throw _0x4b0cfd;}return _0x1b4941['json']();}catch(_0x5b85df){throw _0x5b85df;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x5eb84a){let _0x241712='',_0x2b39d5='';const _0x2bb821=[],_0xce0d4a=_0x409e19['parse'](_0x5eb84a,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x1f9b84=_0xce0d4a['data'];for(let _0x2c1eac=0x0;_0x2c1eac<Math['min'](0x5,_0x1f9b84['length']);_0x2c1eac++){const _0x2a0cb0=_0x1f9b84[_0x2c1eac];if(_0x2a0cb0&&_0x2a0cb0['length']>0x0){const _0x20249f=_0x2a0cb0[0x0]?.['toString']()||'',_0x56de72=_0x20249f['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x56de72){_0x241712=_0x56de72[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x56de72[0x2]){const _0xbdf37=_0x56de72[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0xbdf37&&_0xbdf37[0x2]&&_0xbdf37[0x4]&&(_0x2b39d5=_0xbdf37[0x2]+_0xbdf37[0x4]);}}}}let _0x33f90e=-1;for(let _0x20d825=0x0;_0x20d825<_0x1f9b84['length'];_0x20d825++){const _0x19106f=_0x1f9b84[_0x20d825];if(_0x19106f&&_0x19106f['some'](_0x2e5b4f=>_0x2e5b4f?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x33f90e=_0x20d825;break;}}if(_0x33f90e===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x51eddf={'code':'','description':'','unit':0x0};for(let _0x41476c=_0x33f90e+0x1;_0x41476c<_0x1f9b84['length'];_0x41476c++){const _0x4b7cef=_0x1f9b84[_0x41476c];if(!_0x4b7cef||_0x4b7cef['length']<0x8)continue;const _0x22aca5=_0x4b7cef[0x1]?.['toString']()['trim']()||'',_0x11810a=_0x4b7cef[0x4]?.['toString']()['trim']()||'',_0x272950=_0x4b7cef[0x5]?.['toString']()['trim']()||'',_0x2fe372=_0x4b7cef[0x6]?.['toString']()['trim']()||'',_0x59b1f5=_0x4b7cef[0x7]?.['toString']()['trim']()||'',_0x34710e=_0x4b7cef[0x3]?.['toString']()['trim']()||'';let _0x16e70b=_0x4b7cef[0x0]?.['toString']()['trim']()||'',_0x14b6b5=_0x4b7cef[0x2]?.['toString']()['trim']()||'';if(!_0x22aca5)continue;if(!_0x16e70b)_0x16e70b=_0x51eddf['code'];if(!_0x14b6b5)_0x14b6b5=_0x51eddf['description'];let _0x5f1431=_0x51eddf['unit'];if(_0x34710e){const _0x543d39=_0x34710e['match'](/(\d+)/);_0x543d39&&_0x543d39[0x1]&&(_0x5f1431=parseInt(_0x543d39[0x1],0xa));}const _0x460608={'sem':_0x241712,'school_year':_0x2b39d5,'code':_0x16e70b,'course_no':_0x22aca5,'course_desc':_0x14b6b5,'unit':_0x5f1431,'time':_0x11810a,'days':_0x272950,'faculty':_0x2fe372,'room':_0x59b1f5};_0x51eddf['code']=_0x16e70b,_0x51eddf['description']=_0x14b6b5,_0x51eddf['unit']=_0x5f1431,_0x2bb821['push'](_0x460608);}return _0x2bb821;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x1a373f,_0x3432e8){try{const _0x38b5bb=await convertToCSVFile(_0x3432e8),_0x494d53=await _0x38b5bb['text'](),_0x5d4e41=parseCourseOffering(_0x494d53),_0x57a38f=_0x409e19['unparse'](_0x5d4e41),_0x20a2c1=new File([_0x57a38f],_0x38b5bb['name'],{'type':'text/csv'}),_0xdbe62f=new FormData();_0xdbe62f['append']('csvFile',_0x20a2c1);const _0x4d386d=await fetch(_0x1a373f+'/course-offerings/upload',{'method':'POST','body':_0xdbe62f});if(!_0x4d386d['ok']){const _0xe13ca9=await _0x4d386d['json']();throw _0xe13ca9;}return _0x4d386d['json']();}catch(_0x1c6274){throw _0x1c6274;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x281577){if(!_0x281577)return {'performance_target':null,'passing_score':null};const _0xdc0294=_0x281577['match'](/\d+/g);return {'performance_target':_0xdc0294?.[0x0]?parseInt(_0xdc0294[0x0],0xa):null,'passing_score':_0xdc0294?.[0x1]?parseInt(_0xdc0294[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(_0x496937){let _0x5c4f3d={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0xab9050=0x0;_0xab9050<Math['min'](_0x496937['length'],0x14);_0xab9050++){const _0x4c9031=(_0x496937[_0xab9050]??[])['map'](_0x2b9a2d=>_0x2b9a2d['toLowerCase']()['trim']()),_0x141b88=_0x4c9031['findIndex'](_0x3ab468=>HEADERS$1['co']['some'](_0x2d6928=>_0x3ab468['includes'](_0x2d6928))),_0x8c99e2=_0x4c9031['findIndex'](_0x50faf3=>HEADERS$1['ilo']['some'](_0x2f59b5=>_0x50faf3['includes'](_0x2f59b5))),_0x5b8977=_0x4c9031['findIndex'](_0x27d6af=>HEADERS$1['assessTool']['some'](_0x432296=>_0x27d6af['includes'](_0x432296))),_0x2b372c=_0x4c9031['findIndex'](_0x1d2e40=>HEADERS$1['perfTarget']['some'](_0x15433a=>_0x1d2e40['includes'](_0x15433a))),_0x28fc5d=[_0x141b88,_0x8c99e2,_0x5b8977,_0x2b372c]['filter'](_0x2e6f47=>_0x2e6f47!==-1)['length'];if(_0x28fc5d>=0x3){_0x5c4f3d={'headerRowIndex':_0xab9050,'coIdx':_0x141b88,'iloIdx':_0x8c99e2,'assessToolIdx':_0x5b8977,'perfTargetIdx':_0x2b372c};break;}}return _0x5c4f3d;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x2439b9){const _0x42b3da={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x2439b9['trim']()},_0x55a05e=_0x2439b9['match'](/^\((I|E|D)\)/);_0x55a05e&&(_0x42b3da['cognitive_level']=_0x55a05e[0x1],_0x42b3da['rest']=_0x2439b9['slice'](_0x55a05e[0x0]['length'])['trim']());const _0xef1f9f=_0x42b3da['rest']?.['match'](/^(.*?)\:/);_0xef1f9f&&(_0x42b3da['taxonomy_level']=_0xef1f9f[0x1]['trim']()['toLowerCase']()||null,_0x42b3da['rest']=_0x42b3da['rest']?.['slice'](_0xef1f9f[0x0]['length'])['trim']()||null);const _0x331d5f=_0x42b3da['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x331d5f)_0x42b3da['verb']=_0x331d5f[0x1]['trim']()['toLowerCase']()||null;else {const _0x510970=_0x42b3da['rest']?.['match'](/^\w+/);if(_0x510970)_0x42b3da['verb']=_0x510970[0x0]['trim']()['toLowerCase']()||null;}return _0x42b3da;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x36e9c6){const _0x22c7d4=_0x409e19['parse'](_0x36e9c6,{'skipEmptyLines':![]})['data'],_0x9a3207={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x182cbd,coIdx:_0x791224,iloIdx:_0x83a39f,assessToolIdx:_0x104e4f,perfTargetIdx:_0x596205}=getCoaepHeader(_0x22c7d4);if(_0x182cbd===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x22c7d4['forEach'](_0x32206d=>{const _0x49cdd6=_0x32206d['indexOf']('Name\x20of\x20Faculty:'),_0x1c6af6=_0x32206d['indexOf']('School\x20Year'),_0x27d94c=_0x32206d['indexOf']('Course:'),_0xbf2723=_0x32206d['indexOf']('Semester');_0x49cdd6!==-1&&(_0x9a3207['COAEP']['faculty']=_0x32206d[_0x49cdd6+0x1]?.['trim']()||_0x9a3207['COAEP']['faculty']);_0x1c6af6!==-1&&(_0x9a3207['COAEP']['sy']=_0x32206d[_0x1c6af6+0x1]?.['trim']()||_0x9a3207['COAEP']['sy']);_0x27d94c!==-1&&(_0x9a3207['COAEP']['course']=_0x32206d[_0x27d94c+0x1]?.['trim']()||_0x9a3207['COAEP']['course']);if(_0xbf2723!==-1){const _0x15120b=_0x32206d[_0xbf2723+0x1]?.['trim']()||'',_0x52d2cb=_0x15120b['match'](/\d+/)?.[0x0];_0x9a3207['COAEP']['semester']=_0x52d2cb?parseInt(_0x52d2cb,0xa):_0x9a3207['COAEP']['semester'];}});let _0xe88bc3=null;return _0x22c7d4['forEach']((_0x57c63f,_0x1ea329)=>{if(_0x1ea329<=_0x182cbd)return;let _0x24508c=_0x57c63f[_0x791224-0x1]?.['trim']()||'',_0x359f02=_0x57c63f[_0x791224]?.['trim']()||'';/^\d+$/['test'](_0x57c63f[_0x791224]?.['trim']()||'')&&(_0x24508c=_0x57c63f[_0x791224]?.['trim']()||'',_0x359f02=_0x57c63f[_0x791224+0x1]?.['trim']()||'');const _0x339b6f=_0x57c63f[_0x83a39f]?.['trim']()||'',_0x185541=_0x57c63f[_0x104e4f]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x2e03fa=_0x57c63f[_0x596205]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x24508c&&/^\d+$/['test'](_0x24508c)){_0xe88bc3&&_0x9a3207['COAEP']['co']['push'](_0xe88bc3);const _0x37c20b=_0x359f02,{verb:_0x7a3da0,cognitive_level:_0x170253,taxonomy_level:_0x1069be}=extractFromObjective(_0x37c20b);if(!_0x7a3da0)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x24508c+'\x20is\x20in\x20the\x20correct\x20format.'};_0xe88bc3={'statement':_0x37c20b,'ilo':[],'verb':_0x7a3da0,'cognitive_level':_0x170253,'taxonomy_level':_0x1069be};}if(_0xe88bc3&&_0x339b6f&&_0x2e03fa){const _0x4b7f9b=_0x339b6f['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x4b7f9b['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x4b7f9b['length']<0xa)return;let _0x3ee25e=_0x185541;if(!_0x3ee25e&&_0x4b7f9b['includes'](':')){const _0x3b9206=_0x4b7f9b['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x3b9206&&(_0x3ee25e=_0x3b9206[0x1]?.['trim']()||'');}const {performance_target:_0xa20b44,passing_score:_0x3de82f}=performaceTarget(_0x2e03fa),{verb:_0x9ffa1,cognitive_level:_0x1a139,taxonomy_level:_0x554045}=extractFromObjective(_0x4b7f9b);_0xe88bc3['ilo']['push']({'statement':_0x4b7f9b,'assessment_tool':_0x3ee25e,'performance_target':_0xa20b44,'passing_score':_0x3de82f,'verb':_0x9ffa1,'cognitive_level':_0x1a139,'taxonomy_level':_0x554045});}}),_0xe88bc3&&_0x9a3207['COAEP']['co']['push'](_0xe88bc3),_0x9a3207;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0xdbdd30,_0x2bc8c6,_0x23d902){try{const _0xe3f28c=await convertToCSVFile(_0x2bc8c6),_0x3ca694=await _0xe3f28c['text'](),_0x197ab4=parseCOAEP(_0x3ca694);console['log'](_0x197ab4);const _0x3b391f=await fetch(_0xdbdd30+'/coaeps/upload?course_id='+_0x23d902,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x197ab4)});if(!_0x3b391f['ok']){const _0x2b79a3=await _0x3b391f['json']();throw _0x2b79a3;}return _0x3b391f['json']();}catch(_0x4dbaae){throw _0x4dbaae;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x10beaa,_0x4d1455){try{const _0xd45132=await convertToCSVFile(_0x4d1455),_0x477b38=new FormData();_0x477b38['append']('csvFile',_0xd45132);const _0x20608b=await fetch(_0x10beaa+'/enrolled-students/upload',{'method':'POST','body':_0x477b38});if(!_0x20608b['ok']){const _0x2ef555=await _0x20608b['json']();throw _0x2ef555;}return _0x20608b['json']();}catch(_0x1d9492){throw _0x1d9492;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x172130){const _0x953ac6=_0x409e19['parse'](_0x172130,{'skipEmptyLines':!![]})['data'];let _0x44eab0='',_0x17356d='',_0x4b3e43='';const _0x1a54f9=[];return _0x953ac6['forEach'](_0x360570=>{const _0x41bf84=_0x360570['map'](_0x322d7f=>(_0x322d7f??'')['toString']()['trim']()),_0xf12bec=_0x41bf84[0x0]??'';if(_0xf12bec['startsWith']('Course\x20No:')){const _0x593ba1=_0xf12bec['replace']('Course\x20No:','')['trim'](),_0x2d93b2=_0x593ba1['split'](/\s+/);_0x4b3e43=_0x2d93b2[0x0]??'';const [_0x565911,_0x19b8a4]=(_0x2d93b2[0x1]??'')['split']('-');_0x17356d=_0x565911??'';const _0x36e0e5=(_0x19b8a4??'')['match'](/[a-z]$/);_0x44eab0=_0x36e0e5?_0x36e0e5[0x0]:'';}if(/^\d+$/['test'](_0xf12bec)){const _0x743a36=_0x41bf84[0x2]??'';_0x1a54f9['push']({'subj_code':_0x4b3e43,'student_no':_0x743a36,'course_id':_0x17356d,'section':_0x44eab0});}}),{'enrolledCourses':_0x1a54f9};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x1c3764,_0x3fbac,_0x33429f,_0x3c5f8b){try{const _0x168c2e=await convertToCSVFile(_0x3fbac),_0x308cff=await _0x168c2e['text'](),_0x28b8d2=parseClassList(_0x308cff),_0x56c398='subj_code='+_0x33429f+'&period_id='+_0x3c5f8b,_0x39776e=await fetch(_0x1c3764+'/enrolled-courses/upload?'+_0x56c398,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x28b8d2)});if(!_0x39776e['ok']){const _0x3dc85f=await _0x39776e['json']();throw _0x3dc85f;}return _0x39776e['json']();}catch(_0x610461){throw _0x610461;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x4c8034){const {data:_0x5a6f2e}=_0x409e19['parse'](_0x4c8034,{'skipEmptyLines':!![]}),_0xf448a1=_0x5a6f2e['filter'](_0x51dd8e=>_0x51dd8e['length']>0x0),_0x361df6=_0xf448a1['find'](_0x1096d7=>_0x1096d7['some'](_0x3970b4=>_0x3970b4?.['includes']('Faculty'))),_0x220a5e=_0x361df6?_0x361df6['findIndex'](_0x42d8cd=>_0x42d8cd?.['includes']('Faculty')):-1,_0x56105c=_0x220a5e!==-1&&_0x361df6?_0x361df6[_0x220a5e+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x4c4295=_0xf448a1['find'](_0x20b06d=>_0x20b06d['some'](_0x135353=>_0x135353?.['includes']('Semester'))),_0x5aabf5=_0x4c4295?_0x4c4295['findIndex'](_0x925b36=>_0x925b36?.['includes']('Semester')):-1,_0x1b7450=_0x5aabf5!==-1&&_0x4c4295?_0x4c4295[_0x5aabf5+0x2]?.['trim']()??'':'',_0x255c94=_0x1b7450['includes']('1st')?0x1:_0x1b7450['includes']('2nd')?0x2:0x0,_0x1b790c=_0xf448a1['find'](_0x5a297b=>_0x5a297b['some'](_0x55e0c2=>_0x55e0c2?.['includes']('Course\x20&\x20Sec'))),_0x52de47=_0x1b790c?_0x1b790c['findIndex'](_0x3a3037=>_0x3a3037?.['includes']('Course\x20&\x20Sec')):-1,_0x39c41d=_0x52de47!==-1&&_0x1b790c?_0x1b790c[_0x52de47+0x2]?.['trim']()??'':'';let _0x1a9df1='',_0x4eea12='';if(_0x39c41d){const _0x1c01eb=_0x39c41d['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x1c01eb&&(_0x1a9df1=_0x1c01eb[0x1]??'',_0x1c01eb[0x2]&&(_0x4eea12=_0x1c01eb[0x2]['replace'](/^OC/i,'')));}const _0x5a59c7=_0xf448a1['find'](_0x3a4548=>_0x3a4548['some'](_0x1f2887=>_0x1f2887?.['includes']('School\x20Year'))),_0x3100a8=_0x5a59c7?_0x5a59c7['findIndex'](_0x17dff2=>_0x17dff2?.['includes']('School\x20Year')):-1,_0x332e76=_0x3100a8!==-1&&_0x5a59c7?_0x5a59c7[_0x3100a8+0x2]?.['trim']()??'':'';let _0x12b8e1=0x0;if(_0x332e76){const _0x202833=_0x332e76['match'](/(\d{4})-(\d{4})/);if(_0x202833){const _0x31ddd2=(_0x202833[0x1]??'')['slice'](0x2),_0x4c65d6=(_0x202833[0x2]??'')['slice'](0x2);_0x12b8e1=parseInt(_0x31ddd2+_0x4c65d6,0xa);}}const _0x2fdafd={'faculty':_0x56105c,'course':_0x1a9df1,'section':_0x4eea12,'semester':_0x255c94,'sy':_0x12b8e1},_0x14f05c=_0xf448a1['findIndex'](_0x1c4af6=>_0x1c4af6['some'](_0x921c75=>_0x921c75?.['trim']()==='CO\x20#'));if(_0x14f05c===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x5c3d8c=_0xf448a1[_0x14f05c+0x1];if(!_0x5c3d8c)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x158d26={};let _0x4103d3=0x1,_0x119d47=0x1;for(let _0x54348d=0x3;_0x54348d<_0x5c3d8c['length'];_0x54348d++){const _0x44a77a=_0x5c3d8c[_0x54348d];if(!_0x44a77a)continue;const _0x5cd464='co'+_0x4103d3;if(!_0x158d26[_0x5cd464])_0x158d26[_0x5cd464]=[];_0x158d26[_0x5cd464]['push']('ilo'+_0x119d47),_0x119d47++,_0x119d47>0x3&&(_0x4103d3++,_0x119d47=0x1);}const _0x1279ee=_0xf448a1['findIndex'](_0x21894e=>_0x21894e['includes']('Name\x20of\x20Students'));if(_0x1279ee===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x3bb60b=_0xf448a1[_0x1279ee];if(!_0x3bb60b)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x2f8d42=_0x3bb60b['findIndex'](_0x8702ff=>_0x8702ff?.['includes']('Name\x20of\x20Students'));if(_0x2f8d42===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x2a110a=_0x2f8d42+0x2,_0x2cb287=[];for(let _0x1ea8e7=_0x1279ee+0x1;_0x1ea8e7<_0xf448a1['length'];_0x1ea8e7++){const _0x575d83=_0xf448a1[_0x1ea8e7];if(!_0x575d83)continue;if(_0x575d83['some'](_0x10a75e=>_0x10a75e?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x10a75e?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x10a75e?.['toUpperCase']()['includes']('INACTIVE')||_0x10a75e?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x575d83[_0x2f8d42])continue;const _0x5350be=_0x575d83[_0x2f8d42]['replace'](/"/g,'')['trim'](),_0x327aa3=_0x575d83['slice'](_0x2a110a)['map'](_0xb1faac=>_0xb1faac===null?null:!isNaN(Number(_0xb1faac))?parseFloat(_0xb1faac):0x0);let _0x547fb1=0x0;const _0x91aac9={};Object['entries'](_0x158d26)['forEach'](([_0x18a7f8,_0x301df6])=>{const _0x1879dd={};_0x301df6['forEach'](_0x32a00a=>{_0x1879dd[_0x32a00a]=_0x327aa3[_0x547fb1]??0x0,_0x547fb1++;}),_0x91aac9[_0x18a7f8]={'transmuted_score':_0x1879dd};}),_0x2cb287['push']({'student_name':_0x5350be,'coaep':_0x91aac9});}const _0x47bf32=_0xf448a1['find'](_0x3667fa=>_0x3667fa['some'](_0x3ec4d4=>_0x3ec4d4?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x269a30=_0xf448a1['find'](_0x44a957=>_0x44a957['some'](_0x459117=>_0x459117?.['includes']('AVERAGE'))),_0x2c3489=_0x47bf32?_0x47bf32['slice'](_0x2a110a)['map'](_0xda55ed=>_0xda55ed&&!isNaN(Number(_0xda55ed))?parseInt(_0xda55ed):0x0):[],_0x592b28=_0x269a30?_0x269a30['slice'](_0x2a110a)['map'](_0x40a790=>_0x40a790&&_0x40a790!=='#DIV/0!'&&!isNaN(Number(_0x40a790))?parseInt(_0x40a790):0x0):[],_0x3e5047={};let _0x24fced=0x0;return Object['entries'](_0x158d26)['forEach'](([_0x390bd6,_0x1af272])=>{if(!_0x3e5047[_0x390bd6])_0x3e5047[_0x390bd6]={};_0x1af272['forEach'](_0x10ca79=>{_0x3e5047[_0x390bd6][_0x10ca79]={'achievedMinimum':_0x2c3489[_0x24fced]??0x0,'average':_0x592b28[_0x24fced]??0x0},_0x24fced++;});}),{'assessmentData':{'classAssignment':_0x2fdafd,'student':_0x2cb287,'total':_0x3e5047}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x40b70d,_0x2838b3){try{const _0x250033=await convertToCSVFile(_0x2838b3),_0x413da9=await _0x250033['text'](),_0x4131a2=parseAssessmentCsv(_0x413da9),_0x14a0f2=await fetch(_0x40b70d+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x4131a2)});if(!_0x14a0f2['ok']){const _0x319d94=await _0x14a0f2['json']();throw _0x319d94;}return _0x14a0f2['json']();}catch(_0xbf3f26){throw _0xbf3f26;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x34a1bb,_0x30b3c5){try{const _0x2b68f1=await convertToCSVFile(_0x30b3c5),_0x2dd6d8=new FormData();_0x2dd6d8['append']('csvFile',_0x2b68f1);const _0x38fcb2=await fetch(_0x34a1bb+'/dept-faculties/upload',{'method':'POST','body':_0x2dd6d8});if(!_0x38fcb2['ok']){const _0x58f90e=await _0x38fcb2['json']();throw _0x58f90e;}return _0x38fcb2['json']();}catch(_0x254101){throw _0x254101;}}
|
|
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(_0x10ba89){let _0x40a8fd={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x78426=0x0;_0x78426<Math['min'](_0x10ba89['length'],0x14);_0x78426++){const _0x40ff5f=(_0x10ba89[_0x78426]??[])['map'](_0x8b0feb=>_0x8b0feb['toLowerCase']()['trim']()),_0x5bce7e=_0x40ff5f['findIndex'](_0x24d07d=>HEADERS['po']['some'](_0x129b45=>_0x24d07d['toLowerCase']()['includes'](_0x129b45))),_0x329d00=_0x40ff5f['findIndex'](_0x1b18f8=>HEADERS['tl']['some'](_0x3e0603=>_0x1b18f8['toLowerCase']()['includes'](_0x3e0603))),_0x27b15a=_0x40ff5f['findIndex'](_0x585655=>HEADERS['pi']['some'](_0x17764d=>_0x585655['toLowerCase']()['includes'](_0x17764d))),_0x3eea9e=_0x40ff5f['findIndex'](_0x50b15b=>HEADERS['fc']['some'](_0x2584c4=>_0x50b15b['toLowerCase']()['includes'](_0x2584c4))),_0x16e68c=_0x40ff5f['findIndex'](_0x2a6d61=>HEADERS['sc']['some'](_0x11891a=>_0x2a6d61['toLowerCase']()['includes'](_0x11891a))),_0x391b08=_0x40ff5f['findIndex'](_0x2c1db8=>HEADERS['at']['some'](_0x4079ca=>_0x2c1db8['toLowerCase']()['includes'](_0x4079ca))),_0x232302=_0x40ff5f['findIndex'](_0x2a8b15=>HEADERS['pt']['some'](_0x4b9bd6=>_0x2a8b15['toLowerCase']()['includes'](_0x4b9bd6))),_0x559ee7=[_0x5bce7e,_0x329d00,_0x27b15a,_0x3eea9e,_0x16e68c,_0x391b08,_0x232302]['filter'](_0x48b0a2=>_0x48b0a2!==-1)['length'];if(_0x559ee7>=0x3){_0x40a8fd={'headerIdx':_0x78426,'poIdx':_0x5bce7e,'tlIdx':_0x329d00,'piIdx':_0x27b15a,'fcIdx':_0x3eea9e,'scIdx':_0x16e68c,'atIdx':_0x391b08,'ptIdx':_0x232302};break;}}if(_0x40a8fd['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x40a8fd;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x22af80=>{let _0x9500b9=_0x22af80['split'](',')['reduce']((_0x571e6c,_0x420fb2)=>{const _0x64e81=_0x420fb2['trim']();if(_0x64e81)_0x571e6c['push'](_0x64e81);return _0x571e6c;},[]);return _0x9500b9;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x1818c0=>{try{const _0x5625e7=_0x409e19['parse'](_0x1818c0,{'skipEmptyLines':![]})['data'],{headerIdx:_0x593fa5,poIdx:_0xc3332,tlIdx:_0x7947e,piIdx:_0x3547ff,fcIdx:_0x1df33e,scIdx:_0x2fa42d,atIdx:_0xc6c28a,ptIdx:_0x239bb7}=getPoaepHeader(_0x5625e7),_0x27a9d=[];let _0x4ff01a={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x35a703='',_0x55ca25='',_0x825853='';for(let _0x8fbaaa=_0x593fa5+0x1;_0x8fbaaa<_0x5625e7['length'];_0x8fbaaa++){const _0x1b6a25=_0x5625e7[_0x8fbaaa];if(!_0x1b6a25)break;const _0x86a9e4=_0x1b6a25[_0xc3332]?.['trim']()||'';_0x86a9e4!==''&&(_0x4ff01a={'po_desc':_0x86a9e4,'seq_no':_0x4ff01a['seq_no']+0x1,'PerfIndicators':[]},_0x27a9d['push'](_0x4ff01a),_0x35a703='',_0x55ca25='',_0x825853='');if(_0x4ff01a['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x8fbaaa+'.');const _0x5c510f=_0x1b6a25[_0x3547ff]?.['trim']()||'';if(_0x5c510f==='')break;const _0x4d4c95=_0x1b6a25[_0x1df33e]?.['trim']()||'';if(_0x4d4c95==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x8fbaaa+'.');const _0x2f51a0=_0x1b6a25[_0x2fa42d]?.['trim']()||_0x35a703;if(_0x2f51a0==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x8fbaaa+'.');_0x35a703=_0x2f51a0;const _0x35305f=_0x1b6a25[_0xc6c28a]?.['trim']()||_0x55ca25;if(_0x35305f==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x8fbaaa+'.');_0x55ca25=_0x35305f;const _0x3a0075=_0x1b6a25[_0x239bb7]?.['trim']()||_0x825853;if(_0x3a0075==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x8fbaaa+'.');_0x825853=_0x3a0075;const _0x219ac2=parseFormativeCourses(_0x4d4c95);if(_0x219ac2['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x8fbaaa+'.');const _0x324b4c=performaceTarget(_0x3a0075);if(!_0x324b4c['performance_target']||!_0x324b4c['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x8fbaaa+'.');const _0x1d0c43={'pi_desc':_0x5c510f,'FormativeCourses':_0x219ac2['map'](_0x2a414b=>({'course_id':_0x2a414b,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x2f51a0},'TaxonomyLevel':null,'AssessmentTool':{'at_desc':_0x35305f},'PerformanceTargets':{'target_percent':_0x324b4c['performance_target'],'min_score':_0x324b4c['passing_score']}};_0x4ff01a['PerfIndicators']['push'](_0x1d0c43);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x27a9d}};}catch(_0x2144d3){return {'success':![],'error':_0x2144d3 instanceof Error?_0x2144d3['message']:_0x2144d3,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x502d7f,_0x43072a,_0x244739,_0x24cbe8,_0x37e540){try{const _0x198cf4=await convertToCSVFile(_0x43072a),_0x10bb60=await _0x198cf4['text'](),_0x1acff6=parsePOAEP(_0x10bb60),_0x770dd5=await fetch(_0x502d7f+'/program-outcomes/poaep/upload?curr_id='+_0x24cbe8+'&period_id='+_0x37e540,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x244739},'credentials':'include','body':JSON['stringify'](_0x1acff6)});if(!_0x770dd5['ok']){const _0xe6a30e=await _0x770dd5['json']();throw _0xe6a30e;}return _0x770dd5['json']();}catch(_0x26a42e){throw _0x26a42e;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(_0x1d2c5e='DataTable',_0x3ac7e5){this['name']=_0x1d2c5e,this['headers']=_0x3ac7e5,this['table']=[],this['validators']=[],this['state']={};}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getState'](){return this['state'];}['setState']=async _0x3f20f2=>{await this['assertInitialized'](),this['state']=_0x3f20f2;};['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'](_0x1f68c6){await this['assertInitialized'](),this['table']=_0x1f68c6;}async['initializeTable'](_0x28ef89,_0x248162){try{let _0x15b5ed;if(_0x28ef89 instanceof File)_0x15b5ed=await this['fromXML'](_0x28ef89,_0x248162);else _0x15b5ed=await this['fromCSVString'](_0x28ef89);if(!_0x15b5ed['success']||!_0x15b5ed['data'])return _0x15b5ed;if(_0x15b5ed['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x15b5ed['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x404fa6){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x404fa6};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x256e60,_0x4af992){const _0x148d25=await convertToCSVFile(_0x256e60,_0x4af992),_0x23eec6=await _0x148d25['text']();return this['fromCSVString'](_0x23eec6);}async['findValue'](_0x10391e){let [_0x269c0f,_0x2562f5]=[-1,-1];if(!_0x10391e)return {'row':_0x269c0f,'column':_0x2562f5};for(let _0x561156=0x0;_0x561156<this['table']['length'];_0x561156++){const _0x1929fd=this['table'][_0x561156];for(let _0x1d6d89=0x0;_0x1d6d89<_0x1929fd['length'];_0x1d6d89++){if(typeof _0x10391e==='string'){if(_0x1929fd[_0x1d6d89]===_0x10391e)return {'row':_0x561156,'column':_0x1d6d89};}else {if(_0x1929fd[_0x1d6d89]){if(_0x1929fd[_0x1d6d89]===_0x10391e)return {'row':_0x561156,'column':_0x1d6d89};}}}}return {'row':_0x269c0f,'column':_0x2562f5};}async['validate'](){const _0x446374=[],_0x3ccce4=[];try{await this['assertInitialized']()['then'](()=>{_0x446374['push']('Table\x20is\x20initialized.');})['catch'](_0x1afaf1=>_0x3ccce4['push'](_0x1afaf1));if(_0x3ccce4['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x446374,_0x3ccce4);const {success:_0x20bed9,message:_0x26924c,error:_0x54b8d9,data:_0x19f3f6}=await this['toJson']();if(!_0x19f3f6)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x446374['push'](..._0x19f3f6['validMsgs']),_0x3ccce4['push'](..._0x19f3f6['tableErrors']);const {jsonObj:_0x56aff8}=_0x19f3f6;for(const _0x1cc6a0 of this['validators']){await _0x1cc6a0['validate'](_0x446374,_0x3ccce4,this,_0x56aff8);}let _0x471036=this['name']+'\x20ran\x20its\x20validations.';if(_0x446374['length']>0x0)_0x471036+='\x20'+_0x446374['length']+'\x20validations\x20were\x20successful.';if(_0x3ccce4['length']>0x0)_0x471036+='\x20'+_0x3ccce4['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x471036,'data':{'validMsgs':_0x446374,'tableErrors':_0x3ccce4}};}catch(_0x362edc){return _0x3ccce4['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x362edc}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x446374,'tableErrors':_0x3ccce4}};}}['useValidator'](_0x2519b2){this['validators']['push'](_0x2519b2);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0xc7230e){this['name']=_0xc7230e;}['getName'](){return this['name'];}['report'](_0x547f3a,_0x189ecb,_0x1c2e1d){if(_0x547f3a['length']>0x0)_0x1c2e1d['push'](..._0x547f3a);else _0x189ecb['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'](_0x4505d1,_0x4f463a,_0x129a2d,_0x34f482){const _0x40521a=[];if(!_0x34f482){_0x4f463a['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x1adbbc=0x0;_0x1adbbc<_0x34f482['co']['length'];_0x1adbbc++){const _0x3f8a6e=_0x34f482['co'][_0x1adbbc];if(!_0x3f8a6e){const {row:_0x544e15,column:_0x554df2}=await _0x129a2d['findValue'](_0x1adbbc+0x1+'');_0x40521a['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x1adbbc+0x1)+'.','row':_0x544e15,'column':_0x554df2+0x1,'from':this['name']});continue;}if(!_0x3f8a6e?.['ilo']){const {row:_0x540911,column:_0x2013c9}=await _0x129a2d['findValue'](_0x3f8a6e['statement']);_0x40521a['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x1adbbc+0x1)+'.','row':_0x540911,'column':_0x2013c9,'from':this['name']});continue;}const _0x4af3d2=_0x3f8a6e['ilo']['length']-0x1,_0x4fa190=_0x3f8a6e['ilo'][_0x4af3d2];if(!_0x4fa190['taxonomy_level']){const {row:_0x59c25f,column:_0x2acbfe}=await _0x129a2d['findValue'](_0x4fa190['statement']);_0x40521a['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x1adbbc+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x59c25f,'column':_0x2acbfe,'from':this['name']});continue;}if(_0x4fa190['taxonomy_level']!==_0x3f8a6e['taxonomy_level']){const {row:_0x4a45b7,column:_0x4161b5}=await _0x129a2d['findValue'](_0x4fa190['statement']);_0x40521a['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x1adbbc+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x4fa190['taxonomy_level']+'\x20!==\x20'+_0x3f8a6e['taxonomy_level']+')','row':_0x4a45b7,'column':_0x4161b5,'from':this['name']});}}this['report'](_0x40521a,_0x4505d1,_0x4f463a);}}
|
|
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'](_0x576687,_0x300e0f,_0x3da7dd,_0x4e3583){const _0x2c5d09=[];if(!_0x4e3583){_0x300e0f['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x55034d=0x0;_0x55034d<_0x4e3583['co']['length'];_0x55034d++){const _0x23bd77=_0x4e3583['co'][_0x55034d];if(!_0x23bd77['taxonomy_level']){_0x2c5d09['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x55034d+0x1),'from':this['name']});continue;}if(!whitelist$1['includes'](_0x23bd77['taxonomy_level'])){const {row:_0x34dd75,column:_0x555ac3}=await _0x3da7dd['findValue'](_0x23bd77['statement']);let _0x58758f={'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x23bd77['taxonomy_level']['toUpperCase'](),'from':this['name']};(_0x34dd75!==-1||_0x555ac3!==-1)&&(_0x58758f['row']=_0x34dd75,_0x58758f['column']=_0x555ac3),_0x2c5d09['push'](_0x58758f);}}this['report'](_0x2c5d09,_0x576687,_0x300e0f);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'](_0x235344,_0x3fed4e,_0x22f24f,_0x1bb452){const _0x424bf6=[];if(!_0x1bb452){_0x3fed4e['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x13cf56=0x0;_0x13cf56<_0x1bb452['co']['length'];_0x13cf56++){const _0x4fa39e=_0x1bb452['co'][_0x13cf56];if(!_0x4fa39e){const {row:_0x31b663,column:_0x2efaab}=await _0x22f24f['findValue'](_0x13cf56+0x1+'');_0x424bf6['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x13cf56+0x1)+'.','row':_0x31b663,'column':_0x2efaab+0x1,'from':this['name']});continue;}if(!_0x4fa39e?.['ilo']){const {row:_0x115d9d,column:_0x2afc66}=await _0x22f24f['findValue'](_0x4fa39e['statement']);_0x424bf6['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x13cf56+0x1)+'.','row':_0x115d9d,'column':_0x2afc66,'from':this['name']});continue;}const _0x2f75c5=await _0x22f24f['findValue'](_0x4fa39e['ilo'][0x0]['statement']),_0x3cdf27=_0x4fa39e['ilo']['map'](_0x2ce08e=>taxoOrder[_0x2ce08e['taxonomy_level']]);let _0x357b55=_0x3cdf27[0x0];for(let _0x31df0a=0x1;_0x31df0a<_0x3cdf27['length'];_0x31df0a++){if(_0x3cdf27[_0x31df0a]<_0x357b55){_0x424bf6['push']({'error':'Under\x20CO\x20'+(_0x13cf56+0x1)+',\x20ILO\x20'+(_0x31df0a+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x31df0a+'\x27s.','row':_0x2f75c5['row'],'column':_0x2f75c5['column']+_0x31df0a,'from':this['name']});continue;}_0x357b55=_0x3cdf27[_0x31df0a];}}this['report'](_0x424bf6,_0x235344,_0x3fed4e);}}
|
|
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'](_0x18f890,_0x2e35c5,_0x221f42,_0x35773a){const {success:_0x421e68,data:_0x27eb64}=_0x221f42['getTable'](),_0x296372=[];if(!_0x421e68){_0x296372['push']({'error':'Unable\x20to\x20access\x20COAEP\x20table.','from':this['name']});return;}const {table:_0x7674b1}=_0x27eb64;for(let _0x2f8c82=0x0;_0x2f8c82<_0x7674b1['length'];_0x2f8c82++){const _0x2d38b9=_0x7674b1[_0x2f8c82],[_0x585b7c,_0xbe8b85]=_0x2d38b9[0x4];if(!_0x585b7c)_0x296372['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x2f8c82,'column':0x4,'from':this['name']});else _0x585b7c<minPerfTarget$1&&_0x296372['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget$1+'.','row':_0x2f8c82,'column':0x4,'from':this['name']});if(!_0xbe8b85)_0x296372['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x2f8c82,'column':0x6,'from':this['name']});else _0xbe8b85<minPassScore$1&&_0x296372['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore$1+'.','row':_0x2f8c82,'column':0x6,'from':this['name']});}this['report'](_0x296372,_0x18f890,_0x2e35c5);}}
|
|
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'](_0x21b5d2,_0x5b69a9){await this['assertInitialized']()['catch'](_0x522f42=>{_0x5b69a9['push'](_0x522f42);return;});const _0x4f7f76=[];let _0x3a735f=null,_0x457bfe=null;for(let _0xd7f825=0x0;_0xd7f825<this['table']['length'];_0xd7f825++){const _0x4a26e1=[],_0x2ea721=this['table'][_0xd7f825],_0x581e56=_0x2ea721[0x0]||_0x3a735f,_0x42d604=_0x2ea721[0x1]||_0x457bfe,_0x35a77c=_0x2ea721[0x2],_0xe7d118=_0x2ea721[0x3],_0x4c3ad5=_0x2ea721[0x4];if(!_0x581e56)_0x4a26e1['push'](0x0);if(!_0x42d604)_0x4a26e1['push'](0x1);if(!_0x35a77c)_0x4a26e1['push'](0x2);if(!_0xe7d118)_0x4a26e1['push'](0x3);if(!_0x4c3ad5)_0x4a26e1['push'](0x4);if(_0x457bfe!==_0x42d604)this['validateObjectiveGrammar'](_0x42d604,_0xd7f825,0x1,_0x5b69a9);_0x3a735f=_0x581e56,_0x457bfe=_0x42d604;for(const _0x31823b of _0x4a26e1){_0x4f7f76['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x31823b],'row':_0xd7f825,'column':_0x31823b});}if(_0x35a77c)this['validateObjectiveGrammar'](_0x35a77c,_0xd7f825,0x2,_0x5b69a9);}if(_0x4f7f76['length']>0x0)_0x5b69a9['push'](..._0x4f7f76);else _0x21b5d2['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x4585bd){try{const _0x485596=[],_0x3690e0=_0x409e19['parse'](_0x4585bd,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0xf900de,coIdx:_0x3e4f6f,iloIdx:_0x3e073d,assessToolIdx:_0x875c4a,perfTargetIdx:_0x2eed72}=getCoaepHeader(_0x3690e0);if(_0xf900de===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x3690e0['forEach'](_0xa0bd54=>{const _0x4df102=_0xa0bd54['indexOf']('Name\x20of\x20Faculty:'),_0x5cfd30=_0xa0bd54['indexOf']('School\x20Year'),_0xbf6d22=_0xa0bd54['indexOf']('Course:'),_0x4800e3=_0xa0bd54['indexOf']('Semester');_0x4df102!==-0x1&&(this['state']['faculty']=_0xa0bd54[_0x4df102+0x1]?.['trim']()||this['state']['faculty']);_0x5cfd30!==-0x1&&(this['state']['sy']=_0xa0bd54[_0x5cfd30+0x1]?.['trim']()||this['state']['sy']);_0xbf6d22!==-0x1&&(this['state']['course']=_0xa0bd54[_0xbf6d22+0x1]?.['trim']()||this['state']['course']);if(_0x4800e3!==-0x1){const _0xd85c3c=_0xa0bd54[_0x4800e3+0x1]?.['trim']()||'',_0x2eef4f=_0xd85c3c['match'](/\d+/)?.[0x0];this['state']['semester']=_0x2eef4f?parseInt(_0x2eef4f,0xa):this['state']['semester'];}});for(let _0x112452=0x0;_0x112452<=_0x3690e0['length'];_0x112452++){const _0x7fb14f=_0x3690e0[_0x112452];if(!_0x7fb14f)break;if(_0x112452<=_0xf900de)continue;if(!_0x7fb14f[_0x3e073d])break;let _0x4915d7=_0x7fb14f[_0x3e4f6f-0x1]?.['trim']()||'',_0xdabdfe=_0x7fb14f[_0x3e4f6f]?.['trim']()||'',_0x465fda=_0x7fb14f[_0x3e073d]?.['trim']()||'';/^\d+$/['test'](_0x7fb14f[_0x3e4f6f]?.['trim']()||'')&&(_0x4915d7=_0x7fb14f[_0x3e4f6f]?.['trim']()||'',_0xdabdfe=_0x7fb14f[_0x3e4f6f+0x1]?.['trim']()||'');let _0x5c341b=null;if(_0xdabdfe){const {cognitive_level:_0x1a28ef,taxonomy_level:_0x1992a2,verb:_0x145e6c,rest:_0x5826db}=extractFromObjective(_0xdabdfe);_0x5c341b=[_0x1a28ef,_0x1992a2,_0x145e6c,_0x5826db];}let _0x16fba5;{const {cognitive_level:_0x47ef58,taxonomy_level:_0xf8dc0c,verb:_0x8846b7,rest:_0x2fa0a0}=extractFromObjective(_0x465fda);_0x16fba5=[_0x47ef58,_0xf8dc0c,_0x8846b7,_0x2fa0a0];}const _0x49fa9d=_0x7fb14f[_0x2eed72]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x5389c0,passing_score:_0x37dbf8}=performaceTarget(_0x49fa9d);_0x485596['push']([_0x4915d7,_0x5c341b,_0x16fba5,_0x7fb14f[_0x875c4a]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x5389c0,_0x37dbf8]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x485596};}catch(_0x1c822d){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x1c822d};}}async['toJson'](){const _0x312730=[],_0x334db4=[],_0x411c91='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x210ca8={'faculty':this['state']['faculty'],'course':this['state']['course'],'sy':this['state']['sy'],'semester':this['state']['semester'],'co':[]};let _0x30786c=null,_0x2ecbde='',_0x216595=[null,null];this['table']['forEach']((_0x1f670f,_0x1cb860)=>{if(_0x1cb860===0x0&&!_0x1f670f[0x1])_0x334db4['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x411c91});_0x1f670f[0x1]&&(_0x2ecbde='',_0x216595=[null,null]);const _0x1f8240=_0x1f670f[0x1],_0x13b14a=_0x1f670f[0x2],_0x32fa95=_0x1f670f[0x3]||_0x2ecbde,_0x16c502=_0x1f670f[0x4]||_0x216595;if(!_0x13b14a)_0x334db4['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x411c91});if(!_0x32fa95)_0x334db4['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x1cb860,'column':0x3,'from':_0x411c91});if(!_0x16c502)_0x334db4['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x1cb860,'column':0x4,'from':_0x411c91});if(_0x1f8240){const [_0x4279d3,_0x2ffbad,_0x45c574,_0x5b6336]=_0x1f8240,_0x2f0d52={'statement':_0x5b6336,'ilo':[],'taxonomy_level':_0x2ffbad,'cognitive_level':_0x4279d3,'verb':_0x45c574};_0x30786c=_0x2f0d52,_0x210ca8['co']['push'](_0x2f0d52);}const [_0x53bc2c,_0x5d1a6e,_0x57ba88,_0x25f36d]=_0x13b14a,[_0x11fa71,_0x395414]=_0x16c502,_0x546635={'statement':_0x25f36d,'assessment_tool':_0x32fa95,'performance_target':_0x11fa71,'passing_score':_0x395414,'cognitive_level':_0x53bc2c,'taxonomy_level':_0x5d1a6e,'verb':_0x57ba88};_0x30786c['ilo']['push'](_0x546635);});if(_0x334db4['length'])return _0x334db4['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x411c91}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x210ca8,'validMsgs':_0x312730,'tableErrors':_0x334db4}};return _0x312730['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x210ca8,'validMsgs':_0x312730,'tableErrors':_0x334db4}};}catch(_0x4f9a7e){return _0x334db4['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x411c91}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x4f9a7e,'data':{'jsonObj':null,'tableErrors':_0x334db4}};}}['validateObjectiveGrammar'](_0x557379,_0x38f578,_0x22b5bc,_0x3705bd){if(!_0x557379){_0x3705bd['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x38f578,'column':_0x22b5bc,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x3f83ab,_0x192f14,_0x1f767a,_0x59ec6d]=_0x557379,_0x387071=[];if(!_0x3f83ab)_0x387071['push']('Cognitive\x20Level');if(!_0x192f14)_0x387071['push']('Taxonomy\x20Level');if(!_0x1f767a)_0x387071['push']('Verb');if(!_0x387071['length'])return;_0x3705bd['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x387071['join'](',\x20')+'.','row':_0x38f578,'column':_0x22b5bc,'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'](_0x5207ce,_0x991dfd,_0xe1ca04,_0x2874e1){const _0x45ddfd=[],{success:_0x167ae8,data:_0x5618af}=_0xe1ca04['getTable']();if(!_0x167ae8){_0x991dfd['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x51cd10}=_0x5618af;for(let _0x15b851=0x0;_0x15b851<_0x51cd10['length'];_0x15b851++){const _0x46493e=_0x51cd10[_0x15b851],_0x27d008=_0x46493e[0x1]?.['toLowerCase']();if(!_0x27d008)continue;!whitelist['includes'](_0x27d008)&&_0x45ddfd['push']({'error':'Cannot\x20have\x20PO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x27d008['toUpperCase'](),'row':_0x15b851,'column':0x1,'from':this['name']});}this['report'](_0x45ddfd,_0x5207ce,_0x991dfd);return;}}
|
|
61
61
|
|
|
62
|
-
const
|
|
62
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPIPerfTarget extends DTValidator{constructor(){super('MIN_PI_PERF_TARGET');}async['validate'](_0x5c09c2,_0x1578de,_0x52d1fe,_0x29f635){const _0x3398f3=[],{success:_0x2b1534,data:_0x830ddb}=_0x52d1fe['getTable']();if(!_0x2b1534){_0x1578de['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x2a3f1f}=_0x830ddb;for(let _0x3198b9=0x0;_0x3198b9<_0x2a3f1f['length'];_0x3198b9++){const _0x485592=_0x2a3f1f[_0x3198b9],[_0x123b31,_0x275897]=_0x485592[0x6];if(!_0x123b31)_0x3398f3['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x3198b9,'column':0x6,'from':this['name']});else _0x123b31<minPerfTarget&&_0x3398f3['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x3198b9,'column':0x6,'from':this['name']});if(!_0x275897)_0x3398f3['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x3198b9,'column':0x6,'from':this['name']});else _0x275897<minPassScore&&_0x3398f3['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x3198b9,'column':0x6,'from':this['name']});}this['report'](_0x3398f3,_0x5c09c2,_0x1578de);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'](_0x5e6e20){try{const _0xaae014=[],_0x44158b=_0x409e19['parse'](_0x5e6e20,{'skipEmptyLines':![]})['data'];_0x44158b['forEach'](_0x47bf27=>{_0x47bf27['forEach'](_0x8c5d14=>{_0x8c5d14['includes']('PROGRAM:')&&(this['state']['program']=_0x8c5d14['replace']('PROGRAM:','')['trim']()['toUpperCase']());});});const {headerIdx:_0x2d1428,poIdx:_0x2fb946,tlIdx:_0x3f3c03,piIdx:_0x4cb07e,fcIdx:_0x5415f9,scIdx:_0x21b8f0,atIdx:_0x3a5673,ptIdx:_0x3fd25c}=getPoaepHeader(_0x44158b);if(_0x2d1428===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20check\x20the\x20CSV.');let _0x5be00e='',_0x16e921='',_0x453155='';for(let _0xf1ca9=_0x2d1428+0x1;_0xf1ca9<_0x44158b['length'];_0xf1ca9++){const _0x2371d4=_0x44158b[_0xf1ca9];if(!_0x2371d4)break;if(_0xf1ca9<=_0x2d1428)continue;let _0xc03114=_0x2371d4[_0x2fb946]?.['trim']()||'';if(_0xc03114){_0x5be00e='',_0x16e921='',_0x453155='';const [_0x5e5b68,_0x1ee4b5]=this['extractPoDesc'](_0xc03114);if(_0x1ee4b5)_0xc03114=_0x1ee4b5;}const _0x12d401=_0x2371d4[_0x3f3c03]?.['trim']()['toLowerCase']()||null,_0x474e73=_0x2371d4[_0x4cb07e]?.['trim']()||'',_0xc60c05=_0x2371d4[_0x5415f9]?.['trim']()||'',_0x19c45c=_0x2371d4[_0x21b8f0]?.['trim']()||_0x5be00e,_0x56506c=_0x2371d4[_0x3a5673]?.['trim']()||_0x16e921,_0x4e9d0d=_0x2371d4[_0x3fd25c]?.['trim']()||_0x453155,{performance_target:_0x4580f2,passing_score:_0x378b5b}=performaceTarget(_0x4e9d0d);if(!_0xc60c05)break;const _0x190a92=_0xc60c05['split'](',')['map'](_0x396095=>_0x396095['trim']());_0xaae014['push']([_0xc03114,_0x12d401,_0x474e73,_0x190a92,_0x19c45c,_0x56506c,[_0x4580f2,_0x378b5b]]),_0x5be00e=_0x19c45c,_0x16e921=_0x56506c,_0x453155=_0x4e9d0d;}if(_0xaae014['length']===0x0)throw new Error('No\x20data\x20parsed.\x20Please\x20check\x20the\x20CSV.');return {'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':_0xaae014};}catch(_0x56780c){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x56780c};}}async['toJson'](){const _0x3e38ef=[],_0x5c2324=[],_0x4dc6aa='POAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x1bf40d={'po':[]};let _0x4a8816={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x5f5330=null,_0x14840c=null,_0x416e1c=null;for(let _0x117328=0x0;_0x117328<this['table']['length'];_0x117328++){const _0x5ac18e=this['table'][_0x117328],_0x352c9f=[],_0x235179=_0x5ac18e[0x0]?.['trim']()||null;_0x235179&&_0x235179!==_0x4a8816['po_desc']&&(_0x4a8816={'po_desc':_0x235179,'seq_no':_0x4a8816['seq_no']+0x1,'PerfIndicators':[]},_0x1bf40d['po']['push'](_0x4a8816),_0x5f5330=null,_0x14840c=null,_0x416e1c=null);if(_0x4a8816['po_desc']==='')_0x5c2324['push']({'error':'Cannot\x20start\x20with\x20empty\x20Program\x20Outcome.','row':_0x117328,'column':0x0,'from':_0x4dc6aa});const _0x4c7f11=_0x5ac18e[0x1]||null,_0x506e49=_0x5ac18e[0x2]||null,_0xa19ba8=_0x5ac18e[0x3]||null,_0x336f3a=_0x5ac18e[0x4]||_0x5f5330,_0x17e35c=_0x5ac18e[0x5]||_0x14840c,_0x136810=_0x5ac18e[0x6]||_0x416e1c;(!_0xa19ba8||_0xa19ba8['length']===0x0)&&_0x5c2324['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x117328,'column':0x3,'from':_0x4dc6aa});!_0x136810&&_0x5c2324['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x117328,'column':0x6,'from':_0x4dc6aa});if(_0x352c9f['length']>0x0){_0x5c2324['push'](..._0x352c9f);continue;}const _0x2678e5={'pi_desc':_0x506e49,'FormativeCourses':_0xa19ba8['map'](_0x1116e4=>({'course_id':_0x1116e4,'cognitive_level':null})),'SummativeCourse':{'course_id':_0x336f3a},'TaxonomyLevel':_0x4c7f11?{'label':_0x4c7f11}:null,'AssessmentTool':{'at_desc':_0x17e35c},'PerformanceTargets':{'target_percent':_0x136810[0x0],'min_score':_0x136810[0x1]}};_0x4a8816['PerfIndicators']['push'](_0x2678e5);}if(_0x5c2324['length']>0x0)return _0x5c2324['push']({'error':'Converted\x20POAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x4dc6aa}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x1bf40d,'validMsgs':_0x3e38ef,'tableErrors':_0x5c2324}};return _0x3e38ef['push']('Successfully\x20converted\x20POAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':{'jsonObj':_0x1bf40d,'validMsgs':_0x3e38ef,'tableErrors':_0x5c2324}};}catch(_0x5d10b3){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x5d10b3};}}async['validateFields'](_0x2f9306,_0x547f5e){await this['assertInitialized']()['catch'](_0x2a6ccd=>{_0x547f5e['push'](_0x2a6ccd);return;});const _0x262c53=[];let _0xf44d83=null,_0x2d7ede=null,_0x3560ca=null,_0x16438=null;for(let _0x28de94=0x0;_0x28de94<this['table']['length'];_0x28de94++){const _0x54cc9f=[],_0x2e30ca=this['table'][_0x28de94];_0x2e30ca[0x0]&&_0x2e30ca[0x0]!==_0xf44d83&&(_0x2d7ede=null,_0x3560ca=null,_0x16438=null);const _0x56bf1b=_0x2e30ca[0x0]||_0xf44d83,_0x5b5b43=_0x2e30ca[0x1]||null,_0xbebab2=_0x2e30ca[0x2]||null,_0x16b50f=_0x2e30ca[0x3]||null,_0x326e8d=_0x2e30ca[0x4]||_0x2d7ede,_0x18be6b=_0x2e30ca[0x5]||_0x3560ca,_0x57b29f=_0x2e30ca[0x6]||_0x16438;if(!_0x56bf1b)_0x54cc9f['push'](0x0);if(!_0x5b5b43)_0x54cc9f['push'](0x1);if(!_0xbebab2)_0x54cc9f['push'](0x2);if(!_0x16b50f)_0x54cc9f['push'](0x3);if(!_0x326e8d)_0x54cc9f['push'](0x4);if(!_0x18be6b)_0x54cc9f['push'](0x5);if(!_0x57b29f)_0x54cc9f['push'](0x6);_0x54cc9f['length']>0x0&&_0x54cc9f['forEach'](_0x52a7d1=>{_0x262c53['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x52a7d1]+'.','row':_0x28de94,'column':_0x52a7d1,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'});}),_0x16b50f?.['length']===0x0&&_0x262c53['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x28de94,'column':0x3,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'}),_0xf44d83=_0x56bf1b,_0x2d7ede=_0x326e8d,_0x3560ca=_0x18be6b,_0x16438=_0x57b29f;}if(_0x262c53['length']>0x0)_0x547f5e['push'](..._0x262c53);else _0x2f9306['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}['extractPoDesc'](_0x5bf4da){const _0x803a5c=/^(PO\d+): (.*)$/,_0x57369b=_0x803a5c['exec'](_0x5bf4da);return _0x57369b?_0x57369b['slice'](0x1):['',_0x5bf4da];}}
|
|
65
|
+
|
|
66
|
+
class Client{['BASE_URL'];constructor(_0x258b5e){this['BASE_URL']=_0x258b5e;}['Parser'](){return {'curriculum':async _0x19cb2b=>{const _0x4925c0=await uploadCurriculum(this['BASE_URL'],_0x19cb2b);return _0x4925c0;},'courseOffering':async _0x79421d=>{const _0x265c75=await uploadCourseOffering(this['BASE_URL'],_0x79421d);return _0x265c75;},'coaep':async(_0x17520b,_0x44c539)=>{const _0x33fd2b=await uploadCOAEP(this['BASE_URL'],_0x17520b,_0x44c539);return _0x33fd2b;},'enrolledStudent':async _0x530e62=>{const _0x3e08a9=await uploadEnrolledStudent(this['BASE_URL'],_0x530e62);return _0x3e08a9;},'classlist':async(_0x37eee1,_0x40d738,_0x229da5)=>{const _0x3b439a=await uploadClassList(this['BASE_URL'],_0x37eee1,_0x40d738,_0x229da5);return _0x3b439a;},'assessmentData':async _0x23a58a=>{const _0x2163da=await uploadAssessmentData(this['BASE_URL'],_0x23a58a);return _0x2163da;},'deptFaculty':async _0x478701=>{const _0x2707ee=await uploadDeptFaculty(this['BASE_URL'],_0x478701);return _0x2707ee;},'poaep':async(_0x468647,_0x4de3e1,_0x554115,_0x54d7e6)=>{const _0x3e4b71=await uploadPOAEP(this['BASE_URL'],_0x468647,_0x4de3e1,_0x554115,_0x54d7e6);return _0x3e4b71;},'CoaepDT':CoaepDT,'PoaepDT':PoaepDT};}}
|
|
65
67
|
|
|
66
68
|
export { Client as default };
|