@obe-loms/coms-parser 1.6.6 → 1.6.7
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/bundle.js +30 -30
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x4d95a2 from 'papaparse';
|
|
2
|
+
import * as _0x1db0e1 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x4f80fe){let _0x1a3a1c='',_0x11de12='',_0x2e4036=0x0,_0x45215f=null;const _0x22f074=[];return _0x4d95a2['parse'](_0x4f80fe,{'skipEmptyLines':!![],'complete':_0x359725=>{_0x359725['data']['forEach'](_0x9ad9af=>{const _0x15b47c=_0x9ad9af['map'](_0x167cf2=>(_0x167cf2??'')['toString']()['trim']()),_0x521cfc=_0x15b47c[0x0]??'';if(_0x521cfc['includes']('Rev#')){const _0x25babe=_0x521cfc['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x25babe&&(_0x1a3a1c=_0x25babe[0x1]?.['trim']()??'',_0x11de12=_0x25babe[0x2]?.['trim']()??'',_0x2e4036=parseInt(_0x25babe[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x521cfc)){_0x45215f=0x1;return;}if(/SECOND YEAR/i['test'](_0x521cfc)){_0x45215f=0x2;return;}if(/THIRD YEAR/i['test'](_0x521cfc)){_0x45215f=0x3;return;}if(/FOURTH YEAR/i['test'](_0x521cfc)){_0x45215f=0x4;return;}if(/FIFTH YEAR/i['test'](_0x521cfc)){_0x45215f=0x5;return;}if(/First Semester/i['test'](_0x521cfc)||/Second Semester/i['test'](_0x521cfc)||/Summer/i['test'](_0x521cfc))return;const _0x6b8db3=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x6b8db3['forEach'](({sem:_0x2581bc,offset:_0xf6cea9})=>{const _0x2b9f83=_0x15b47c[_0xf6cea9]??'',_0x442139=_0x15b47c[_0xf6cea9+0x1]??'',_0xa36462=_0x15b47c[_0xf6cea9+0x2]??'',_0x729db9=_0x15b47c[_0xf6cea9+0x3]??'',_0x3233a5=_0x15b47c[_0xf6cea9+0x4]??'';_0x2b9f83&&_0x45215f&&_0x22f074['push']({'curr_id':_0x1a3a1c,'program_name':_0x11de12,'revision_no':_0x2e4036,'year_level':_0x45215f,'sem':_0x2581bc,'course_id':_0x2b9f83,'course_desc':_0x442139,'total_units':_0xa36462,'lec_unit':_0x729db9,'lab_unit':_0x3233a5});});});}}),_0x22f074;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x45a446,_0x7b51a5){return new Promise((_0x107295,_0x283f04)=>{const _0x33f93e=new FileReader();_0x33f93e['onload']=_0x1c03a4=>{const _0x130f6c=_0x1c03a4['target']?.['result'];if(!_0x130f6c){_0x283f04(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x53c089=_0x1db0e1['read'](_0x130f6c,{'type':'array'});!_0x7b51a5&&(_0x7b51a5=_0x53c089['SheetNames'][0x0]);if(!_0x7b51a5){_0x283f04(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x145bb3=_0x53c089['Sheets'][_0x7b51a5];if(!_0x145bb3){_0x283f04(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0xa1139a=_0x1db0e1['utils']['sheet_to_csv'](_0x145bb3,{'strip':!![]}),_0x455bdb=_0x45a446['name']['replace'](/\.[^/.]+$/,'.csv'),_0x1d8efd=new File([_0xa1139a],_0x455bdb,{'type':'text/csv','lastModified':Date['now']()});_0x107295(_0x1d8efd);}catch(_0x2a7fd2){_0x283f04(_0x2a7fd2);}},_0x33f93e['onerror']=()=>{_0x283f04(new Error('File\x20reading\x20failed'));},_0x33f93e['readAsArrayBuffer'](_0x45a446);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x5308e3,_0x1b13a5){try{const _0x4e2614=await convertToCSVFile(_0x1b13a5),_0x3a05fe=await _0x4e2614['text'](),_0x58356b=parseCurriculum(_0x3a05fe),_0x542901=_0x4d95a2['unparse'](_0x58356b),_0x257e4c=new File([_0x542901],_0x4e2614['name'],{'type':'text/csv'}),_0x59e44a=new FormData();_0x59e44a['append']('csvFile',_0x257e4c);const _0x671d9a=await fetch(_0x5308e3+'/curr-courses/upload',{'method':'POST','body':_0x59e44a});if(!_0x671d9a['ok']){const _0x462077=await _0x671d9a['json']();throw _0x462077;}return _0x671d9a['json']();}catch(_0x2af4b5){throw _0x2af4b5;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x2aacc3){let _0x5a53f0='',_0xef242a='';const _0x1a0158=[],_0x3300d3=_0x4d95a2['parse'](_0x2aacc3,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x7ff9e7=_0x3300d3['data'];for(let _0x228057=0x0;_0x228057<Math['min'](0x5,_0x7ff9e7['length']);_0x228057++){const _0x3f0b63=_0x7ff9e7[_0x228057];if(_0x3f0b63&&_0x3f0b63['length']>0x0){const _0x4c4a1d=_0x3f0b63[0x0]?.['toString']()||'',_0x35bf2e=_0x4c4a1d['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x35bf2e){_0x5a53f0=_0x35bf2e[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x35bf2e[0x2]){const _0x428bd8=_0x35bf2e[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x428bd8&&_0x428bd8[0x2]&&_0x428bd8[0x4]&&(_0xef242a=_0x428bd8[0x2]+_0x428bd8[0x4]);}}}}let _0x53df8d=-1;for(let _0x13feef=0x0;_0x13feef<_0x7ff9e7['length'];_0x13feef++){const _0x45d747=_0x7ff9e7[_0x13feef];if(_0x45d747&&_0x45d747['some'](_0x384ac3=>_0x384ac3?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x53df8d=_0x13feef;break;}}if(_0x53df8d===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x4fa4f8={'code':'','description':'','unit':0x0};for(let _0x1f044d=_0x53df8d+0x1;_0x1f044d<_0x7ff9e7['length'];_0x1f044d++){const _0xb7c4b0=_0x7ff9e7[_0x1f044d];if(!_0xb7c4b0||_0xb7c4b0['length']<0x8)continue;const _0x504078=_0xb7c4b0[0x1]?.['toString']()['trim']()||'',_0x18d1a5=_0xb7c4b0[0x4]?.['toString']()['trim']()||'',_0x135754=_0xb7c4b0[0x5]?.['toString']()['trim']()||'',_0x384c40=_0xb7c4b0[0x6]?.['toString']()['trim']()||'',_0x405c31=_0xb7c4b0[0x7]?.['toString']()['trim']()||'',_0x4dd2bc=_0xb7c4b0[0x3]?.['toString']()['trim']()||'';let _0x16d14d=_0xb7c4b0[0x0]?.['toString']()['trim']()||'',_0x4caf16=_0xb7c4b0[0x2]?.['toString']()['trim']()||'';if(!_0x504078)continue;if(!_0x16d14d)_0x16d14d=_0x4fa4f8['code'];if(!_0x4caf16)_0x4caf16=_0x4fa4f8['description'];let _0x6e266=_0x4fa4f8['unit'];if(_0x4dd2bc){const _0x9392f5=_0x4dd2bc['match'](/(\d+)/);_0x9392f5&&_0x9392f5[0x1]&&(_0x6e266=parseInt(_0x9392f5[0x1],0xa));}const _0x19ee75={'sem':_0x5a53f0,'school_year':_0xef242a,'code':_0x16d14d,'course_no':_0x504078,'course_desc':_0x4caf16,'unit':_0x6e266,'time':_0x18d1a5,'days':_0x135754,'faculty':_0x384c40,'room':_0x405c31};_0x4fa4f8['code']=_0x16d14d,_0x4fa4f8['description']=_0x4caf16,_0x4fa4f8['unit']=_0x6e266,_0x1a0158['push'](_0x19ee75);}return _0x1a0158;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x5d976d,_0xe811fb){try{const _0x2a233a=await convertToCSVFile(_0xe811fb),_0x522d27=await _0x2a233a['text'](),_0x50ba81=parseCourseOffering(_0x522d27),_0x4b2a30=_0x4d95a2['unparse'](_0x50ba81),_0x58e08d=new File([_0x4b2a30],_0x2a233a['name'],{'type':'text/csv'}),_0x509fd9=new FormData();_0x509fd9['append']('csvFile',_0x58e08d);const _0x3c6578=await fetch(_0x5d976d+'/course-offerings/upload',{'method':'POST','body':_0x509fd9});if(!_0x3c6578['ok']){const _0x3f3773=await _0x3c6578['json']();throw _0x3f3773;}return _0x3c6578['json']();}catch(_0x487d23){throw _0x487d23;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x5d4455){if(!_0x5d4455)return {'performance_target':null,'passing_score':null};const _0x38230a=_0x5d4455['match'](/\d+/g);return {'performance_target':_0x38230a?.[0x0]?parseInt(_0x38230a[0x0],0xa):null,'passing_score':_0x38230a?.[0x1]?parseInt(_0x38230a[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(_0x5bd09c){let _0x507429={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x3670f7=0x0;_0x3670f7<Math['min'](_0x5bd09c['length'],0x14);_0x3670f7++){const _0x43fe0f=(_0x5bd09c[_0x3670f7]??[])['map'](_0x584302=>_0x584302['toLowerCase']()['trim']()),_0x1a2e88=_0x43fe0f['findIndex'](_0x8aee11=>HEADERS$1['co']['some'](_0x1a789f=>_0x8aee11['includes'](_0x1a789f))),_0x5f25da=_0x43fe0f['findIndex'](_0x365231=>HEADERS$1['ilo']['some'](_0x284d6f=>_0x365231['includes'](_0x284d6f))),_0xe5d43f=_0x43fe0f['findIndex'](_0x48ed6b=>HEADERS$1['assessTool']['some'](_0x47512e=>_0x48ed6b['includes'](_0x47512e))),_0x6f73fc=_0x43fe0f['findIndex'](_0x487eaa=>HEADERS$1['perfTarget']['some'](_0x4fc729=>_0x487eaa['includes'](_0x4fc729))),_0x3a7930=[_0x1a2e88,_0x5f25da,_0xe5d43f,_0x6f73fc]['filter'](_0x435ae8=>_0x435ae8!==-1)['length'];if(_0x3a7930>=0x3){_0x507429={'headerRowIndex':_0x3670f7,'coIdx':_0x1a2e88,'iloIdx':_0x5f25da,'assessToolIdx':_0xe5d43f,'perfTargetIdx':_0x6f73fc};break;}}return _0x507429;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0xeb56b8){const _0x436f46={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0xeb56b8['trim']()},_0x9fde12=_0xeb56b8['match'](/^\((I|E|D)\)/);_0x9fde12&&(_0x436f46['cognitive_level']=_0x9fde12[0x1],_0x436f46['rest']=_0xeb56b8['slice'](_0x9fde12[0x0]['length'])['trim']());const _0x366779=_0x436f46['rest']?.['match'](/^(.*?)\:/);_0x366779&&(_0x436f46['taxonomy_level']=_0x366779[0x1]['trim']()['toLowerCase']()||null,_0x436f46['rest']=_0x436f46['rest']?.['slice'](_0x366779[0x0]['length'])['trim']()||null);const _0x2ae329=_0x436f46['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x2ae329)_0x436f46['verb']=_0x2ae329[0x1]['trim']()['toLowerCase']()||null;else {const _0x2db59e=_0x436f46['rest']?.['match'](/^\w+/);if(_0x2db59e)_0x436f46['verb']=_0x2db59e[0x0]['trim']()['toLowerCase']()||null;}return _0x436f46;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x15fbbf){const _0x545424=_0x4d95a2['parse'](_0x15fbbf,{'skipEmptyLines':![]})['data'],_0x11f8ab={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x2ed156,coIdx:_0x55b58a,iloIdx:_0x1d34bd,assessToolIdx:_0x27b2d6,perfTargetIdx:_0x1b7a4b}=getCoaepHeader(_0x545424);if(_0x2ed156===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x545424['forEach'](_0x1631a2=>{const _0x4bcc23=_0x1631a2['indexOf']('Name\x20of\x20Faculty:'),_0x5d2c47=_0x1631a2['indexOf']('School\x20Year'),_0x6bf2aa=_0x1631a2['indexOf']('Course:'),_0x627b07=_0x1631a2['indexOf']('Semester');_0x4bcc23!==-1&&(_0x11f8ab['COAEP']['faculty']=_0x1631a2[_0x4bcc23+0x1]?.['trim']()||_0x11f8ab['COAEP']['faculty']);_0x5d2c47!==-1&&(_0x11f8ab['COAEP']['sy']=_0x1631a2[_0x5d2c47+0x1]?.['trim']()||_0x11f8ab['COAEP']['sy']);_0x6bf2aa!==-1&&(_0x11f8ab['COAEP']['course']=_0x1631a2[_0x6bf2aa+0x1]?.['trim']()||_0x11f8ab['COAEP']['course']);if(_0x627b07!==-1){const _0xe7989b=_0x1631a2[_0x627b07+0x1]?.['trim']()||'',_0x56deb7=_0xe7989b['match'](/\d+/)?.[0x0];_0x11f8ab['COAEP']['semester']=_0x56deb7?parseInt(_0x56deb7,0xa):_0x11f8ab['COAEP']['semester'];}});let _0x5057f6=null;return _0x545424['forEach']((_0x33e9de,_0x48f5c8)=>{if(_0x48f5c8<=_0x2ed156)return;let _0x3ccd0b=_0x33e9de[_0x55b58a-0x1]?.['trim']()||'',_0x417c47=_0x33e9de[_0x55b58a]?.['trim']()||'';/^\d+$/['test'](_0x33e9de[_0x55b58a]?.['trim']()||'')&&(_0x3ccd0b=_0x33e9de[_0x55b58a]?.['trim']()||'',_0x417c47=_0x33e9de[_0x55b58a+0x1]?.['trim']()||'');const _0xc2390f=_0x33e9de[_0x1d34bd]?.['trim']()||'',_0x164a47=_0x33e9de[_0x27b2d6]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x2b7e2b=_0x33e9de[_0x1b7a4b]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x3ccd0b&&/^\d+$/['test'](_0x3ccd0b)){_0x5057f6&&_0x11f8ab['COAEP']['co']['push'](_0x5057f6);const _0x475711=_0x417c47,{verb:_0x2d842c,cognitive_level:_0x17bccc,taxonomy_level:_0x583067}=extractFromObjective(_0x475711);if(!_0x2d842c)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x3ccd0b+'\x20is\x20in\x20the\x20correct\x20format.'};_0x5057f6={'statement':_0x475711,'ilo':[],'verb':_0x2d842c,'cognitive_level':_0x17bccc,'taxonomy_level':_0x583067};}if(_0x5057f6&&_0xc2390f&&_0x2b7e2b){const _0x103ae3=_0xc2390f['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x103ae3['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x103ae3['length']<0xa)return;let _0x357e76=_0x164a47;if(!_0x357e76&&_0x103ae3['includes'](':')){const _0x34f178=_0x103ae3['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x34f178&&(_0x357e76=_0x34f178[0x1]?.['trim']()||'');}const {performance_target:_0x270b44,passing_score:_0x2b9da8}=performaceTarget(_0x2b7e2b),{verb:_0x48cdd6,cognitive_level:_0x1d138c,taxonomy_level:_0x100681}=extractFromObjective(_0x103ae3);_0x5057f6['ilo']['push']({'statement':_0x103ae3,'assessment_tool':_0x357e76,'performance_target':_0x270b44,'passing_score':_0x2b9da8,'verb':_0x48cdd6,'cognitive_level':_0x1d138c,'taxonomy_level':_0x100681});}}),_0x5057f6&&_0x11f8ab['COAEP']['co']['push'](_0x5057f6),_0x11f8ab;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x154a7d,_0x577ec3,_0x12ef7e){try{const _0x17a772=await convertToCSVFile(_0x577ec3),_0x331518=await _0x17a772['text'](),_0x16db79=parseCOAEP(_0x331518);console['log'](_0x16db79);const _0x316c78=await fetch(_0x154a7d+'/coaeps/upload?course_id='+_0x12ef7e,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x16db79)});if(!_0x316c78['ok']){const _0x4844a1=await _0x316c78['json']();throw _0x4844a1;}return _0x316c78['json']();}catch(_0x3eda42){throw _0x3eda42;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x11d4cf,_0x49c49b){try{const _0x14a0dd=await convertToCSVFile(_0x49c49b),_0x42193e=new FormData();_0x42193e['append']('csvFile',_0x14a0dd);const _0x438c8b=await fetch(_0x11d4cf+'/enrolled-students/upload',{'method':'POST','body':_0x42193e});if(!_0x438c8b['ok']){const _0x2a105d=await _0x438c8b['json']();throw _0x2a105d;}return _0x438c8b['json']();}catch(_0xc06e92){throw _0xc06e92;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x54c3a8){const _0x55eac0=_0x4d95a2['parse'](_0x54c3a8,{'skipEmptyLines':!![]})['data'];let _0x28f5d0='',_0x3ae6cb='',_0x21983b='';const _0x5129e5=[];return _0x55eac0['forEach'](_0x45d8ad=>{const _0x20d500=_0x45d8ad['map'](_0x3294c0=>(_0x3294c0??'')['toString']()['trim']()),_0x3c9e4d=_0x20d500[0x0]??'';if(_0x3c9e4d['startsWith']('Course\x20No:')){const _0x5d2dc4=_0x3c9e4d['replace']('Course\x20No:','')['trim'](),_0x512652=_0x5d2dc4['split'](/\s+/);_0x21983b=_0x512652[0x0]??'';const [_0x2446d7,_0x21ecbb]=(_0x512652[0x1]??'')['split']('-');_0x3ae6cb=_0x2446d7??'';const _0x31ce0d=(_0x21ecbb??'')['match'](/[a-z]$/);_0x28f5d0=_0x31ce0d?_0x31ce0d[0x0]:'';}if(/^\d+$/['test'](_0x3c9e4d)){const _0x498f48=_0x20d500[0x2]??'';_0x5129e5['push']({'subj_code':_0x21983b,'student_no':_0x498f48,'course_id':_0x3ae6cb,'section':_0x28f5d0});}}),{'enrolledCourses':_0x5129e5};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x26114f,_0x58c3d4,_0x314b23,_0x3c0d01){try{const _0x32e10d=await convertToCSVFile(_0x58c3d4),_0x2b1c28=await _0x32e10d['text'](),_0x36b0f=parseClassList(_0x2b1c28),_0x6cb9d8='subj_code='+_0x314b23+'&period_id='+_0x3c0d01,_0x4f2b84=await fetch(_0x26114f+'/enrolled-courses/upload?'+_0x6cb9d8,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x36b0f)});if(!_0x4f2b84['ok']){const _0x517963=await _0x4f2b84['json']();throw _0x517963;}return _0x4f2b84['json']();}catch(_0xe967fd){throw _0xe967fd;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x27d91f){const {data:_0x5e6fed}=_0x4d95a2['parse'](_0x27d91f,{'skipEmptyLines':!![]}),_0x1c3873=_0x5e6fed['filter'](_0x413acd=>_0x413acd['length']>0x0),_0x1b4237=_0x1c3873['find'](_0x379c19=>_0x379c19['some'](_0x1c99dc=>_0x1c99dc?.['includes']('Faculty'))),_0x329b4e=_0x1b4237?_0x1b4237['findIndex'](_0x44e8b0=>_0x44e8b0?.['includes']('Faculty')):-1,_0x5ddba7=_0x329b4e!==-1&&_0x1b4237?_0x1b4237[_0x329b4e+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0xa450e2=_0x1c3873['find'](_0x103ed7=>_0x103ed7['some'](_0x1bc7db=>_0x1bc7db?.['includes']('Semester'))),_0x37cd5a=_0xa450e2?_0xa450e2['findIndex'](_0x44305b=>_0x44305b?.['includes']('Semester')):-1,_0x21bb2a=_0x37cd5a!==-1&&_0xa450e2?_0xa450e2[_0x37cd5a+0x2]?.['trim']()??'':'',_0x51cc66=_0x21bb2a['includes']('1st')?0x1:_0x21bb2a['includes']('2nd')?0x2:0x0,_0xb18389=_0x1c3873['find'](_0xcd0241=>_0xcd0241['some'](_0x127d28=>_0x127d28?.['includes']('Course\x20&\x20Sec'))),_0x5af9b6=_0xb18389?_0xb18389['findIndex'](_0x54bf3c=>_0x54bf3c?.['includes']('Course\x20&\x20Sec')):-1,_0x1bb87e=_0x5af9b6!==-1&&_0xb18389?_0xb18389[_0x5af9b6+0x2]?.['trim']()??'':'';let _0x8d478f='',_0x4d34b1='';if(_0x1bb87e){const _0x4a31f9=_0x1bb87e['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x4a31f9&&(_0x8d478f=_0x4a31f9[0x1]??'',_0x4a31f9[0x2]&&(_0x4d34b1=_0x4a31f9[0x2]['replace'](/^OC/i,'')));}const _0xe5dca3=_0x1c3873['find'](_0x109d1b=>_0x109d1b['some'](_0x3646ea=>_0x3646ea?.['includes']('School\x20Year'))),_0x4a180e=_0xe5dca3?_0xe5dca3['findIndex'](_0xe457ee=>_0xe457ee?.['includes']('School\x20Year')):-1,_0x420531=_0x4a180e!==-1&&_0xe5dca3?_0xe5dca3[_0x4a180e+0x2]?.['trim']()??'':'';let _0x34728e=0x0;if(_0x420531){const _0x48a5e7=_0x420531['match'](/(\d{4})-(\d{4})/);if(_0x48a5e7){const _0x295817=(_0x48a5e7[0x1]??'')['slice'](0x2),_0x46e180=(_0x48a5e7[0x2]??'')['slice'](0x2);_0x34728e=parseInt(_0x295817+_0x46e180,0xa);}}const _0x9c785={'faculty':_0x5ddba7,'course':_0x8d478f,'section':_0x4d34b1,'semester':_0x51cc66,'sy':_0x34728e},_0x495cd2=_0x1c3873['findIndex'](_0x360484=>_0x360484['some'](_0x4372a0=>_0x4372a0?.['trim']()==='CO\x20#'));if(_0x495cd2===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x3dfc17=_0x1c3873[_0x495cd2+0x1];if(!_0x3dfc17)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x33144a={};let _0x28d158=0x1,_0x516dbb=0x1;for(let _0xe71130=0x3;_0xe71130<_0x3dfc17['length'];_0xe71130++){const _0x5a06a9=_0x3dfc17[_0xe71130];if(!_0x5a06a9)continue;const _0xbc4e0e='co'+_0x28d158;if(!_0x33144a[_0xbc4e0e])_0x33144a[_0xbc4e0e]=[];_0x33144a[_0xbc4e0e]['push']('ilo'+_0x516dbb),_0x516dbb++,_0x516dbb>0x3&&(_0x28d158++,_0x516dbb=0x1);}const _0x2e0d00=_0x1c3873['findIndex'](_0x2115a2=>_0x2115a2['includes']('Name\x20of\x20Students'));if(_0x2e0d00===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x45482e=_0x1c3873[_0x2e0d00];if(!_0x45482e)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x261929=_0x45482e['findIndex'](_0x9401bc=>_0x9401bc?.['includes']('Name\x20of\x20Students'));if(_0x261929===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x7effeb=_0x261929+0x2,_0x2cfe8b=[];for(let _0x55bc63=_0x2e0d00+0x1;_0x55bc63<_0x1c3873['length'];_0x55bc63++){const _0x441419=_0x1c3873[_0x55bc63];if(!_0x441419)continue;if(_0x441419['some'](_0x30eddf=>_0x30eddf?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x30eddf?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x30eddf?.['toUpperCase']()['includes']('INACTIVE')||_0x30eddf?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x441419[_0x261929])continue;const _0x265b9b=_0x441419[_0x261929]['replace'](/"/g,'')['trim'](),_0x1de9d4=_0x441419['slice'](_0x7effeb)['map'](_0x21557d=>_0x21557d===null?null:!isNaN(Number(_0x21557d))?parseFloat(_0x21557d):0x0);let _0x4b753f=0x0;const _0x1edfc9={};Object['entries'](_0x33144a)['forEach'](([_0x1e174b,_0x3637da])=>{const _0x234c5f={};_0x3637da['forEach'](_0x5e37dc=>{_0x234c5f[_0x5e37dc]=_0x1de9d4[_0x4b753f]??0x0,_0x4b753f++;}),_0x1edfc9[_0x1e174b]={'transmuted_score':_0x234c5f};}),_0x2cfe8b['push']({'student_name':_0x265b9b,'coaep':_0x1edfc9});}const _0x30a9c2=_0x1c3873['find'](_0x1cc092=>_0x1cc092['some'](_0x37db32=>_0x37db32?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x3bdf87=_0x1c3873['find'](_0x22be6f=>_0x22be6f['some'](_0x1d4986=>_0x1d4986?.['includes']('AVERAGE'))),_0x36cd1d=_0x30a9c2?_0x30a9c2['slice'](_0x7effeb)['map'](_0x4f9e29=>_0x4f9e29&&!isNaN(Number(_0x4f9e29))?parseInt(_0x4f9e29):0x0):[],_0x475690=_0x3bdf87?_0x3bdf87['slice'](_0x7effeb)['map'](_0x1a7f01=>_0x1a7f01&&_0x1a7f01!=='#DIV/0!'&&!isNaN(Number(_0x1a7f01))?parseInt(_0x1a7f01):0x0):[],_0x3af85f={};let _0x558870=0x0;return Object['entries'](_0x33144a)['forEach'](([_0x2ef30b,_0x397901])=>{if(!_0x3af85f[_0x2ef30b])_0x3af85f[_0x2ef30b]={};_0x397901['forEach'](_0x1bc8dc=>{_0x3af85f[_0x2ef30b][_0x1bc8dc]={'achievedMinimum':_0x36cd1d[_0x558870]??0x0,'average':_0x475690[_0x558870]??0x0},_0x558870++;});}),{'assessmentData':{'classAssignment':_0x9c785,'student':_0x2cfe8b,'total':_0x3af85f}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x30348c,_0x3cf11b){try{const _0x97df42=await convertToCSVFile(_0x3cf11b),_0x46b080=await _0x97df42['text'](),_0x4d457b=parseAssessmentCsv(_0x46b080),_0x358b53=await fetch(_0x30348c+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x4d457b)});if(!_0x358b53['ok']){const _0x5ac9e6=await _0x358b53['json']();throw _0x5ac9e6;}return _0x358b53['json']();}catch(_0x34c64f){throw _0x34c64f;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x2df260,_0x54b621){try{const _0x2f0fb4=await convertToCSVFile(_0x54b621),_0x49b880=new FormData();_0x49b880['append']('csvFile',_0x2f0fb4);const _0x51e25b=await fetch(_0x2df260+'/dept-faculties/upload',{'method':'POST','body':_0x49b880});if(!_0x51e25b['ok']){const _0x21ce27=await _0x51e25b['json']();throw _0x21ce27;}return _0x51e25b['json']();}catch(_0x2d54df){throw _0x2d54df;}}
|
|
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(_0x5a5b22){let _0x3364ed={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x38a69a=0x0;_0x38a69a<Math['min'](_0x5a5b22['length'],0x14);_0x38a69a++){const _0x2416e6=(_0x5a5b22[_0x38a69a]??[])['map'](_0x5f18d2=>_0x5f18d2['toLowerCase']()['trim']()),_0x490e38=_0x2416e6['findIndex'](_0x5041e9=>HEADERS['po']['some'](_0x353ce=>_0x5041e9['toLowerCase']()['includes'](_0x353ce))),_0x261b93=_0x2416e6['findIndex'](_0x358bb8=>HEADERS['tl']['some'](_0x295778=>_0x358bb8['toLowerCase']()['includes'](_0x295778))),_0x150159=_0x2416e6['findIndex'](_0x3dcebc=>HEADERS['pi']['some'](_0x59bc15=>_0x3dcebc['toLowerCase']()['includes'](_0x59bc15))),_0xc3ba8c=_0x2416e6['findIndex'](_0x2d9000=>HEADERS['fc']['some'](_0x15deab=>_0x2d9000['toLowerCase']()['includes'](_0x15deab))),_0x3fcc6c=_0x2416e6['findIndex'](_0x18ab2f=>HEADERS['sc']['some'](_0xaec4cb=>_0x18ab2f['toLowerCase']()['includes'](_0xaec4cb))),_0x2e3c40=_0x2416e6['findIndex'](_0x2e1e3f=>HEADERS['at']['some'](_0x4731da=>_0x2e1e3f['toLowerCase']()['includes'](_0x4731da))),_0x2e7970=_0x2416e6['findIndex'](_0x29cb45=>HEADERS['pt']['some'](_0x464cae=>_0x29cb45['toLowerCase']()['includes'](_0x464cae))),_0x5c995e=[_0x490e38,_0x261b93,_0x150159,_0xc3ba8c,_0x3fcc6c,_0x2e3c40,_0x2e7970]['filter'](_0x5137e4=>_0x5137e4!==-1)['length'];if(_0x5c995e>=0x3){_0x3364ed={'headerIdx':_0x38a69a,'poIdx':_0x490e38,'tlIdx':_0x261b93,'piIdx':_0x150159,'fcIdx':_0xc3ba8c,'scIdx':_0x3fcc6c,'atIdx':_0x2e3c40,'ptIdx':_0x2e7970};break;}}if(_0x3364ed['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x3364ed;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x4ccfcd=>{let _0x3bb552=_0x4ccfcd['split'](',')['reduce']((_0x5eaa07,_0x23739c)=>{const _0x3bf52f=_0x23739c['trim']();if(_0x3bf52f)_0x5eaa07['push'](_0x3bf52f);return _0x5eaa07;},[]);return _0x3bb552;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x46c2aa=>{try{const _0x7e08a2=_0x4d95a2['parse'](_0x46c2aa,{'skipEmptyLines':![]})['data'],{headerIdx:_0x4e4ff2,poIdx:_0x3cd8ef,tlIdx:_0x5f5d62,piIdx:_0x1e99e0,fcIdx:_0x480ace,scIdx:_0x8cd3fe,atIdx:_0x5cc40a,ptIdx:_0x5836ec}=getPoaepHeader(_0x7e08a2),_0x37067d=[];let _0x38d7b1={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x4c3d43='',_0x5e1e5f='',_0x3c033b='';for(let _0x31aace=_0x4e4ff2+0x1;_0x31aace<_0x7e08a2['length'];_0x31aace++){const _0x1bcb7f=_0x7e08a2[_0x31aace];if(!_0x1bcb7f)break;const _0x30047f=_0x1bcb7f[_0x3cd8ef]?.['trim']()||'';_0x30047f!==''&&(_0x38d7b1={'po_desc':_0x30047f,'seq_no':_0x38d7b1['seq_no']+0x1,'PerfIndicators':[]},_0x37067d['push'](_0x38d7b1),_0x4c3d43='',_0x5e1e5f='',_0x3c033b='');if(_0x38d7b1['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x31aace+'.');const _0x1ba3c8=_0x1bcb7f[_0x1e99e0]?.['trim']()||'';if(_0x1ba3c8==='')break;const _0x235383=_0x1bcb7f[_0x480ace]?.['trim']()||'';if(_0x235383==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x31aace+'.');const _0x1b3fbb=_0x1bcb7f[_0x8cd3fe]?.['trim']()||_0x4c3d43;if(_0x1b3fbb==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x31aace+'.');_0x4c3d43=_0x1b3fbb;const _0x30aa82=_0x1bcb7f[_0x5cc40a]?.['trim']()||_0x5e1e5f;if(_0x30aa82==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x31aace+'.');_0x5e1e5f=_0x30aa82;const _0x58b2eb=_0x1bcb7f[_0x5836ec]?.['trim']()||_0x3c033b;if(_0x58b2eb==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x31aace+'.');_0x3c033b=_0x58b2eb;const _0x44623c=parseFormativeCourses(_0x235383);if(_0x44623c['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x31aace+'.');const _0x32d4f2=performaceTarget(_0x58b2eb);if(!_0x32d4f2['performance_target']||!_0x32d4f2['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x31aace+'.');const _0x3494e9={'pi_desc':_0x1ba3c8,'FormativeCourses':_0x44623c['map'](_0x1238d4=>({'course_id':_0x1238d4,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x1b3fbb},'AssessmentTool':{'at_desc':_0x30aa82},'PerformanceTargets':{'target_percent':_0x32d4f2['performance_target'],'min_score':_0x32d4f2['passing_score']}};_0x38d7b1['PerfIndicators']['push'](_0x3494e9);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x37067d}};}catch(_0x2526df){return {'success':![],'error':_0x2526df instanceof Error?_0x2526df['message']:_0x2526df,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x36b80e,_0x46e263,_0x3bedc4,_0x223fb9,_0x40455a){try{const _0x2ac473=await convertToCSVFile(_0x46e263),_0xab372b=await _0x2ac473['text'](),_0x52fa5b=parsePOAEP(_0xab372b),_0x3e0694=await fetch(_0x36b80e+'/program-outcomes/poaep/upload?curr_id='+_0x223fb9+'&period_id='+_0x40455a,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3bedc4},'credentials':'include','body':JSON['stringify'](_0x52fa5b)});if(!_0x3e0694['ok']){const _0x552d58=await _0x3e0694['json']();throw _0x552d58;}return _0x3e0694['json']();}catch(_0x4b4efb){throw _0x4b4efb;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];constructor(_0x579bba='DataTable',_0x4c6315){this['name']=_0x579bba,this['headers']=_0x4c6315,this['table']=[],this['validators']=[];}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['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']}};}async['setTable'](_0x3fe65a){await this['assertInitialized']();}async['initializeTable'](_0x2ede97,_0x15ac2a){try{let _0x5eb6e0;if(_0x2ede97 instanceof File)_0x5eb6e0=await this['fromXML'](_0x2ede97,_0x15ac2a);else _0x5eb6e0=await this['fromCSVString'](_0x2ede97);if(!_0x5eb6e0['success']||!_0x5eb6e0['data'])return _0x5eb6e0;if(_0x5eb6e0['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x5eb6e0['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x4411ec){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x4411ec};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x4024c3,_0x19d3b1){const _0x38611d=await convertToCSVFile(_0x4024c3,_0x19d3b1),_0x2e903f=await _0x38611d['text']();return this['fromCSVString'](_0x2e903f);}async['findValue'](_0x4db44c){let [_0x4c341a,_0x59012a]=[-1,-1];if(!_0x4db44c)return {'row':_0x4c341a,'column':_0x59012a};for(let _0x380a79=0x0;_0x380a79<this['table']['length'];_0x380a79++){const _0x586183=this['table'][_0x380a79];for(let _0x5021d1=0x0;_0x5021d1<_0x586183['length'];_0x5021d1++){if(typeof _0x4db44c==='string'){if(_0x586183[_0x5021d1]===_0x4db44c)return {'row':_0x380a79,'column':_0x5021d1};}else {if(_0x586183[_0x5021d1]){if(_0x586183[_0x5021d1]===_0x4db44c)return {'row':_0x380a79,'column':_0x5021d1};}}}}return {'row':_0x4c341a,'column':_0x59012a};}async['validate'](){const _0x2fbac5=[],_0x177783=[];try{await this['assertInitialized']()['then'](()=>{_0x2fbac5['push']('Table\x20is\x20initialized.');})['catch'](_0x2d9562=>_0x177783['push'](_0x2d9562));if(_0x177783['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x2fbac5,_0x177783);const {success:_0x41fe48,message:_0x3fb246,error:_0x582aeb,data:_0x457ad9}=await this['toJson']();if(!_0x457ad9)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x2fbac5['push'](..._0x457ad9['validMsgs']),_0x177783['push'](..._0x457ad9['tableErrors']);const {jsonObj:_0x37ad60}=_0x457ad9;for(const _0xc99175 of this['validators']){await _0xc99175['validate'](_0x2fbac5,_0x177783,this,_0x37ad60);}let _0x32d1f7=this['name']+'\x20ran\x20its\x20validations.';if(_0x2fbac5['length']>0x0)_0x32d1f7+='\x20'+_0x2fbac5['length']+'\x20validations\x20were\x20successful.';if(_0x177783['length']>0x0)_0x32d1f7+='\x20'+_0x177783['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x32d1f7,'data':{'validMsgs':_0x2fbac5,'tableErrors':_0x177783}};}catch(_0x98d3c3){return _0x177783['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x98d3c3}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x2fbac5,'tableErrors':_0x177783}};}}['useValidator'](_0x1e93b3){this['validators']['push'](_0x1e93b3);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x181c45){this['name']=_0x181c45;}['getName'](){return this['name'];}['report'](_0x494396,_0x40278c,_0x103e47){if(_0x494396['length']>0x0)_0x103e47['push'](..._0x494396);else _0x40278c['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'](_0x22c6d2,_0x4da861,_0x55717e,_0x42d5b5){const _0x58e7c9=[];if(!_0x42d5b5){_0x4da861['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x4dec0f=0x0;_0x4dec0f<_0x42d5b5['co']['length'];_0x4dec0f++){const _0x4a3dc1=_0x42d5b5['co'][_0x4dec0f];if(!_0x4a3dc1){const {row:_0x17377f,column:_0x174c94}=await _0x55717e['findValue'](_0x4dec0f+0x1+'');_0x58e7c9['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x4dec0f+0x1)+'.','row':_0x17377f,'column':_0x174c94+0x1,'from':this['name']});continue;}if(!_0x4a3dc1?.['ilo']){const {row:_0x356f73,column:_0xea1e75}=await _0x55717e['findValue'](_0x4a3dc1['statement']);_0x58e7c9['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x4dec0f+0x1)+'.','row':_0x356f73,'column':_0xea1e75,'from':this['name']});continue;}const _0x310b9a=_0x4a3dc1['ilo']['length']-0x1,_0x409e0f=_0x4a3dc1['ilo'][_0x310b9a];if(!_0x409e0f['taxonomy_level']){const {row:_0x599857,column:_0x81b452}=await _0x55717e['findValue'](_0x409e0f['statement']);_0x58e7c9['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x4dec0f+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x599857,'column':_0x81b452,'from':this['name']});continue;}if(_0x409e0f['taxonomy_level']!==_0x4a3dc1['taxonomy_level']){const {row:_0x3cbb93,column:_0x242a40}=await _0x55717e['findValue'](_0x409e0f['statement']);_0x58e7c9['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x4dec0f+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x409e0f['taxonomy_level']+'\x20!==\x20'+_0x4a3dc1['taxonomy_level']+')','row':_0x3cbb93,'column':_0x242a40,'from':this['name']});}}this['report'](_0x58e7c9,_0x22c6d2,_0x4da861);}}
|
|
49
49
|
|
|
50
|
-
const whitelist=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](
|
|
50
|
+
const whitelist=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](_0x5d8f3b,_0x265c1a,_0x4a1673,_0x5029f2){const _0x17805d=[];if(!_0x5029f2){_0x265c1a['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x3d4ec1=0x0;_0x3d4ec1<_0x5029f2['co']['length'];_0x3d4ec1++){const _0x55fdb2=_0x5029f2['co'][_0x3d4ec1];if(!_0x55fdb2['taxonomy_level']){_0x17805d['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x3d4ec1+0x1),'from':this['name']});continue;}if(!whitelist['includes'](_0x55fdb2['taxonomy_level'])){const {row:_0x2aeb52,column:_0xd01912}=await _0x4a1673['findValue'](_0x55fdb2['statement']);let _0x34b7c8={'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x55fdb2['taxonomy_level']['toUpperCase'](),'from':this['name']};(_0x2aeb52!==-1||_0xd01912!==-1)&&(_0x34b7c8['row']=_0x2aeb52,_0x34b7c8['column']=_0xd01912),_0x17805d['push'](_0x34b7c8);}}this['report'](_0x17805d,_0x5d8f3b,_0x265c1a);return;}}
|
|
51
51
|
|
|
52
|
-
const taxoOrder={'remembering':0x1,'understanding':0x2,'applying':0x3,'analyzing':0x4,'evaluating':0x5,'creating':0x6};class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](
|
|
52
|
+
const taxoOrder={'remembering':0x1,'understanding':0x2,'applying':0x3,'analyzing':0x4,'evaluating':0x5,'creating':0x6};class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](_0x2aa0d6,_0x585f4f,_0x5c2327,_0x3c31d3){const _0x17e64a=[];if(!_0x3c31d3){_0x585f4f['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x47d4ec=0x0;_0x47d4ec<_0x3c31d3['co']['length'];_0x47d4ec++){const _0x341cc0=_0x3c31d3['co'][_0x47d4ec];if(!_0x341cc0){const {row:_0x5a475d,column:_0x5dca8f}=await _0x5c2327['findValue'](_0x47d4ec+0x1+'');_0x17e64a['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x47d4ec+0x1)+'.','row':_0x5a475d,'column':_0x5dca8f+0x1,'from':this['name']});continue;}if(!_0x341cc0?.['ilo']){const {row:_0x4489e5,column:_0x319b25}=await _0x5c2327['findValue'](_0x341cc0['statement']);_0x17e64a['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x47d4ec+0x1)+'.','row':_0x4489e5,'column':_0x319b25,'from':this['name']});continue;}const _0x2ccdd9=await _0x5c2327['findValue'](_0x341cc0['ilo'][0x0]['statement']),_0x3cbfb0=_0x341cc0['ilo']['map'](_0x10581f=>taxoOrder[_0x10581f['taxonomy_level']]);let _0x2ad57e=_0x3cbfb0[0x0];for(let _0xfe3bdb=0x1;_0xfe3bdb<_0x3cbfb0['length'];_0xfe3bdb++){if(_0x3cbfb0[_0xfe3bdb]<_0x2ad57e){_0x17e64a['push']({'error':'Under\x20CO\x20'+(_0x47d4ec+0x1)+',\x20ILO\x20'+(_0xfe3bdb+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0xfe3bdb+'\x27s.','row':_0x2ccdd9['row'],'column':_0x2ccdd9['column']+_0xfe3bdb,'from':this['name']});continue;}_0x2ad57e=_0x3cbfb0[_0xfe3bdb];}}this['report'](_0x17e64a,_0x2aa0d6,_0x585f4f);}}
|
|
53
53
|
|
|
54
|
-
const minPerfTarget=0x32,minPassScore=0x32;class MinPerfTarget extends DTValidator{constructor(){super('MIN_PERF_TARGET');}async['validate'](
|
|
54
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPerfTarget extends DTValidator{constructor(){super('MIN_PERF_TARGET');}async['validate'](_0x4febd4,_0x33de7f,_0x5057d2,_0xc85a7a){const {success:_0x2f2069,data:_0xd729c7}=_0x5057d2['getTable'](),_0x4a75fb=[];if(!_0x2f2069){_0x4a75fb['push']({'error':'Failed\x20to\x20access\x20table\x20data.','from':this['name']});return;}const {table:_0xbba7bb}=_0xd729c7;for(let _0x1560ab=0x0;_0x1560ab<_0xbba7bb['length'];_0x1560ab++){const _0x22487d=_0xbba7bb[_0x1560ab],[_0x22a159,_0x38b7e6]=_0x22487d[0x4];if(!_0x22a159)_0x4a75fb['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x1560ab,'column':0x4,'from':this['name']});else _0x22a159<minPerfTarget&&_0x4a75fb['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x1560ab,'column':0x4,'from':this['name']});if(!_0x38b7e6)_0x4a75fb['push']({'error':'Pass\x20score\x20is\x20required.','row':_0x1560ab,'column':0x6,'from':this['name']});else _0x38b7e6<minPassScore&&_0x4a75fb['push']({'error':'Pass\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x1560ab,'column':0x6,'from':this['name']});}this['report'](_0x4a75fb,_0x4febd4,_0x33de7f);}}
|
|
55
55
|
|
|
56
|
-
class CoaepDT extends DataTable{['faculty']=null;['course']=null;['sy']=null;['semester']=null;constructor(){super('CoaepDT',['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target']),this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](
|
|
56
|
+
class CoaepDT extends DataTable{['faculty']=null;['course']=null;['sy']=null;['semester']=null;constructor(){super('CoaepDT',['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target']),this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](_0x17ab0f,_0x550109){const _0x4524e7=[];let _0x1605b=null,_0x4941f7=null;for(let _0x32d244=0x0;_0x32d244<this['table']['length'];_0x32d244++){const _0x16821d=[],_0x1dcf9f=this['table'][_0x32d244],_0x2fa292=_0x1dcf9f[0x0]||_0x1605b,_0x22c235=_0x1dcf9f[0x1]||_0x4941f7,_0x38ad0a=_0x1dcf9f[0x2],_0x5ef0a8=_0x1dcf9f[0x3],_0x3ea444=_0x1dcf9f[0x4];if(!_0x2fa292)_0x16821d['push'](0x0);if(!_0x4941f7)_0x16821d['push'](0x1);if(!_0x38ad0a)_0x16821d['push'](0x2);if(!_0x5ef0a8)_0x16821d['push'](0x3);if(!_0x3ea444)_0x16821d['push'](0x4);if(_0x4941f7!==_0x22c235)this['validateObjectiveGrammar'](_0x22c235,_0x32d244,0x1,_0x550109);_0x1605b=_0x2fa292,_0x4941f7=_0x22c235;for(const _0x20ce9f of _0x16821d){_0x4524e7['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x20ce9f],'row':_0x32d244,'column':_0x20ce9f});}if(_0x38ad0a)this['validateObjectiveGrammar'](_0x38ad0a,_0x32d244,0x2,_0x550109);}if(_0x4524e7['length']>0x0)_0x550109['push'](..._0x4524e7);else _0x17ab0f['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x225555){try{const _0x4a8206=[],_0x5212d1=_0x4d95a2['parse'](_0x225555,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x5ccc04,coIdx:_0x26ecf4,iloIdx:_0x24d8ca,assessToolIdx:_0x457392,perfTargetIdx:_0x92fbfe}=getCoaepHeader(_0x5212d1);if(_0x5ccc04===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x5212d1['forEach'](_0x18229b=>{const _0x298489=_0x18229b['indexOf']('Name\x20of\x20Faculty:'),_0x5f0a3c=_0x18229b['indexOf']('School\x20Year'),_0x43672c=_0x18229b['indexOf']('Course:'),_0x4c9336=_0x18229b['indexOf']('Semester');_0x298489!==-0x1&&(this['faculty']=_0x18229b[_0x298489+0x1]?.['trim']()||this['faculty']);_0x5f0a3c!==-0x1&&(this['sy']=_0x18229b[_0x5f0a3c+0x1]?.['trim']()||this['sy']);_0x43672c!==-0x1&&(this['course']=_0x18229b[_0x43672c+0x1]?.['trim']()||this['course']);if(_0x4c9336!==-0x1){const _0x1c6f4e=_0x18229b[_0x4c9336+0x1]?.['trim']()||'',_0x4a2d79=_0x1c6f4e['match'](/\d+/)?.[0x0];this['semester']=_0x4a2d79?parseInt(_0x4a2d79,0xa):this['semester'];}});for(let _0xb7ee65=0x0;_0xb7ee65<=_0x5212d1['length'];_0xb7ee65++){const _0x2b2c52=_0x5212d1[_0xb7ee65];if(!_0x2b2c52)break;if(_0xb7ee65<=_0x5ccc04)continue;if(!_0x2b2c52[_0x24d8ca])break;let _0x3209bd=_0x2b2c52[_0x26ecf4-0x1]?.['trim']()||'',_0x4d3fa2=_0x2b2c52[_0x26ecf4]?.['trim']()||'',_0x5bc890=_0x2b2c52[_0x24d8ca]?.['trim']()||'';/^\d+$/['test'](_0x2b2c52[_0x26ecf4]?.['trim']()||'')&&(_0x3209bd=_0x2b2c52[_0x26ecf4]?.['trim']()||'',_0x4d3fa2=_0x2b2c52[_0x26ecf4+0x1]?.['trim']()||'');let _0x30bd86=null;if(_0x4d3fa2){const {cognitive_level:_0x5108e5,taxonomy_level:_0x45b8b2,verb:_0xfa26b7,rest:_0x423b6d}=extractFromObjective(_0x4d3fa2);_0x30bd86=[_0x5108e5,_0x45b8b2,_0xfa26b7,_0x423b6d];}let _0x5ea4a3;{const {cognitive_level:_0xe3a400,taxonomy_level:_0x3ac190,verb:_0x562534,rest:_0x59d4f7}=extractFromObjective(_0x5bc890);_0x5ea4a3=[_0xe3a400,_0x3ac190,_0x562534,_0x59d4f7];}const _0x1a1b89=_0x2b2c52[_0x92fbfe]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x18ea01,passing_score:_0x26a48e}=performaceTarget(_0x1a1b89);_0x4a8206['push']([_0x3209bd,_0x30bd86,_0x5ea4a3,_0x2b2c52[_0x457392]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x18ea01,_0x26a48e]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x4a8206};}catch(_0x154c93){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x154c93};}}async['toJson'](){const _0x45dcbd=[],_0x25fff3=[],_0x3c0d09='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x141dbf={'faculty':this['faculty'],'course':this['course'],'sy':this['sy'],'semester':this['semester'],'co':[]};let _0x7cfbdb=null,_0x1f888b='',_0xae0b1=[null,null];this['table']['forEach']((_0x50c59c,_0x451ead)=>{if(_0x451ead===0x0&&!_0x50c59c[0x1])_0x25fff3['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x3c0d09});_0x50c59c[0x1]&&(_0x1f888b='',_0xae0b1=[null,null]);const _0xe30415=_0x50c59c[0x1],_0x2e38bf=_0x50c59c[0x2],_0x325368=_0x50c59c[0x3]||_0x1f888b,_0x345a19=_0x50c59c[0x4]||_0xae0b1;if(!_0x2e38bf)_0x25fff3['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x3c0d09});if(!_0x325368)_0x25fff3['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x451ead,'column':0x3,'from':_0x3c0d09});if(!_0x345a19)_0x25fff3['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x451ead,'column':0x4,'from':_0x3c0d09});if(_0xe30415){const [_0x4ad6f2,_0x493b6c,_0x56d6d6,_0x275198]=_0xe30415,_0x572b72={'statement':_0x275198,'ilo':[],'taxonomy_level':_0x493b6c,'cognitive_level':_0x4ad6f2,'verb':_0x56d6d6};_0x7cfbdb=_0x572b72,_0x141dbf['co']['push'](_0x572b72);}const [_0x3cdc74,_0x5cd7a8,_0x40ba80,_0x2c97af]=_0x2e38bf,[_0x24e66f,_0x3df29a]=_0x345a19,_0xe92a33={'statement':_0x2c97af,'assessment_tool':_0x325368,'performance_target':_0x24e66f,'passing_score':_0x3df29a,'cognitive_level':_0x3cdc74,'taxonomy_level':_0x5cd7a8,'verb':_0x40ba80};_0x7cfbdb['ilo']['push'](_0xe92a33);});if(_0x25fff3['length'])return _0x25fff3['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x3c0d09}),{'success':![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x141dbf,'validMsgs':_0x45dcbd,'tableErrors':_0x25fff3}};return _0x45dcbd['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x141dbf,'validMsgs':_0x45dcbd,'tableErrors':_0x25fff3}};}catch(_0x2fa73f){return _0x25fff3['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x3c0d09}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x2fa73f,'data':{'jsonObj':null,'tableErrors':_0x25fff3}};}}['validateObjectiveGrammar'](_0x53ad79,_0x5855fe,_0x71dae7,_0x3dad10){if(!_0x53ad79){_0x3dad10['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x5855fe,'column':_0x71dae7,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x5d27d2,_0x38adae,_0x2d3e0f,_0x51a4b1]=_0x53ad79,_0x35472c=[];if(!_0x5d27d2)_0x35472c['push']('cognitive_level');if(!_0x38adae)_0x35472c['push']('taxonomy_level');if(!_0x2d3e0f)_0x35472c['push']('verb');if(!_0x35472c['length'])return;_0x3dad10['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x35472c['join'](',\x20')+'.','row':_0x5855fe,'column':_0x71dae7,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}}
|
|
57
57
|
|
|
58
|
-
class Client{['BASE_URL'];constructor(
|
|
58
|
+
class Client{['BASE_URL'];constructor(_0x5b2ab2){this['BASE_URL']=_0x5b2ab2;}['Parser'](){return {'curriculum':async _0x13a3db=>{const _0x5585f1=await uploadCurriculum(this['BASE_URL'],_0x13a3db);return _0x5585f1;},'courseOffering':async _0x5b5801=>{const _0xa0266a=await uploadCourseOffering(this['BASE_URL'],_0x5b5801);return _0xa0266a;},'coaep':async(_0x5bb922,_0xa23719)=>{const _0x475577=await uploadCOAEP(this['BASE_URL'],_0x5bb922,_0xa23719);return _0x475577;},'enrolledStudent':async _0xdeb18a=>{const _0x300c9c=await uploadEnrolledStudent(this['BASE_URL'],_0xdeb18a);return _0x300c9c;},'classlist':async(_0x321a65,_0x58a73d,_0x5b3206)=>{const _0x4116e9=await uploadClassList(this['BASE_URL'],_0x321a65,_0x58a73d,_0x5b3206);return _0x4116e9;},'assessmentData':async _0x9c585e=>{const _0x1e629a=await uploadAssessmentData(this['BASE_URL'],_0x9c585e);return _0x1e629a;},'deptFaculty':async _0x5a5fad=>{const _0x2c7f7f=await uploadDeptFaculty(this['BASE_URL'],_0x5a5fad);return _0x2c7f7f;},'poaep':async(_0x18cede,_0x422ef6,_0x5ad601,_0x540195)=>{const _0x247a32=await uploadPOAEP(this['BASE_URL'],_0x18cede,_0x422ef6,_0x5ad601,_0x540195);return _0x247a32;},'CoaepDT':CoaepDT};}}
|
|
59
59
|
|
|
60
60
|
export { Client as default };
|