@obe-loms/coms-parser 1.6.24 → 1.6.25
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 +2 -1
- package/bundle.js +33 -33
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ParserResult } from "../types/ParserResult";
|
|
2
2
|
import DataTableException from "../types/DataTableException";
|
|
3
3
|
import { DTValidator } from "./DTValidator";
|
|
4
|
-
export type DataTableInfo<RowType = any[]> = {
|
|
4
|
+
export type DataTableInfo<RowType = any[], DT = any, Obj = any> = {
|
|
5
5
|
name: string;
|
|
6
6
|
headers: string[];
|
|
7
7
|
table: RowType[];
|
|
8
8
|
state: Record<string, any>;
|
|
9
|
+
validators: DTValidator<DT, Obj>[];
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* An abstract class that wraps a tabular data structure
|
package/bundle.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0xa6f4ed from 'papaparse';
|
|
2
|
+
import * as _0x5b1a48 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x112e89){let _0x290c3f='',_0x1d2e71='',_0x12679f=0x0,_0x121f03=null;const _0x24077f=[];return _0xa6f4ed['parse'](_0x112e89,{'skipEmptyLines':!![],'complete':_0x4547ce=>{_0x4547ce['data']['forEach'](_0x29df91=>{const _0x46e1e3=_0x29df91['map'](_0x574492=>(_0x574492??'')['toString']()['trim']()),_0x286f4b=_0x46e1e3[0x0]??'';if(_0x286f4b['includes']('Rev#')){const _0x2fa9ec=_0x286f4b['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x2fa9ec&&(_0x290c3f=_0x2fa9ec[0x1]?.['trim']()??'',_0x1d2e71=_0x2fa9ec[0x2]?.['trim']()??'',_0x12679f=parseInt(_0x2fa9ec[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x286f4b)){_0x121f03=0x1;return;}if(/SECOND YEAR/i['test'](_0x286f4b)){_0x121f03=0x2;return;}if(/THIRD YEAR/i['test'](_0x286f4b)){_0x121f03=0x3;return;}if(/FOURTH YEAR/i['test'](_0x286f4b)){_0x121f03=0x4;return;}if(/FIFTH YEAR/i['test'](_0x286f4b)){_0x121f03=0x5;return;}if(/First Semester/i['test'](_0x286f4b)||/Second Semester/i['test'](_0x286f4b)||/Summer/i['test'](_0x286f4b))return;const _0x7067e5=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x7067e5['forEach'](({sem:_0x2c8989,offset:_0x508499})=>{const _0x22349e=_0x46e1e3[_0x508499]??'',_0x4a2934=_0x46e1e3[_0x508499+0x1]??'',_0x59c61e=_0x46e1e3[_0x508499+0x2]??'',_0x2e7be9=_0x46e1e3[_0x508499+0x3]??'',_0x5ba5ac=_0x46e1e3[_0x508499+0x4]??'';_0x22349e&&_0x121f03&&_0x24077f['push']({'curr_id':_0x290c3f,'program_name':_0x1d2e71,'revision_no':_0x12679f,'year_level':_0x121f03,'sem':_0x2c8989,'course_id':_0x22349e,'course_desc':_0x4a2934,'total_units':_0x59c61e,'lec_unit':_0x2e7be9,'lab_unit':_0x5ba5ac});});});}}),_0x24077f;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0xb5e98e,_0x87e0a){return new Promise((_0x394c17,_0x426ed2)=>{const _0x5a431a=new FileReader();_0x5a431a['onload']=_0x5c3f7b=>{const _0x1d6b6b=_0x5c3f7b['target']?.['result'];if(!_0x1d6b6b){_0x426ed2(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x12eff3=_0x5b1a48['read'](_0x1d6b6b,{'type':'array'});!_0x87e0a&&(_0x87e0a=_0x12eff3['SheetNames'][0x0]);if(!_0x87e0a){_0x426ed2(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x3e0070=_0x12eff3['Sheets'][_0x87e0a];if(!_0x3e0070){_0x426ed2(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x52d15c=_0x5b1a48['utils']['sheet_to_csv'](_0x3e0070,{'strip':!![]}),_0x11650f=_0xb5e98e['name']['replace'](/\.[^/.]+$/,'.csv'),_0x19c9e2=new File([_0x52d15c],_0x11650f,{'type':'text/csv','lastModified':Date['now']()});_0x394c17(_0x19c9e2);}catch(_0x54ae20){_0x426ed2(_0x54ae20);}},_0x5a431a['onerror']=()=>{_0x426ed2(new Error('File\x20reading\x20failed'));},_0x5a431a['readAsArrayBuffer'](_0xb5e98e);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x3fab65,_0x366c30){try{const _0x1fe54d=await convertToCSVFile(_0x366c30),_0x1790c6=await _0x1fe54d['text'](),_0x2b3cc8=parseCurriculum(_0x1790c6),_0x239fcb=_0xa6f4ed['unparse'](_0x2b3cc8),_0x433d24=new File([_0x239fcb],_0x1fe54d['name'],{'type':'text/csv'}),_0x3ff430=new FormData();_0x3ff430['append']('csvFile',_0x433d24);const _0x3af978=await fetch(_0x3fab65+'/curr-courses/upload',{'method':'POST','body':_0x3ff430});if(!_0x3af978['ok']){const _0x4c35b8=await _0x3af978['json']();throw _0x4c35b8;}return _0x3af978['json']();}catch(_0x504b06){throw _0x504b06;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x57fa12){let _0x47ea96='',_0x3fd470='';const _0x3ae5f0=[],_0x1366bb=_0xa6f4ed['parse'](_0x57fa12,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x39d703=_0x1366bb['data'];for(let _0x20083a=0x0;_0x20083a<Math['min'](0x5,_0x39d703['length']);_0x20083a++){const _0x505543=_0x39d703[_0x20083a];if(_0x505543&&_0x505543['length']>0x0){const _0x4dbed5=_0x505543[0x0]?.['toString']()||'',_0x124bd6=_0x4dbed5['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x124bd6){_0x47ea96=_0x124bd6[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x124bd6[0x2]){const _0x4bd2d5=_0x124bd6[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x4bd2d5&&_0x4bd2d5[0x2]&&_0x4bd2d5[0x4]&&(_0x3fd470=_0x4bd2d5[0x2]+_0x4bd2d5[0x4]);}}}}let _0x335fb8=-1;for(let _0x1743fe=0x0;_0x1743fe<_0x39d703['length'];_0x1743fe++){const _0xb49962=_0x39d703[_0x1743fe];if(_0xb49962&&_0xb49962['some'](_0x4ef076=>_0x4ef076?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x335fb8=_0x1743fe;break;}}if(_0x335fb8===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x216349={'code':'','description':'','unit':0x0};for(let _0x1a1c55=_0x335fb8+0x1;_0x1a1c55<_0x39d703['length'];_0x1a1c55++){const _0x3ab2a2=_0x39d703[_0x1a1c55];if(!_0x3ab2a2||_0x3ab2a2['length']<0x8)continue;const _0x5edfc6=_0x3ab2a2[0x1]?.['toString']()['trim']()||'',_0x1a9521=_0x3ab2a2[0x4]?.['toString']()['trim']()||'',_0x1e7dd5=_0x3ab2a2[0x5]?.['toString']()['trim']()||'',_0x414596=_0x3ab2a2[0x6]?.['toString']()['trim']()||'',_0x5016fb=_0x3ab2a2[0x7]?.['toString']()['trim']()||'',_0x49619f=_0x3ab2a2[0x3]?.['toString']()['trim']()||'';let _0x5861eb=_0x3ab2a2[0x0]?.['toString']()['trim']()||'',_0xb35ac4=_0x3ab2a2[0x2]?.['toString']()['trim']()||'';if(!_0x5edfc6)continue;if(!_0x5861eb)_0x5861eb=_0x216349['code'];if(!_0xb35ac4)_0xb35ac4=_0x216349['description'];let _0x286200=_0x216349['unit'];if(_0x49619f){const _0x2917c5=_0x49619f['match'](/(\d+)/);_0x2917c5&&_0x2917c5[0x1]&&(_0x286200=parseInt(_0x2917c5[0x1],0xa));}const _0x185b01={'sem':_0x47ea96,'school_year':_0x3fd470,'code':_0x5861eb,'course_no':_0x5edfc6,'course_desc':_0xb35ac4,'unit':_0x286200,'time':_0x1a9521,'days':_0x1e7dd5,'faculty':_0x414596,'room':_0x5016fb};_0x216349['code']=_0x5861eb,_0x216349['description']=_0xb35ac4,_0x216349['unit']=_0x286200,_0x3ae5f0['push'](_0x185b01);}return _0x3ae5f0;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x34f1a5,_0x5dae86){try{const _0x40fe22=await convertToCSVFile(_0x5dae86),_0x243205=await _0x40fe22['text'](),_0x2106ac=parseCourseOffering(_0x243205),_0xa88191=_0xa6f4ed['unparse'](_0x2106ac),_0x49eaee=new File([_0xa88191],_0x40fe22['name'],{'type':'text/csv'}),_0x53c9e8=new FormData();_0x53c9e8['append']('csvFile',_0x49eaee);const _0x3962a4=await fetch(_0x34f1a5+'/course-offerings/upload',{'method':'POST','body':_0x53c9e8});if(!_0x3962a4['ok']){const _0x57979f=await _0x3962a4['json']();throw _0x57979f;}return _0x3962a4['json']();}catch(_0x222baa){throw _0x222baa;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x498c3a){if(!_0x498c3a)return {'performance_target':null,'passing_score':null};const _0x477f93=_0x498c3a['match'](/\d+/g);return {'performance_target':_0x477f93?.[0x0]?parseInt(_0x477f93[0x0],0xa):null,'passing_score':_0x477f93?.[0x1]?parseInt(_0x477f93[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(_0x17adab){let _0x1cb0a1={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x306d74=0x0;_0x306d74<Math['min'](_0x17adab['length'],0x14);_0x306d74++){const _0x305f80=(_0x17adab[_0x306d74]??[])['map'](_0x427947=>_0x427947['toLowerCase']()['trim']()),_0x270c9a=_0x305f80['findIndex'](_0x5783d7=>HEADERS$1['co']['some'](_0x43bbdf=>_0x5783d7['includes'](_0x43bbdf))),_0x14b088=_0x305f80['findIndex'](_0x3edca1=>HEADERS$1['ilo']['some'](_0x315578=>_0x3edca1['includes'](_0x315578))),_0xaf876d=_0x305f80['findIndex'](_0x1f0011=>HEADERS$1['assessTool']['some'](_0x5c8676=>_0x1f0011['includes'](_0x5c8676))),_0xd3a0ce=_0x305f80['findIndex'](_0xd14b44=>HEADERS$1['perfTarget']['some'](_0x1601d2=>_0xd14b44['includes'](_0x1601d2))),_0x4becf2=[_0x270c9a,_0x14b088,_0xaf876d,_0xd3a0ce]['filter'](_0x1bf0a6=>_0x1bf0a6!==-1)['length'];if(_0x4becf2>=0x3){_0x1cb0a1={'headerRowIndex':_0x306d74,'coIdx':_0x270c9a,'iloIdx':_0x14b088,'assessToolIdx':_0xaf876d,'perfTargetIdx':_0xd3a0ce};break;}}return _0x1cb0a1;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x508664){const _0x3d9c5a={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x508664['trim']()},_0x375a41=_0x508664['match'](/^\((I|E|D)\)/);_0x375a41&&(_0x3d9c5a['cognitive_level']=_0x375a41[0x1],_0x3d9c5a['rest']=_0x508664['slice'](_0x375a41[0x0]['length'])['trim']());const _0x5b8c68=_0x3d9c5a['rest']?.['match'](/^(.*?)\:/);_0x5b8c68&&(_0x3d9c5a['taxonomy_level']=_0x5b8c68[0x1]['trim']()['toLowerCase']()||null,_0x3d9c5a['rest']=_0x3d9c5a['rest']?.['slice'](_0x5b8c68[0x0]['length'])['trim']()||null);const _0x55ca43=_0x3d9c5a['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x55ca43)_0x3d9c5a['verb']=_0x55ca43[0x1]['trim']()['toLowerCase']()||null;else {const _0x187d3e=_0x3d9c5a['rest']?.['match'](/^\w+/);if(_0x187d3e)_0x3d9c5a['verb']=_0x187d3e[0x0]['trim']()['toLowerCase']()||null;}return _0x3d9c5a;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x1da2fc){const _0x22744c=_0xa6f4ed['parse'](_0x1da2fc,{'skipEmptyLines':![]})['data'],_0x7c976={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0xdf203a,coIdx:_0x316ccb,iloIdx:_0x286664,assessToolIdx:_0x1daa4f,perfTargetIdx:_0x41ce9b}=getCoaepHeader(_0x22744c);if(_0xdf203a===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x22744c['forEach'](_0x23c0c3=>{const _0x14cf5a=_0x23c0c3['indexOf']('Name\x20of\x20Faculty:'),_0x950410=_0x23c0c3['indexOf']('School\x20Year'),_0x17fac8=_0x23c0c3['indexOf']('Course:'),_0x464b85=_0x23c0c3['indexOf']('Semester');_0x14cf5a!==-1&&(_0x7c976['COAEP']['faculty']=_0x23c0c3[_0x14cf5a+0x1]?.['trim']()||_0x7c976['COAEP']['faculty']);_0x950410!==-1&&(_0x7c976['COAEP']['sy']=_0x23c0c3[_0x950410+0x1]?.['trim']()||_0x7c976['COAEP']['sy']);_0x17fac8!==-1&&(_0x7c976['COAEP']['course']=_0x23c0c3[_0x17fac8+0x1]?.['trim']()||_0x7c976['COAEP']['course']);if(_0x464b85!==-1){const _0x192f08=_0x23c0c3[_0x464b85+0x1]?.['trim']()||'',_0x3043d5=_0x192f08['match'](/\d+/)?.[0x0];_0x7c976['COAEP']['semester']=_0x3043d5?parseInt(_0x3043d5,0xa):_0x7c976['COAEP']['semester'];}});let _0x593918=null;return _0x22744c['forEach']((_0x5c600b,_0x296714)=>{if(_0x296714<=_0xdf203a)return;let _0x45bfc1=_0x5c600b[_0x316ccb-0x1]?.['trim']()||'',_0x2770e7=_0x5c600b[_0x316ccb]?.['trim']()||'';/^\d+$/['test'](_0x5c600b[_0x316ccb]?.['trim']()||'')&&(_0x45bfc1=_0x5c600b[_0x316ccb]?.['trim']()||'',_0x2770e7=_0x5c600b[_0x316ccb+0x1]?.['trim']()||'');const _0x1a70fc=_0x5c600b[_0x286664]?.['trim']()||'',_0x40479b=_0x5c600b[_0x1daa4f]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x2fd508=_0x5c600b[_0x41ce9b]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x45bfc1&&/^\d+$/['test'](_0x45bfc1)){_0x593918&&_0x7c976['COAEP']['co']['push'](_0x593918);const _0x3b7fc1=_0x2770e7,{verb:_0x1cc6ac,cognitive_level:_0x24de7f,taxonomy_level:_0xbfa71}=extractFromObjective(_0x3b7fc1);if(!_0x1cc6ac)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x45bfc1+'\x20is\x20in\x20the\x20correct\x20format.'};_0x593918={'statement':_0x3b7fc1,'ilo':[],'verb':_0x1cc6ac,'cognitive_level':_0x24de7f,'taxonomy_level':_0xbfa71};}if(_0x593918&&_0x1a70fc&&_0x2fd508){const _0x9042ce=_0x1a70fc['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x9042ce['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x9042ce['length']<0xa)return;let _0x743d=_0x40479b;if(!_0x743d&&_0x9042ce['includes'](':')){const _0x204025=_0x9042ce['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x204025&&(_0x743d=_0x204025[0x1]?.['trim']()||'');}const {performance_target:_0x447230,passing_score:_0x29712b}=performaceTarget(_0x2fd508),{verb:_0x3e277f,cognitive_level:_0xe15fea,taxonomy_level:_0x2c6926}=extractFromObjective(_0x9042ce);_0x593918['ilo']['push']({'statement':_0x9042ce,'assessment_tool':_0x743d,'performance_target':_0x447230,'passing_score':_0x29712b,'verb':_0x3e277f,'cognitive_level':_0xe15fea,'taxonomy_level':_0x2c6926});}}),_0x593918&&_0x7c976['COAEP']['co']['push'](_0x593918),_0x7c976;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0xf63055,_0x5808fa,_0x110fd1){try{const _0x492588=await convertToCSVFile(_0x5808fa),_0x4ecd2e=await _0x492588['text'](),_0x291078=parseCOAEP(_0x4ecd2e);console['log'](_0x291078);const _0x16912b=await fetch(_0xf63055+'/coaeps/upload?course_id='+_0x110fd1,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x291078)});if(!_0x16912b['ok']){const _0x2d36f6=await _0x16912b['json']();throw _0x2d36f6;}return _0x16912b['json']();}catch(_0x15fa70){throw _0x15fa70;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x1ce430,_0x260577){try{const _0x38f9e2=await convertToCSVFile(_0x260577),_0x4e5f88=new FormData();_0x4e5f88['append']('csvFile',_0x38f9e2);const _0x132ab4=await fetch(_0x1ce430+'/enrolled-students/upload',{'method':'POST','body':_0x4e5f88});if(!_0x132ab4['ok']){const _0x2c580a=await _0x132ab4['json']();throw _0x2c580a;}return _0x132ab4['json']();}catch(_0x2b9e2a){throw _0x2b9e2a;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x49b08f){const _0x4038ab=_0xa6f4ed['parse'](_0x49b08f,{'skipEmptyLines':!![]})['data'];let _0x12505c='',_0x1de2b9='',_0x3b4502='';const _0x3fb5fe=[];return _0x4038ab['forEach'](_0x4326db=>{const _0x1d5020=_0x4326db['map'](_0x17a22a=>(_0x17a22a??'')['toString']()['trim']()),_0x5b8c99=_0x1d5020[0x0]??'';if(_0x5b8c99['startsWith']('Course\x20No:')){const _0x54f7b6=_0x5b8c99['replace']('Course\x20No:','')['trim'](),_0x4f9f99=_0x54f7b6['split'](/\s+/);_0x3b4502=_0x4f9f99[0x0]??'';const [_0x234bc8,_0x6e0543]=(_0x4f9f99[0x1]??'')['split']('-');_0x1de2b9=_0x234bc8??'';const _0x525f51=(_0x6e0543??'')['match'](/[a-z]$/);_0x12505c=_0x525f51?_0x525f51[0x0]:'';}if(/^\d+$/['test'](_0x5b8c99)){const _0x13c5ac=_0x1d5020[0x2]??'';_0x3fb5fe['push']({'subj_code':_0x3b4502,'student_no':_0x13c5ac,'course_id':_0x1de2b9,'section':_0x12505c});}}),{'enrolledCourses':_0x3fb5fe};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x553b2a,_0x3ee082,_0x33f43a,_0x4e081c){try{const _0x1a0f41=await convertToCSVFile(_0x3ee082),_0x157a9a=await _0x1a0f41['text'](),_0xe42cc9=parseClassList(_0x157a9a),_0x280929='subj_code='+_0x33f43a+'&period_id='+_0x4e081c,_0x188f67=await fetch(_0x553b2a+'/enrolled-courses/upload?'+_0x280929,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0xe42cc9)});if(!_0x188f67['ok']){const _0x5eae53=await _0x188f67['json']();throw _0x5eae53;}return _0x188f67['json']();}catch(_0x4f1a45){throw _0x4f1a45;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x581c67){const {data:_0x3e2e9e}=_0xa6f4ed['parse'](_0x581c67,{'skipEmptyLines':!![]}),_0xfd59f9=_0x3e2e9e['filter'](_0x8018b5=>_0x8018b5['length']>0x0),_0x45d747=_0xfd59f9['find'](_0x1df906=>_0x1df906['some'](_0x1b7bba=>_0x1b7bba?.['includes']('Faculty'))),_0x41a752=_0x45d747?_0x45d747['findIndex'](_0x12f539=>_0x12f539?.['includes']('Faculty')):-1,_0x20cd6a=_0x41a752!==-1&&_0x45d747?_0x45d747[_0x41a752+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x31fccf=_0xfd59f9['find'](_0x1929ea=>_0x1929ea['some'](_0xedda75=>_0xedda75?.['includes']('Semester'))),_0x42a43b=_0x31fccf?_0x31fccf['findIndex'](_0xc38011=>_0xc38011?.['includes']('Semester')):-1,_0x10a049=_0x42a43b!==-1&&_0x31fccf?_0x31fccf[_0x42a43b+0x2]?.['trim']()??'':'',_0x167084=_0x10a049['includes']('1st')?0x1:_0x10a049['includes']('2nd')?0x2:0x0,_0x34f12a=_0xfd59f9['find'](_0x4d289e=>_0x4d289e['some'](_0x5cfb18=>_0x5cfb18?.['includes']('Course\x20&\x20Sec'))),_0x155790=_0x34f12a?_0x34f12a['findIndex'](_0xd7ecbc=>_0xd7ecbc?.['includes']('Course\x20&\x20Sec')):-1,_0x3ab383=_0x155790!==-1&&_0x34f12a?_0x34f12a[_0x155790+0x2]?.['trim']()??'':'';let _0x7f77a1='',_0x5415ad='';if(_0x3ab383){const _0x5c1ead=_0x3ab383['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x5c1ead&&(_0x7f77a1=_0x5c1ead[0x1]??'',_0x5c1ead[0x2]&&(_0x5415ad=_0x5c1ead[0x2]['replace'](/^OC/i,'')));}const _0x49f839=_0xfd59f9['find'](_0x351cee=>_0x351cee['some'](_0x2c6f84=>_0x2c6f84?.['includes']('School\x20Year'))),_0x455786=_0x49f839?_0x49f839['findIndex'](_0x35aa22=>_0x35aa22?.['includes']('School\x20Year')):-1,_0x6a7b9a=_0x455786!==-1&&_0x49f839?_0x49f839[_0x455786+0x2]?.['trim']()??'':'';let _0x5c16ed=0x0;if(_0x6a7b9a){const _0x3b088b=_0x6a7b9a['match'](/(\d{4})-(\d{4})/);if(_0x3b088b){const _0x3170b4=(_0x3b088b[0x1]??'')['slice'](0x2),_0x55c5cb=(_0x3b088b[0x2]??'')['slice'](0x2);_0x5c16ed=parseInt(_0x3170b4+_0x55c5cb,0xa);}}const _0x5ee4e2={'faculty':_0x20cd6a,'course':_0x7f77a1,'section':_0x5415ad,'semester':_0x167084,'sy':_0x5c16ed},_0x1b8e09=_0xfd59f9['findIndex'](_0x3b3e6e=>_0x3b3e6e['some'](_0x2b8e0b=>_0x2b8e0b?.['trim']()==='CO\x20#'));if(_0x1b8e09===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x58e892=_0xfd59f9[_0x1b8e09+0x1];if(!_0x58e892)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x50643f={};let _0x5ae76a=0x1,_0x4a6e4c=0x1;for(let _0x5d5082=0x3;_0x5d5082<_0x58e892['length'];_0x5d5082++){const _0x5cb8d2=_0x58e892[_0x5d5082];if(!_0x5cb8d2)continue;const _0x8d8c5f='co'+_0x5ae76a;if(!_0x50643f[_0x8d8c5f])_0x50643f[_0x8d8c5f]=[];_0x50643f[_0x8d8c5f]['push']('ilo'+_0x4a6e4c),_0x4a6e4c++,_0x4a6e4c>0x3&&(_0x5ae76a++,_0x4a6e4c=0x1);}const _0x2fdc59=_0xfd59f9['findIndex'](_0x3453dc=>_0x3453dc['includes']('Name\x20of\x20Students'));if(_0x2fdc59===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x2b0dc3=_0xfd59f9[_0x2fdc59];if(!_0x2b0dc3)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x429edc=_0x2b0dc3['findIndex'](_0x563896=>_0x563896?.['includes']('Name\x20of\x20Students'));if(_0x429edc===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x4dee97=_0x429edc+0x2,_0x1cabc3=[];for(let _0x4e98a0=_0x2fdc59+0x1;_0x4e98a0<_0xfd59f9['length'];_0x4e98a0++){const _0x4a0d2c=_0xfd59f9[_0x4e98a0];if(!_0x4a0d2c)continue;if(_0x4a0d2c['some'](_0x314935=>_0x314935?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x314935?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x314935?.['toUpperCase']()['includes']('INACTIVE')||_0x314935?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x4a0d2c[_0x429edc])continue;const _0x26ba0e=_0x4a0d2c[_0x429edc]['replace'](/"/g,'')['trim'](),_0x5a8cf6=_0x4a0d2c['slice'](_0x4dee97)['map'](_0x475992=>_0x475992===null?null:!isNaN(Number(_0x475992))?parseFloat(_0x475992):0x0);let _0x2d072b=0x0;const _0x4eecc8={};Object['entries'](_0x50643f)['forEach'](([_0x309b06,_0x50f209])=>{const _0x1a7afa={};_0x50f209['forEach'](_0x46c172=>{_0x1a7afa[_0x46c172]=_0x5a8cf6[_0x2d072b]??0x0,_0x2d072b++;}),_0x4eecc8[_0x309b06]={'transmuted_score':_0x1a7afa};}),_0x1cabc3['push']({'student_name':_0x26ba0e,'coaep':_0x4eecc8});}const _0x4459d1=_0xfd59f9['find'](_0x3499fb=>_0x3499fb['some'](_0x55dac1=>_0x55dac1?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x556b82=_0xfd59f9['find'](_0x5f108d=>_0x5f108d['some'](_0x197725=>_0x197725?.['includes']('AVERAGE'))),_0x54d709=_0x4459d1?_0x4459d1['slice'](_0x4dee97)['map'](_0x30225c=>_0x30225c&&!isNaN(Number(_0x30225c))?parseInt(_0x30225c):0x0):[],_0x1e2904=_0x556b82?_0x556b82['slice'](_0x4dee97)['map'](_0x5ea74d=>_0x5ea74d&&_0x5ea74d!=='#DIV/0!'&&!isNaN(Number(_0x5ea74d))?parseInt(_0x5ea74d):0x0):[],_0x23cb86={};let _0x207531=0x0;return Object['entries'](_0x50643f)['forEach'](([_0x5a7076,_0x2351e5])=>{if(!_0x23cb86[_0x5a7076])_0x23cb86[_0x5a7076]={};_0x2351e5['forEach'](_0x310403=>{_0x23cb86[_0x5a7076][_0x310403]={'achievedMinimum':_0x54d709[_0x207531]??0x0,'average':_0x1e2904[_0x207531]??0x0},_0x207531++;});}),{'assessmentData':{'classAssignment':_0x5ee4e2,'student':_0x1cabc3,'total':_0x23cb86}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x49900e,_0x33eba4){try{const _0x4fdfe2=await convertToCSVFile(_0x33eba4),_0x144426=await _0x4fdfe2['text'](),_0x4e505f=parseAssessmentCsv(_0x144426),_0x4b8478=await fetch(_0x49900e+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x4e505f)});if(!_0x4b8478['ok']){const _0x523ef4=await _0x4b8478['json']();throw _0x523ef4;}return _0x4b8478['json']();}catch(_0x2a5779){throw _0x2a5779;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x303228,_0xe688a){try{const _0x2ded1b=await convertToCSVFile(_0xe688a),_0x22ed53=new FormData();_0x22ed53['append']('csvFile',_0x2ded1b);const _0x1f6adc=await fetch(_0x303228+'/dept-faculties/upload',{'method':'POST','body':_0x22ed53});if(!_0x1f6adc['ok']){const _0x353140=await _0x1f6adc['json']();throw _0x353140;}return _0x1f6adc['json']();}catch(_0x1d5cc3){throw _0x1d5cc3;}}
|
|
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(_0x14fcd5){let _0x25fcc7={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x4a2524=0x0;_0x4a2524<Math['min'](_0x14fcd5['length'],0x14);_0x4a2524++){const _0xd72ac9=(_0x14fcd5[_0x4a2524]??[])['map'](_0x485337=>_0x485337['toLowerCase']()['trim']()),_0x51bd7f=_0xd72ac9['findIndex'](_0x5e6342=>HEADERS['po']['some'](_0x4605ec=>_0x5e6342['toLowerCase']()['includes'](_0x4605ec))),_0x467b58=_0xd72ac9['findIndex'](_0x3bc442=>HEADERS['tl']['some'](_0x529205=>_0x3bc442['toLowerCase']()['includes'](_0x529205))),_0x460aaa=_0xd72ac9['findIndex'](_0x5f2871=>HEADERS['pi']['some'](_0x18a91e=>_0x5f2871['toLowerCase']()['includes'](_0x18a91e))),_0x25fe97=_0xd72ac9['findIndex'](_0x58d04b=>HEADERS['fc']['some'](_0x5609ba=>_0x58d04b['toLowerCase']()['includes'](_0x5609ba))),_0x46f156=_0xd72ac9['findIndex'](_0x25066f=>HEADERS['sc']['some'](_0xf61bcc=>_0x25066f['toLowerCase']()['includes'](_0xf61bcc))),_0x15861e=_0xd72ac9['findIndex'](_0x46878e=>HEADERS['at']['some'](_0x49c5ba=>_0x46878e['toLowerCase']()['includes'](_0x49c5ba))),_0x46c4dc=_0xd72ac9['findIndex'](_0x5e3285=>HEADERS['pt']['some'](_0x5ec1cb=>_0x5e3285['toLowerCase']()['includes'](_0x5ec1cb))),_0x28d70e=[_0x51bd7f,_0x467b58,_0x460aaa,_0x25fe97,_0x46f156,_0x15861e,_0x46c4dc]['filter'](_0x3806cb=>_0x3806cb!==-1)['length'];if(_0x28d70e>=0x3){_0x25fcc7={'headerIdx':_0x4a2524,'poIdx':_0x51bd7f,'tlIdx':_0x467b58,'piIdx':_0x460aaa,'fcIdx':_0x25fe97,'scIdx':_0x46f156,'atIdx':_0x15861e,'ptIdx':_0x46c4dc};break;}}if(_0x25fcc7['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x25fcc7;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x64cdc9=>{let _0x484c9e=_0x64cdc9['split'](',')['reduce']((_0x1a6a7e,_0x1231fe)=>{const _0x43fdc8=_0x1231fe['trim']();if(_0x43fdc8)_0x1a6a7e['push'](_0x43fdc8);return _0x1a6a7e;},[]);return _0x484c9e;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x3da600=>{try{const _0x96c434=_0xa6f4ed['parse'](_0x3da600,{'skipEmptyLines':![]})['data'],{headerIdx:_0x3fcbea,poIdx:_0x502527,tlIdx:_0x80fcc1,piIdx:_0x33d988,fcIdx:_0x40e102,scIdx:_0x40a7d6,atIdx:_0x37de9f,ptIdx:_0x58f1f8}=getPoaepHeader(_0x96c434),_0x2bb0a6=[];let _0x5aa1cb={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x47def2='',_0x388af5='',_0x3c0a09='';for(let _0x536815=_0x3fcbea+0x1;_0x536815<_0x96c434['length'];_0x536815++){const _0x5c3647=_0x96c434[_0x536815];if(!_0x5c3647)break;const _0x59ff66=_0x5c3647[_0x502527]?.['trim']()||'';_0x59ff66!==''&&(_0x5aa1cb={'po_desc':_0x59ff66,'seq_no':_0x5aa1cb['seq_no']+0x1,'PerfIndicators':[]},_0x2bb0a6['push'](_0x5aa1cb),_0x47def2='',_0x388af5='',_0x3c0a09='');if(_0x5aa1cb['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x536815+'.');const _0xc5c33f=_0x5c3647[_0x33d988]?.['trim']()||'';if(_0xc5c33f==='')break;const _0x24fe1b=_0x5c3647[_0x40e102]?.['trim']()||'';if(_0x24fe1b==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x536815+'.');const _0x3574a9=_0x5c3647[_0x40a7d6]?.['trim']()||_0x47def2;if(_0x3574a9==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x536815+'.');_0x47def2=_0x3574a9;const _0x50fd3f=_0x5c3647[_0x37de9f]?.['trim']()||_0x388af5;if(_0x50fd3f==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x536815+'.');_0x388af5=_0x50fd3f;const _0x1a9605=_0x5c3647[_0x58f1f8]?.['trim']()||_0x3c0a09;if(_0x1a9605==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x536815+'.');_0x3c0a09=_0x1a9605;const _0x370153=parseFormativeCourses(_0x24fe1b);if(_0x370153['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x536815+'.');const _0x8e801b=performaceTarget(_0x1a9605);if(!_0x8e801b['performance_target']||!_0x8e801b['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x536815+'.');const _0xa50e82={'pi_desc':_0xc5c33f,'FormativeCourses':_0x370153['map'](_0x25ca92=>({'course_id':_0x25ca92,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x3574a9},'TaxonomyLevel':null,'AssessmentTool':{'at_desc':_0x50fd3f},'PerformanceTargets':{'target_percent':_0x8e801b['performance_target'],'min_score':_0x8e801b['passing_score']}};_0x5aa1cb['PerfIndicators']['push'](_0xa50e82);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x2bb0a6}};}catch(_0x18a98f){return {'success':![],'error':_0x18a98f instanceof Error?_0x18a98f['message']:_0x18a98f,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x11c2ee,_0x5789f6,_0x34d9fb,_0x332eac,_0x489368){try{const _0x3230b2=await convertToCSVFile(_0x5789f6),_0x562e85=await _0x3230b2['text'](),_0x28a73e=parsePOAEP(_0x562e85),_0x48ec7a=await fetch(_0x11c2ee+'/program-outcomes/poaep/upload?curr_id='+_0x332eac+'&period_id='+_0x489368,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x34d9fb},'credentials':'include','body':JSON['stringify'](_0x28a73e)});if(!_0x48ec7a['ok']){const _0x3913d2=await _0x48ec7a['json']();throw _0x3913d2;}return _0x48ec7a['json']();}catch(_0x4cfe73){throw _0x4cfe73;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(_0x35e782='DataTable',_0x4efc2d){this['name']=_0x35e782,this['headers']=_0x4efc2d,this['table']=[],this['validators']=[],this['state']={};}['setDataTable'](_0x2effb6){this['name']=_0x2effb6['name'],this['headers']=_0x2effb6['headers'],this['table']=_0x2effb6['table'],this['state']=_0x2effb6['state'],this['validators']=_0x2effb6['validators'];}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getState'](){return this['state'];}['setState']=async _0x13ca8d=>{await this['assertInitialized'](),this['state']=_0x13ca8d;};['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'],'validators':this['validators']}};}async['setTable'](_0x1890ce){await this['assertInitialized'](),this['table']=_0x1890ce;}async['initializeTable'](_0x2fae9d,_0x49000a){try{let _0x3b8fb4;if(_0x2fae9d instanceof File)_0x3b8fb4=await this['fromXML'](_0x2fae9d,_0x49000a);else _0x3b8fb4=await this['fromCSVString'](_0x2fae9d);if(!_0x3b8fb4['success']||!_0x3b8fb4['data'])return _0x3b8fb4;if(_0x3b8fb4['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x3b8fb4['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x40faf6){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x40faf6};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x58d7d3,_0x438136){const _0x3d2237=await convertToCSVFile(_0x58d7d3,_0x438136),_0x10690f=await _0x3d2237['text']();return this['fromCSVString'](_0x10690f);}async['searchTable'](_0x16c27c){await this['assertInitialized']()['catch'](()=>{return [];});if(!_0x16c27c)return [];const _0xe87d48=[];for(let _0x6705e0=0x0;_0x6705e0<this['table']['length'];_0x6705e0++){const _0x41f61f=this['table'][_0x6705e0],_0x1f70f5=this['searchRow'](_0x41f61f,_0x16c27c);for(const _0xf39259 of _0x1f70f5){_0xe87d48['push']({'row':_0x6705e0,'column':_0xf39259['column']});}}return _0xe87d48;}async['validate'](){const _0x225306=[],_0x353109=[];try{await this['assertInitialized']()['then'](()=>{_0x225306['push']('Table\x20is\x20initialized.');})['catch'](_0x21ca50=>_0x353109['push'](_0x21ca50));if(_0x353109['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x225306,_0x353109);const {success:_0x1da3f6,message:_0xbd9c84,error:_0x206c2c,data:_0x2abe2c}=await this['toJson']();if(!_0x2abe2c)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x225306['push'](..._0x2abe2c['validMsgs']),_0x353109['push'](..._0x2abe2c['tableErrors']);const {jsonObj:_0x432f39}=_0x2abe2c;for(const _0x56c2d4 of this['validators']){await _0x56c2d4['validate'](_0x225306,_0x353109,this,_0x432f39);}let _0x33f9da=this['name']+'\x20ran\x20its\x20validations.';if(_0x225306['length']>0x0)_0x33f9da+='\x20'+_0x225306['length']+'\x20validations\x20were\x20successful.';if(_0x353109['length']>0x0)_0x33f9da+='\x20'+_0x353109['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x33f9da,'data':{'validMsgs':_0x225306,'tableErrors':_0x353109}};}catch(_0x28f2b8){return _0x353109['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x28f2b8}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x225306,'tableErrors':_0x353109}};}}['useValidator'](_0x1a983a){this['validators']['push'](_0x1a983a);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x31b409){this['name']=_0x31b409;}['getName'](){return this['name'];}['report'](_0x4fa19e,_0x421b1c,_0x559be1){if(_0x4fa19e['length']>0x0)_0x559be1['push'](..._0x4fa19e);else _0x421b1c['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'](_0x359f46,_0x53b07d,_0xa2f8da,_0x38d9f8){const _0x2d348e=[];if(!_0x38d9f8){_0x53b07d['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x1ffb01=0x0;_0x1ffb01<_0x38d9f8['co']['length'];_0x1ffb01++){const _0x5002d9=_0x38d9f8['co'][_0x1ffb01];if(!_0x5002d9){(await _0xa2f8da['searchTable'](_0x1ffb01+0x1+''))['map'](({row:_0x57eed0,column:_0x30fa28})=>{_0x2d348e['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x1ffb01+0x1)+'.','row':_0x57eed0,'column':_0x30fa28,'from':this['name']});});continue;}if(!_0x5002d9?.['ilo']){(await _0xa2f8da['searchTable'](_0x5002d9['statement']))['map'](({row:_0x4ed150,column:_0x4712c0})=>{_0x2d348e['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x1ffb01+0x1)+'.','row':_0x4ed150,'column':_0x4712c0,'from':this['name']});});continue;}const _0x44fb8a=_0x5002d9['ilo']['length']-0x1,_0x4f6ef1=_0x5002d9['ilo'][_0x44fb8a];if(!_0x4f6ef1['taxonomy_level']){(await _0xa2f8da['searchTable'](_0x4f6ef1['statement']))['map'](({row:_0x1d5d10,column:_0x791881})=>{_0x2d348e['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x1ffb01+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x1d5d10,'column':_0x791881,'from':this['name']});});continue;}if(_0x4f6ef1['taxonomy_level']['trim']()['toLowerCase']()!==_0x5002d9['taxonomy_level']['trim']()['toLowerCase']()){(await _0xa2f8da['searchTable'](_0x4f6ef1['statement']))['map'](({row:_0x4fc36f,column:_0x8c0717})=>{_0x2d348e['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x1ffb01+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x4f6ef1['taxonomy_level']?.['toUpperCase']()+'\x20!=\x20'+_0x5002d9['taxonomy_level']?.['toUpperCase']()+')','row':_0x4fc36f,'column':_0x8c0717,'from':this['name']});});continue;}}this['report'](_0x2d348e,_0x359f46,_0x53b07d);}}
|
|
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'](_0x60b62d,_0x5d3c4a,_0x2cc924,_0x3b6bfd){const _0x4e48fc=[];if(!_0x3b6bfd){_0x5d3c4a['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x24e9e2=0x0;_0x24e9e2<_0x3b6bfd['co']['length'];_0x24e9e2++){const _0x2e39f1=_0x3b6bfd['co'][_0x24e9e2];if(!_0x2e39f1['taxonomy_level']){_0x4e48fc['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x24e9e2+0x1),'from':this['name']});continue;}if(!whitelist$1['includes'](_0x2e39f1['taxonomy_level']['toLowerCase']())){const {row:_0x49c25c,column:_0x42392d}=(await _0x2cc924['searchTable'](_0x2e39f1['statement']))[0x0];_0x49c25c&&_0x4e48fc['push']({'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20APPLYING:\x20'+_0x2e39f1['taxonomy_level']['toUpperCase'](),'row':_0x49c25c,'column':_0x42392d,'from':this['name']});}}this['report'](_0x4e48fc,_0x60b62d,_0x5d3c4a);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'](_0x223bba,_0x312bf8,_0x2edfc7,_0x1fee5f){const _0x1cb551=[];if(!_0x1fee5f){_0x312bf8['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x4f7d0b=0x0;_0x4f7d0b<_0x1fee5f['co']['length'];_0x4f7d0b++){const _0x2e9795=_0x1fee5f['co'][_0x4f7d0b];if(!_0x2e9795){(await _0x2edfc7['searchTable'](_0x4f7d0b+0x1+''))['map'](({row:_0x229341,column:_0x259ee9})=>{_0x1cb551['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x4f7d0b+0x1)+'.','row':_0x229341,'column':_0x259ee9,'from':this['name']});});continue;}if(!_0x2e9795?.['ilo']){(await _0x2edfc7['searchTable'](_0x2e9795['statement']))['map'](({row:_0x32073f,column:_0x96fbf9})=>{_0x1cb551['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x4f7d0b+0x1)+'.','row':_0x32073f,'column':_0x96fbf9,'from':this['name']});});continue;}const _0x480b35=(await _0x2edfc7['searchTable'](_0x2e9795['statement']))[0x0]??{'row':-1,'column':-1},_0x1afea2=_0x2e9795['ilo']['map'](_0x6ecdc1=>taxoOrder[_0x6ecdc1['taxonomy_level']]);let _0x471bb9=_0x1afea2[0x0];for(let _0x122e6a=0x1;_0x122e6a<_0x1afea2['length'];_0x122e6a++){if(_0x1afea2[_0x122e6a]<_0x471bb9){_0x1cb551['push']({'error':'Under\x20CO\x20'+(_0x4f7d0b+0x1)+',\x20ILO\x20'+(_0x122e6a+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x122e6a+'\x27s.','row':_0x480b35['row'],'column':_0x480b35['column']+_0x122e6a,'from':this['name']});continue;}_0x471bb9=_0x1afea2[_0x122e6a];}}this['report'](_0x1cb551,_0x223bba,_0x312bf8);}}
|
|
55
55
|
|
|
56
|
-
const minPerfTarget$1=0x32,minPassScore$1=0x32;class MinILOPerfTarget extends DTValidator{constructor(){super('MIN_ILO_PERF_TARGET');}async['validate'](
|
|
56
|
+
const minPerfTarget$1=0x32,minPassScore$1=0x32;class MinILOPerfTarget extends DTValidator{constructor(){super('MIN_ILO_PERF_TARGET');}async['validate'](_0x4e8866,_0x2c1d05,_0x2fa46a,_0x52a689){const {success:_0x228e88,data:_0x42698c}=_0x2fa46a['getTable'](),_0x1d6cc2=[];if(!_0x228e88){_0x1d6cc2['push']({'error':'Unable\x20to\x20access\x20COAEP\x20table.','from':this['name']});return;}const {table:_0x38d55d}=_0x42698c;for(let _0x3f5d59=0x0;_0x3f5d59<_0x38d55d['length'];_0x3f5d59++){const _0x24a4dc=_0x38d55d[_0x3f5d59],[_0x221ba4,_0x1edb73]=_0x24a4dc[0x4];if(!_0x221ba4)_0x1d6cc2['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x3f5d59,'column':0x4,'from':this['name']});else _0x221ba4<minPerfTarget$1&&_0x1d6cc2['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget$1+'.','row':_0x3f5d59,'column':0x4,'from':this['name']});if(!_0x1edb73)_0x1d6cc2['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x3f5d59,'column':0x4,'from':this['name']});else _0x1edb73<minPassScore$1&&_0x1d6cc2['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore$1+'.','row':_0x3f5d59,'column':0x4,'from':this['name']});}this['report'](_0x1d6cc2,_0x4e8866,_0x2c1d05);}}
|
|
57
57
|
|
|
58
58
|
const DEFAULT_CO_COG_LEVEL='D';
|
|
59
59
|
|
|
60
|
-
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'](
|
|
60
|
+
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'](_0x37618f,_0x3d446f){await this['assertInitialized']()['catch'](_0x7b9e64=>{_0x3d446f['push'](_0x7b9e64);return;});const _0x20e03a=[];let _0x24babb=null,_0x3d2d97=null;for(let _0x2c27bc=0x0;_0x2c27bc<this['table']['length'];_0x2c27bc++){const _0x332071=[],_0x160a37=this['table'][_0x2c27bc],_0x5d4fd5=_0x160a37[0x0]||_0x24babb,_0x29dbca=_0x160a37[0x1]||_0x3d2d97,_0xb71128=_0x160a37[0x2],_0x373947=_0x160a37[0x3],_0xfa243f=_0x160a37[0x4];if(!_0x5d4fd5)_0x332071['push'](0x0);if(!_0x29dbca)_0x332071['push'](0x1);if(!_0xb71128)_0x332071['push'](0x2);if(!_0x373947)_0x332071['push'](0x3);if(!_0xfa243f)_0x332071['push'](0x4);if(_0x3d2d97!==_0x29dbca)this['validateObjectiveGrammar'](_0x29dbca,_0x2c27bc,0x1,_0x3d446f);_0x24babb=_0x5d4fd5,_0x3d2d97=_0x29dbca;for(const _0x4a2f91 of _0x332071){_0x20e03a['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x4a2f91],'row':_0x2c27bc,'column':_0x4a2f91});}if(_0xb71128)this['validateObjectiveGrammar'](_0xb71128,_0x2c27bc,0x2,_0x3d446f);}if(_0x20e03a['length']>0x0)_0x3d446f['push'](..._0x20e03a);else _0x37618f['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x138a9e){try{const _0x4bc0c9=[],_0x2698df=_0xa6f4ed['parse'](_0x138a9e,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x31fde6,coIdx:_0x385ece,iloIdx:_0xdcd91c,assessToolIdx:_0x43fe47,perfTargetIdx:_0x38d0d9}=getCoaepHeader(_0x2698df);if(_0x31fde6===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x2698df['forEach'](_0x1b825=>{const _0x151297=_0x1b825['indexOf']('Name\x20of\x20Faculty:'),_0x344df1=_0x1b825['indexOf']('School\x20Year'),_0x1bcfe0=_0x1b825['indexOf']('Course:'),_0x3f8cef=_0x1b825['indexOf']('Semester');_0x151297!==-0x1&&(this['state']['faculty']=_0x1b825[_0x151297+0x1]?.['trim']()||this['state']['faculty']);_0x344df1!==-0x1&&(this['state']['sy']=_0x1b825[_0x344df1+0x1]?.['trim']()||this['state']['sy']);if(_0x1bcfe0!==-0x1){const _0x1efd16=_0x1b825[_0x1bcfe0+0x1]?.['trim']()['split']('\x20')[0x0]||'';this['state']['course']=_0x1efd16||this['state']['course'];}if(_0x3f8cef!==-0x1){const _0x899e0=_0x1b825[_0x3f8cef+0x1]?.['trim']()||'',_0x3947a6=_0x899e0['match'](/\d+/)?.[0x0];this['state']['semester']=_0x3947a6?parseInt(_0x3947a6,0xa):this['state']['semester'];}});for(let _0x5cfdb8=0x0;_0x5cfdb8<=_0x2698df['length'];_0x5cfdb8++){const _0x4b5d70=_0x2698df[_0x5cfdb8];if(!_0x4b5d70)break;if(_0x5cfdb8<=_0x31fde6)continue;if(!_0x4b5d70[_0xdcd91c])break;let _0x3155ae=_0x4b5d70[_0x385ece-0x1]?.['trim']()||'',_0x54a164=_0x4b5d70[_0x385ece]?.['trim']()||'',_0x9df5fd=_0x4b5d70[_0xdcd91c]?.['trim']()||'';/^\d+$/['test'](_0x4b5d70[_0x385ece]?.['trim']()||'')&&(_0x3155ae=_0x4b5d70[_0x385ece]?.['trim']()||'',_0x54a164=_0x4b5d70[_0x385ece+0x1]?.['trim']()||'');let _0x4f32e4=null;if(_0x54a164){const {cognitive_level:_0x5c288d,taxonomy_level:_0x2aa613,verb:_0x32e440,rest:_0x4a80b2}=extractFromObjective(_0x54a164);_0x4f32e4=[_0x5c288d??DEFAULT_CO_COG_LEVEL,_0x2aa613,_0x32e440,_0x4a80b2];}let _0xdc2492;{const {cognitive_level:_0xba9726,taxonomy_level:_0x5e9840,verb:_0x2071a1,rest:_0x25237e}=extractFromObjective(_0x9df5fd);_0xdc2492=[_0xba9726,_0x5e9840,_0x2071a1,_0x25237e];}const _0x576822=_0x4b5d70[_0x38d0d9]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x1ea319,passing_score:_0x3ad6bb}=performaceTarget(_0x576822);_0x4bc0c9['push']([_0x3155ae,_0x4f32e4,_0xdc2492,_0x4b5d70[_0x43fe47]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x1ea319,_0x3ad6bb]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x4bc0c9};}catch(_0x5f069c){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x5f069c};}}async['toJson'](){const _0xb55bc6=[],_0x472ceb=[],_0x3d136b='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x3048f9={'faculty':this['state']['faculty'],'course':this['state']['course'],'sy':this['state']['sy'],'semester':this['state']['semester'],'co':[]};let _0x455c1f=null,_0x2f4b2f='',_0x2638e2=[null,null];this['table']['forEach']((_0x193b34,_0x3ada12)=>{if(_0x3ada12===0x0&&!_0x193b34[0x1])_0x472ceb['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x3d136b});_0x193b34[0x1]&&(_0x2f4b2f='',_0x2638e2=[null,null]);const _0x2c0350=_0x193b34[0x1],_0x2972f5=_0x193b34[0x2],_0x37a3f8=_0x193b34[0x3]||_0x2f4b2f,_0x510bb7=_0x193b34[0x4]||_0x2638e2;if(!_0x2972f5)_0x472ceb['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x3d136b});if(!_0x37a3f8)_0x472ceb['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x3ada12,'column':0x3,'from':_0x3d136b});if(!_0x510bb7)_0x472ceb['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x3ada12,'column':0x4,'from':_0x3d136b});if(_0x2c0350){const [_0x2fb5ae,_0x9569c6,_0x4c4574,_0x22192b]=_0x2c0350,_0x31377d={'statement':_0x22192b,'ilo':[],'taxonomy_level':_0x9569c6,'cognitive_level':_0x2fb5ae,'verb':_0x4c4574};_0x455c1f=_0x31377d,_0x3048f9['co']['push'](_0x31377d);}const [_0x17a4f5,_0x2c9097,_0x4c5c89,_0x889b08]=_0x2972f5,[_0x21e194,_0x4081c1]=_0x510bb7,_0x5450b2={'statement':_0x889b08,'assessment_tool':_0x37a3f8,'performance_target':_0x21e194,'passing_score':_0x4081c1,'cognitive_level':_0x17a4f5,'taxonomy_level':_0x2c9097,'verb':_0x4c5c89};_0x455c1f['ilo']['push'](_0x5450b2);});if(_0x472ceb['length'])return _0x472ceb['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x3d136b}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x3048f9,'validMsgs':_0xb55bc6,'tableErrors':_0x472ceb}};return _0xb55bc6['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x3048f9,'validMsgs':_0xb55bc6,'tableErrors':_0x472ceb}};}catch(_0x33b9bc){return _0x472ceb['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x3d136b}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x33b9bc,'data':{'jsonObj':null,'tableErrors':_0x472ceb}};}}['validateObjectiveGrammar'](_0x33a9e8,_0xbec987,_0x326c5a,_0x1fe121){if(!_0x33a9e8){_0x1fe121['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0xbec987,'column':_0x326c5a,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x409d82,_0x310f03,_0x34175c,_0x22b43d]=_0x33a9e8,_0x402ab5=[];if(!_0x409d82)_0x402ab5['push']('Cognitive\x20Level');if(!_0x310f03)_0x402ab5['push']('Taxonomy\x20Level');if(!_0x34175c)_0x402ab5['push']('Verb');if(!_0x402ab5['length'])return;_0x1fe121['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x402ab5['join'](',\x20')+'.','row':_0xbec987,'column':_0x326c5a,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}['searchRow'](_0x22afe6,_0x2ad35){const _0xe4fd6e=[],[_0x1d52e9,_0x5d097,_0x59c6ff,_0x1fb6c1,_0x3b016c]=_0x22afe6;if(_0x1d52e9===_0x2ad35)_0xe4fd6e['push']({'column':0x0});if(_0x5d097&&(_0x5d097[0x0]===_0x2ad35||_0x5d097[0x1]===_0x2ad35||_0x5d097[0x2]===_0x2ad35||_0x5d097[0x3]===_0x2ad35))_0xe4fd6e['push']({'column':0x1});if(_0x59c6ff&&(_0x59c6ff[0x0]===_0x2ad35||_0x59c6ff[0x1]===_0x2ad35||_0x59c6ff[0x2]===_0x2ad35||_0x59c6ff[0x3]===_0x2ad35))_0xe4fd6e['push']({'column':0x2});if(_0x1fb6c1===_0x2ad35)_0xe4fd6e['push']({'column':0x3});if(_0x3b016c&&(_0x3b016c[0x0]===_0x2ad35||_0x3b016c[0x1]===_0x2ad35))_0xe4fd6e['push']({'column':0x4});return _0xe4fd6e;}}
|
|
61
61
|
|
|
62
|
-
const whitelist=['applying','analyzing','evaluating','creating'];class MinPItaxo extends DTValidator{constructor(){super('MIN_PI_TAXO');}async['validate'](
|
|
62
|
+
const whitelist=['applying','analyzing','evaluating','creating'];class MinPItaxo extends DTValidator{constructor(){super('MIN_PI_TAXO');}async['validate'](_0x208014,_0x711744,_0x4a32c2,_0x34bca4){const _0x340049=[],{success:_0x37814c,data:_0x10b260}=_0x4a32c2['getTable']();if(!_0x37814c){_0x711744['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x4798b1}=_0x10b260;for(let _0x3aa9de=0x0;_0x3aa9de<_0x4798b1['length'];_0x3aa9de++){const _0x5f2bb8=_0x4798b1[_0x3aa9de],_0x20fadc=_0x5f2bb8[0x1]?.['toLowerCase']();if(!_0x20fadc)continue;!whitelist['includes'](_0x20fadc)&&_0x340049['push']({'error':'Cannot\x20have\x20PO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x20fadc['toUpperCase'](),'row':_0x3aa9de,'column':0x1,'from':this['name']});}this['report'](_0x340049,_0x208014,_0x711744);return;}}
|
|
63
63
|
|
|
64
|
-
const minPerfTarget=0x32,minPassScore=0x32;class MinPIPerfTarget extends DTValidator{constructor(){super('MIN_PI_PERF_TARGET');}async['validate'](
|
|
64
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPIPerfTarget extends DTValidator{constructor(){super('MIN_PI_PERF_TARGET');}async['validate'](_0x3c452b,_0x57d61f,_0x3fea62,_0x3ef63e){const _0x370562=[],{success:_0x472224,data:_0x3b306d}=_0x3fea62['getTable']();if(!_0x472224){_0x57d61f['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x1029f2}=_0x3b306d;for(let _0x422301=0x0;_0x422301<_0x1029f2['length'];_0x422301++){const _0x452adc=_0x1029f2[_0x422301],[_0x363999,_0x3095eb]=_0x452adc[0x6];if(!_0x363999)_0x370562['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x422301,'column':0x6,'from':this['name']});else _0x363999<minPerfTarget&&_0x370562['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x422301,'column':0x6,'from':this['name']});if(!_0x3095eb)_0x370562['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x422301,'column':0x6,'from':this['name']});else _0x3095eb<minPassScore&&_0x370562['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x422301,'column':0x6,'from':this['name']});}this['report'](_0x370562,_0x3c452b,_0x57d61f);return;}}
|
|
65
65
|
|
|
66
|
-
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'](
|
|
66
|
+
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'](_0x2518e6){try{const _0x4da1ab=[],_0x4f03b1=_0xa6f4ed['parse'](_0x2518e6,{'skipEmptyLines':![]})['data'];_0x4f03b1['forEach'](_0x325239=>{_0x325239['forEach'](_0x4ea8df=>{_0x4ea8df['includes']('PROGRAM:')&&(this['state']['program']=_0x4ea8df['replace']('PROGRAM:','')['trim']()['toUpperCase']());});});const {headerIdx:_0x42b0ab,poIdx:_0x10e141,tlIdx:_0x40eab3,piIdx:_0x524154,fcIdx:_0x531ba1,scIdx:_0x4e1773,atIdx:_0x121090,ptIdx:_0x471e38}=getPoaepHeader(_0x4f03b1);if(_0x42b0ab===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20check\x20the\x20CSV.');let _0x518001='',_0x17f101='',_0x25ab2b='';for(let _0x5c00f3=_0x42b0ab+0x1;_0x5c00f3<_0x4f03b1['length'];_0x5c00f3++){const _0x5805b9=_0x4f03b1[_0x5c00f3];if(!_0x5805b9)break;if(_0x5c00f3<=_0x42b0ab)continue;let _0xdf8948=_0x5805b9[_0x10e141]?.['trim']()||'';if(_0xdf8948){_0x518001='',_0x17f101='',_0x25ab2b='';const [_0x507f28,_0x4a00e0]=this['extractPoDesc'](_0xdf8948);if(_0x4a00e0)_0xdf8948=_0x4a00e0;}const _0x1bef37=_0x5805b9[_0x40eab3]?.['trim']()['toLowerCase']()||null,_0x35ab72=_0x5805b9[_0x524154]?.['trim']()||'',_0x81de82=_0x5805b9[_0x531ba1]?.['trim']()||'',_0x35ceb3=_0x5805b9[_0x4e1773]?.['trim']()||_0x518001,_0x322590=_0x5805b9[_0x121090]?.['trim']()||_0x17f101,_0x4c45de=_0x5805b9[_0x471e38]?.['trim']()||_0x25ab2b,{performance_target:_0x28dd08,passing_score:_0x565d9a}=performaceTarget(_0x4c45de);if(!_0x81de82)break;const _0x319edf=_0x81de82['split'](',')['map'](_0x567106=>_0x567106['trim']());_0x4da1ab['push']([_0xdf8948,_0x1bef37,_0x35ab72,_0x319edf,_0x35ceb3,_0x322590,[_0x28dd08,_0x565d9a]]),_0x518001=_0x35ceb3,_0x17f101=_0x322590,_0x25ab2b=_0x4c45de;}if(_0x4da1ab['length']===0x0)throw new Error('No\x20data\x20parsed.\x20Please\x20check\x20the\x20CSV.');return {'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':_0x4da1ab};}catch(_0x4640c4){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x4640c4};}}async['toJson'](){const _0x579b30=[],_0x4c5be0=[],_0x427b3b='POAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x50577b={'po':[]};let _0x29e6cf={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x26604c=null,_0x25adf3=null,_0x1c5805=null;for(let _0x2a6172=0x0;_0x2a6172<this['table']['length'];_0x2a6172++){const _0x36f8d0=this['table'][_0x2a6172],_0x5a7ce5=[],_0x355b11=_0x36f8d0[0x0]?.['trim']()||null;_0x355b11&&_0x355b11!==_0x29e6cf['po_desc']&&(_0x29e6cf={'po_desc':_0x355b11,'seq_no':_0x29e6cf['seq_no']+0x1,'PerfIndicators':[]},_0x50577b['po']['push'](_0x29e6cf),_0x26604c=null,_0x25adf3=null,_0x1c5805=null);if(_0x29e6cf['po_desc']==='')_0x4c5be0['push']({'error':'Cannot\x20start\x20with\x20empty\x20Program\x20Outcome.','row':_0x2a6172,'column':0x0,'from':_0x427b3b});const _0x428713=_0x36f8d0[0x1]||null,_0x282637=_0x36f8d0[0x2]||null,_0x32609c=_0x36f8d0[0x3]||null,_0x54c42e=_0x36f8d0[0x4]||_0x26604c,_0x79afc4=_0x36f8d0[0x5]||_0x25adf3,_0x55e046=_0x36f8d0[0x6]||_0x1c5805;(!_0x32609c||_0x32609c['length']===0x0)&&_0x4c5be0['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x2a6172,'column':0x3,'from':_0x427b3b});!_0x55e046&&_0x4c5be0['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x2a6172,'column':0x6,'from':_0x427b3b});if(_0x5a7ce5['length']>0x0){_0x4c5be0['push'](..._0x5a7ce5);continue;}const _0x59f524={'pi_desc':_0x282637,'FormativeCourses':_0x32609c['map'](_0x4a7718=>({'course_id':_0x4a7718,'cognitive_level':null})),'SummativeCourse':{'course_id':_0x54c42e},'TaxonomyLevel':_0x428713?{'label':_0x428713}:null,'AssessmentTool':{'at_desc':_0x79afc4},'PerformanceTargets':{'target_percent':_0x55e046[0x0],'min_score':_0x55e046[0x1]}};_0x29e6cf['PerfIndicators']['push'](_0x59f524);}if(_0x4c5be0['length']>0x0)return _0x4c5be0['push']({'error':'Converted\x20POAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x427b3b}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x50577b,'validMsgs':_0x579b30,'tableErrors':_0x4c5be0}};return _0x579b30['push']('Successfully\x20converted\x20POAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':{'jsonObj':_0x50577b,'validMsgs':_0x579b30,'tableErrors':_0x4c5be0}};}catch(_0x137fbe){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x137fbe};}}async['validateFields'](_0x71e764,_0xa6b993){await this['assertInitialized']()['catch'](_0x3576a7=>{_0xa6b993['push'](_0x3576a7);return;});const _0x4a07fc=[];let _0x36682e=null,_0x32b7df=null,_0xd25967=null,_0x1bda7b=null;for(let _0x391d17=0x0;_0x391d17<this['table']['length'];_0x391d17++){const _0x3e0da4=[],_0xe91767=this['table'][_0x391d17];_0xe91767[0x0]&&_0xe91767[0x0]!==_0x36682e&&(_0x32b7df=null,_0xd25967=null,_0x1bda7b=null);const _0x493574=_0xe91767[0x0]||_0x36682e,_0x277d6b=_0xe91767[0x1]||null,_0x4cc386=_0xe91767[0x2]||null,_0x1b6c21=_0xe91767[0x3]||null,_0x59f198=_0xe91767[0x4]||_0x32b7df,_0x37c6d1=_0xe91767[0x5]||_0xd25967,_0x454ef2=_0xe91767[0x6]||_0x1bda7b;if(!_0x493574)_0x3e0da4['push'](0x0);if(!_0x277d6b)_0x3e0da4['push'](0x1);if(!_0x4cc386)_0x3e0da4['push'](0x2);if(!_0x1b6c21)_0x3e0da4['push'](0x3);if(!_0x59f198)_0x3e0da4['push'](0x4);if(!_0x37c6d1)_0x3e0da4['push'](0x5);if(!_0x454ef2)_0x3e0da4['push'](0x6);_0x3e0da4['length']>0x0&&_0x3e0da4['forEach'](_0x142017=>{_0x4a07fc['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x142017]+'.','row':_0x391d17,'column':_0x142017,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'});}),_0x1b6c21?.['length']===0x0&&_0x4a07fc['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x391d17,'column':0x3,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'}),_0x36682e=_0x493574,_0x32b7df=_0x59f198,_0xd25967=_0x37c6d1,_0x1bda7b=_0x454ef2;}if(_0x4a07fc['length']>0x0)_0xa6b993['push'](..._0x4a07fc);else _0x71e764['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}['extractPoDesc'](_0x31cd24){const _0x4a59b2=/^.*(PO\d+):(.*)$/,_0xa73c19=_0x4a59b2['exec'](_0x31cd24['trim']());return _0xa73c19?_0xa73c19['slice'](0x1):['',_0x31cd24['trim']()];}['searchRow'](_0x523e4a,_0x25ce50){const _0x598beb=[],[_0x5e1bd1,_0x5bb99a,_0xa03468,_0x32e9fc,_0x12e7d6,_0x5d7bc4,_0x5a3bb5]=_0x523e4a;if(_0x5e1bd1===_0x25ce50)_0x598beb['push']({'column':0x0});if(_0x5bb99a===_0x25ce50)_0x598beb['push']({'column':0x1});if(_0xa03468===_0x25ce50)_0x598beb['push']({'column':0x2});if(_0x32e9fc&&_0x32e9fc['includes'](_0x25ce50))_0x598beb['push']({'column':0x3});if(_0x12e7d6===_0x25ce50)_0x598beb['push']({'column':0x4});if(_0x5d7bc4===_0x25ce50)_0x598beb['push']({'column':0x5});if(_0x5a3bb5&&(_0x5a3bb5[0x0]===_0x25ce50||_0x5a3bb5[0x1]===_0x25ce50))_0x598beb['push']({'column':0x6});return _0x598beb;}}
|
|
67
67
|
|
|
68
|
-
class Client{['BASE_URL'];constructor(
|
|
68
|
+
class Client{['BASE_URL'];constructor(_0x10646b){this['BASE_URL']=_0x10646b;}['Parser'](){return {'curriculum':async _0x56c5be=>{const _0x1476d9=await uploadCurriculum(this['BASE_URL'],_0x56c5be);return _0x1476d9;},'courseOffering':async _0x14004a=>{const _0x3fb306=await uploadCourseOffering(this['BASE_URL'],_0x14004a);return _0x3fb306;},'coaep':async(_0x2ea3bc,_0x459982)=>{const _0x21cb54=await uploadCOAEP(this['BASE_URL'],_0x2ea3bc,_0x459982);return _0x21cb54;},'enrolledStudent':async _0x2f1d64=>{const _0x52a273=await uploadEnrolledStudent(this['BASE_URL'],_0x2f1d64);return _0x52a273;},'classlist':async(_0x22aa0a,_0x1e0eca,_0x3547da)=>{const _0x225845=await uploadClassList(this['BASE_URL'],_0x22aa0a,_0x1e0eca,_0x3547da);return _0x225845;},'assessmentData':async _0x30c866=>{const _0x17abf7=await uploadAssessmentData(this['BASE_URL'],_0x30c866);return _0x17abf7;},'deptFaculty':async _0x25625c=>{const _0xbf64d2=await uploadDeptFaculty(this['BASE_URL'],_0x25625c);return _0xbf64d2;},'poaep':async(_0x5dbe2e,_0x5616a9,_0x1a9cef,_0x142477)=>{const _0x46fef2=await uploadPOAEP(this['BASE_URL'],_0x5dbe2e,_0x5616a9,_0x1a9cef,_0x142477);return _0x46fef2;},'CoaepDT':CoaepDT,'PoaepDT':PoaepDT};}}
|
|
69
69
|
|
|
70
70
|
export { Client as default };
|