@obe-loms/coms-parser 1.1.4 → 1.2.1
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 +18 -16
- package/main.d.ts +1 -0
- package/package.json +1 -1
- package/relay/uploadDeptFaculty.d.ts +1 -0
package/bundle.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x25da15 from 'papaparse';
|
|
2
|
+
import * as _0x4c2970 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x3a4a9e){let _0x1e92b1='',_0x492a5b='',_0x4c4712=0x0,_0x4b7dd1=null;const _0x2e0e9b=[];return _0x25da15['parse'](_0x3a4a9e,{'skipEmptyLines':!![],'complete':_0x53c107=>{_0x53c107['data']['forEach'](_0x388220=>{const _0x168400=_0x388220['map'](_0x4db233=>(_0x4db233??'')['toString']()['trim']()),_0x2bf161=_0x168400[0x0]??'';if(_0x2bf161['includes']('Rev#')){const _0x53184e=_0x2bf161['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x53184e&&(_0x1e92b1=_0x53184e[0x1]?.['trim']()??'',_0x492a5b=_0x53184e[0x2]?.['trim']()??'',_0x4c4712=parseInt(_0x53184e[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x2bf161)){_0x4b7dd1=0x1;return;}if(/SECOND YEAR/i['test'](_0x2bf161)){_0x4b7dd1=0x2;return;}if(/THIRD YEAR/i['test'](_0x2bf161)){_0x4b7dd1=0x3;return;}if(/FOURTH YEAR/i['test'](_0x2bf161)){_0x4b7dd1=0x4;return;}if(/FIFTH YEAR/i['test'](_0x2bf161)){_0x4b7dd1=0x5;return;}if(/First Semester/i['test'](_0x2bf161)||/Second Semester/i['test'](_0x2bf161)||/Summer/i['test'](_0x2bf161))return;const _0x541427=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x541427['forEach'](({sem:_0x2fc28f,offset:_0x4b7603})=>{const _0xaba1b9=_0x168400[_0x4b7603]??'',_0x2241f3=_0x168400[_0x4b7603+0x1]??'',_0x1f3999=_0x168400[_0x4b7603+0x2]??'',_0x3eddff=_0x168400[_0x4b7603+0x3]??'',_0x433214=_0x168400[_0x4b7603+0x4]??'';_0xaba1b9&&_0x4b7dd1&&_0x2e0e9b['push']({'curr_id':_0x1e92b1,'program_name':_0x492a5b,'revision_no':_0x4c4712,'year_level':_0x4b7dd1,'sem':_0x2fc28f,'course_id':_0xaba1b9,'course_desc':_0x2241f3,'total_units':_0x1f3999,'lec_unit':_0x3eddff,'lab_unit':_0x433214});});});}}),_0x2e0e9b;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x454338){return new Promise((_0x5a36af,_0x3cd25a)=>{const _0x5c91df=new FileReader();_0x5c91df['onload']=_0x59f059=>{const _0x3d7a50=_0x59f059['target']?.['result'];if(!_0x3d7a50){_0x3cd25a(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x114b07=_0x4c2970['read'](_0x3d7a50,{'type':'array'}),_0x29e66f=_0x114b07['SheetNames'][0x0];if(!_0x29e66f){_0x3cd25a(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x46a63c=_0x114b07['Sheets'][_0x29e66f];if(!_0x46a63c){_0x3cd25a(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x38e822=_0x4c2970['utils']['sheet_to_csv'](_0x46a63c,{'strip':!![]}),_0x1cb6c2=_0x454338['name']['replace'](/\.[^/.]+$/,'.csv'),_0x2d31ba=new File([_0x38e822],_0x1cb6c2,{'type':'text/csv','lastModified':Date['now']()});_0x5a36af(_0x2d31ba);}catch(_0x351b40){_0x3cd25a(_0x351b40);}},_0x5c91df['onerror']=()=>{_0x3cd25a(new Error('File\x20reading\x20failed'));},_0x5c91df['readAsArrayBuffer'](_0x454338);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x5073c3,_0x2b4975){try{const _0x42a42c=await convertToCSVFile(_0x2b4975),_0x125a2b=await _0x42a42c['text'](),_0x5afff6=parseCurriculum(_0x125a2b),_0x5cdcf8=_0x25da15['unparse'](_0x5afff6),_0xe8b053=new File([_0x5cdcf8],_0x42a42c['name'],{'type':'text/csv'}),_0x3df358=new FormData();_0x3df358['append']('csvFile',_0xe8b053);const _0x39463f=await fetch(_0x5073c3+'/curr-courses/upload',{'method':'POST','body':_0x3df358});if(!_0x39463f['ok']){const _0x38c537=await _0x39463f['json']();throw _0x38c537;}return _0x39463f['json']();}catch(_0xa42fcf){throw _0xa42fcf;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x15bd27){let _0x78daf5='',_0x2163d4='';const _0x10ef02=[],_0xe57d40=_0x25da15['parse'](_0x15bd27,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x382135=_0xe57d40['data'];for(let _0x485a18=0x0;_0x485a18<Math['min'](0x5,_0x382135['length']);_0x485a18++){const _0x1393bd=_0x382135[_0x485a18];if(_0x1393bd&&_0x1393bd['length']>0x0){const _0x18bacb=_0x1393bd[0x0]?.['toString']()||'',_0x32401f=_0x18bacb['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x32401f){_0x78daf5=_0x32401f[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x32401f[0x2]){const _0x38a273=_0x32401f[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x38a273&&_0x38a273[0x2]&&_0x38a273[0x4]&&(_0x2163d4=_0x38a273[0x2]+_0x38a273[0x4]);}}}}let _0xd0c446=-1;for(let _0x236079=0x0;_0x236079<_0x382135['length'];_0x236079++){const _0x103fa9=_0x382135[_0x236079];if(_0x103fa9&&_0x103fa9['some'](_0xeaba97=>_0xeaba97?.['toString']()['toUpperCase']()['includes']('CODE'))){_0xd0c446=_0x236079;break;}}if(_0xd0c446===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');for(let _0x18c796=_0xd0c446+0x1;_0x18c796<_0x382135['length'];_0x18c796++){const _0x384d12=_0x382135[_0x18c796];if(!_0x384d12||_0x384d12['length']<0x8)continue;const _0x1fbcd8=_0x384d12[0x0]?.['toString']()['trim']()||'',_0x5bbbd1=_0x384d12[0x1]?.['toString']()['trim']()||'',_0x244d6b=_0x384d12[0x2]?.['toString']()['trim']()||'',_0x483de4=_0x384d12[0x3]?.['toString']()['trim']()||'',_0x4a3bf3=_0x384d12[0x4]?.['toString']()['trim']()||'',_0x127db7=_0x384d12[0x5]?.['toString']()['trim']()||'',_0x1776cc=_0x384d12[0x6]?.['toString']()['trim']()||'',_0x110f07=_0x384d12[0x7]?.['toString']()['trim']()||'';if(!_0x1fbcd8)continue;let _0x3d1e84=0x0;const _0x2a9cdf=_0x483de4['match'](/(\d+)/);_0x2a9cdf&&_0x2a9cdf[0x1]&&(_0x3d1e84=parseInt(_0x2a9cdf[0x1],0xa));const _0x1a5b23={'sem':_0x78daf5,'school_year':_0x2163d4,'code':_0x1fbcd8,'course_no':_0x5bbbd1,'course_desc':_0x244d6b,'unit':_0x3d1e84,'time':_0x4a3bf3,'days':_0x127db7,'faculty':_0x1776cc,'room':_0x110f07};_0x10ef02['push'](_0x1a5b23);}return _0x10ef02;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x2725b0,_0x2538a7){try{const _0x3a9330=await convertToCSVFile(_0x2538a7),_0x3e1c3e=await _0x3a9330['text'](),_0x7c55f0=parseCourseOffering(_0x3e1c3e),_0x2cd89a=_0x25da15['unparse'](_0x7c55f0),_0x24608e=new File([_0x2cd89a],_0x3a9330['name'],{'type':'text/csv'}),_0x49fcc9=new FormData();_0x49fcc9['append']('csvFile',_0x24608e);const _0x4c2489=await fetch(_0x2725b0+'/course-offerings/upload',{'method':'POST','body':_0x49fcc9});if(!_0x4c2489['ok']){const _0x1f038a=await _0x4c2489['json']();throw _0x1f038a;}return _0x4c2489['json']();}catch(_0x3feb33){throw _0x3feb33;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x16da04){if(!_0x16da04)return {'performance_target':null,'passing_score':null};const _0xb9b512=_0x16da04['match'](/\d+/g);return {'performance_target':_0xb9b512?.[0x0]?parseInt(_0xb9b512[0x0],0xa):null,'passing_score':_0xb9b512?.[0x1]?parseInt(_0xb9b512[0x1],0xa):null};}
|
|
15
15
|
|
|
16
|
-
function parseCOAEP(
|
|
16
|
+
function parseCOAEP(_0x337553){const _0x49d8f0=_0x25da15['parse'](_0x337553,{'skipEmptyLines':![]})['data'],_0x22d906={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}};_0x49d8f0['forEach'](_0x51b42c=>{_0x51b42c[0x1]?.['includes']('Name\x20of\x20Faculty:')&&(_0x22d906['COAEP']['faculty']=_0x51b42c[0x2]?.['trim']()||null);if(_0x51b42c['includes']('School\x20Year')){const _0x2f2231=_0x51b42c['indexOf']('School\x20Year');_0x22d906['COAEP']['sy']=_0x51b42c[_0x2f2231+0x1]?.['trim']()||null;}if(_0x51b42c[0x1]?.['includes']('Course:')){const _0x5622cf=_0x51b42c[0x2]?.['trim']()||'';_0x22d906['COAEP']['course']=_0x5622cf||null;}if(_0x51b42c['includes']('Semester')){const _0x535463=_0x51b42c['indexOf']('Semester'),_0x14a642=_0x51b42c[_0x535463+0x1]?.['trim']()||'',_0x4f1c8a=_0x14a642['match'](/\d+/)?.[0x0];_0x22d906['COAEP']['semester']=_0x4f1c8a?parseInt(_0x4f1c8a,0xa):null;}});let _0x4df6c6=null;return _0x49d8f0['forEach'](_0x158e52=>{const _0x10259d=_0x158e52[0x0]?.['trim']()||'',_0x307b2c=_0x158e52[0x1]?.['trim']()||'',_0x425f62=_0x158e52[0x3]?.['trim']()||'';if(_0x10259d&&/^\d+$/['test'](_0x10259d)){_0x4df6c6&&_0x22d906['COAEP']['co']['push'](_0x4df6c6);const _0x38f94f=_0x307b2c,_0x2713c5=_0x38f94f['trim']()['split'](/\s+/)[0x0]??'';_0x4df6c6={'statement':_0x38f94f,'verb':_0x2713c5,'ilo':[]};}if(_0x4df6c6&&_0x425f62){const _0x56b5e1=_0x425f62['replace'](/^ILO\d+\s*/,'')['replace'](/\s+/g,'\x20')['trim'](),_0x22dcb5=_0x158e52[0x4]?.['replace'](/\s+/g,'\x20')['trim']()||'',_0x2d0188=_0x158e52[0x5]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x2055c9,passing_score:_0x239227}=performaceTarget(_0x2d0188);_0x4df6c6['ilo']['push']({'statement':_0x56b5e1,'verb':_0x56b5e1['split'](/\s+/)[0x0]??'','assessment_tool':_0x22dcb5,'performance_target':_0x2055c9,'passing_score':_0x239227});}}),_0x4df6c6&&_0x22d906['COAEP']['co']['push'](_0x4df6c6),_0x22d906;}
|
|
17
17
|
|
|
18
|
-
async function uploadCOAEP(
|
|
18
|
+
async function uploadCOAEP(_0x45f768,_0x23a670,_0x3749b6){try{const _0x3e75f7=await convertToCSVFile(_0x23a670),_0x44bd62=await _0x3e75f7['text'](),_0x40c59a=parseCOAEP(_0x44bd62),_0x33bc15=await fetch(_0x45f768+'/coaeps/upload?course_id='+_0x3749b6,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x40c59a)});if(!_0x33bc15['ok']){const _0x5a850d=await _0x33bc15['json']();throw _0x5a850d;}return _0x33bc15['json']();}catch(_0x4321c4){throw _0x4321c4;}}
|
|
19
19
|
|
|
20
|
-
async function uploadEnrolledStudent(
|
|
20
|
+
async function uploadEnrolledStudent(_0x12bdc8,_0xbc942e){try{const _0x34066e=await convertToCSVFile(_0xbc942e),_0x317db6=new FormData();_0x317db6['append']('csvFile',_0x34066e);const _0x5c1bc7=await fetch(_0x12bdc8+'/enrolled-students/upload',{'method':'POST','body':_0x317db6});if(!_0x5c1bc7['ok']){const _0x3e5a74=await _0x5c1bc7['json']();throw _0x3e5a74;}return _0x5c1bc7['json']();}catch(_0x16346e){throw _0x16346e;}}
|
|
21
21
|
|
|
22
|
-
function parseClassList(
|
|
22
|
+
function parseClassList(_0x8577ce){const _0x5bc8bc=_0x25da15['parse'](_0x8577ce,{'skipEmptyLines':!![]})['data'];let _0x31ea88='',_0x316f9b='',_0xbb14e0='';const _0x4b45f6=[];return _0x5bc8bc['forEach'](_0x15bfd0=>{const _0x124693=_0x15bfd0['map'](_0x1411ae=>(_0x1411ae??'')['toString']()['trim']()),_0x1820d1=_0x124693[0x0]??'';if(_0x1820d1['startsWith']('Course\x20No:')){const _0x296b93=_0x1820d1['replace']('Course\x20No:','')['trim'](),_0x1ac9b9=_0x296b93['split'](/\s+/);_0xbb14e0=_0x1ac9b9[0x0]??'';const [_0x45d44e,_0x1f6a7c]=(_0x1ac9b9[0x1]??'')['split']('-');_0x316f9b=_0x45d44e??'';const _0x290bff=(_0x1f6a7c??'')['match'](/[a-z]$/);_0x31ea88=_0x290bff?_0x290bff[0x0]:'';}if(/^\d+$/['test'](_0x1820d1)){const _0x4d73bc=_0x124693[0x2]??'';_0x4b45f6['push']({'subj_code':_0xbb14e0,'student_no':_0x4d73bc,'course_id':_0x316f9b,'section':_0x31ea88});}}),{'enrolledCourses':_0x4b45f6};}
|
|
23
23
|
|
|
24
|
-
async function uploadClassList(
|
|
24
|
+
async function uploadClassList(_0x201eca,_0x4cb0c2,_0x1c04aa,_0x4741d2){try{const _0x4c5721=await convertToCSVFile(_0x4cb0c2),_0x1b17ce=await _0x4c5721['text'](),_0x94c7ed=parseClassList(_0x1b17ce),_0x11ff14='subj_code='+_0x1c04aa+'&period_id='+_0x4741d2,_0x21631d=await fetch(_0x201eca+'/enrolled-courses/upload?'+_0x11ff14,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x94c7ed)});if(!_0x21631d['ok']){const _0x2f6b39=await _0x21631d['json']();throw _0x2f6b39;}return _0x21631d['json']();}catch(_0x273a8b){throw _0x273a8b;}}
|
|
25
25
|
|
|
26
|
-
function parseAssessmentCsv(
|
|
26
|
+
function parseAssessmentCsv(_0x2b7f49){const {data:_0x58451a}=_0x25da15['parse'](_0x2b7f49,{'skipEmptyLines':!![]}),_0x1d0665=_0x58451a['filter'](_0x33604d=>_0x33604d['length']>0x0),_0x26af03=_0x1d0665['find'](_0x49cdfe=>_0x49cdfe['some'](_0x46a46e=>_0x46a46e?.['includes']('Faculty'))),_0x5b421e=_0x26af03?_0x26af03['findIndex'](_0x132c8e=>_0x132c8e?.['includes']('Faculty')):-1,_0x1d5a01=_0x5b421e!==-1&&_0x26af03?_0x26af03[_0x5b421e+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x227a2d=_0x1d0665['find'](_0x4edad3=>_0x4edad3['some'](_0x489216=>_0x489216?.['includes']('Semester'))),_0x248829=_0x227a2d?_0x227a2d['findIndex'](_0x198956=>_0x198956?.['includes']('Semester')):-1,_0x104010=_0x248829!==-1&&_0x227a2d?_0x227a2d[_0x248829+0x2]?.['trim']()??'':'',_0x373dd8=_0x104010['includes']('1st')?0x1:_0x104010['includes']('2nd')?0x2:0x0,_0x27b15f=_0x1d0665['find'](_0x10d6e5=>_0x10d6e5['some'](_0x14d336=>_0x14d336?.['includes']('Course\x20&\x20Sec'))),_0x57a28f=_0x27b15f?_0x27b15f['findIndex'](_0x2fbc4b=>_0x2fbc4b?.['includes']('Course\x20&\x20Sec')):-1,_0xf41395=_0x57a28f!==-1&&_0x27b15f?_0x27b15f[_0x57a28f+0x2]?.['trim']()??'':'';let _0x1364a7='',_0x137ff8='';if(_0xf41395){const _0x2527f8=_0xf41395['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x2527f8&&(_0x1364a7=_0x2527f8[0x1]??'',_0x2527f8[0x2]&&(_0x137ff8=_0x2527f8[0x2]['replace'](/^OC/i,'')));}const _0x44db84=_0x1d0665['find'](_0x499dbe=>_0x499dbe['some'](_0x187b41=>_0x187b41?.['includes']('School\x20Year'))),_0x346ecb=_0x44db84?_0x44db84['findIndex'](_0x8aadd2=>_0x8aadd2?.['includes']('School\x20Year')):-1,_0x37a914=_0x346ecb!==-1&&_0x44db84?_0x44db84[_0x346ecb+0x2]?.['trim']()??'':'';let _0x328dd0=0x0;if(_0x37a914){const _0xd3cec=_0x37a914['match'](/(\d{4})-(\d{4})/);if(_0xd3cec){const _0x45298d=(_0xd3cec[0x1]??'')['slice'](0x2),_0x248664=(_0xd3cec[0x2]??'')['slice'](0x2);_0x328dd0=parseInt(_0x45298d+_0x248664,0xa);}}const _0x40cb33={'faculty':_0x1d5a01,'course':_0x1364a7,'section':_0x137ff8,'semester':_0x373dd8,'sy':_0x328dd0},_0x260c74=_0x1d0665['findIndex'](_0x4fe3fc=>_0x4fe3fc['some'](_0x26b475=>_0x26b475?.['trim']()==='CO\x20#'));if(_0x260c74===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x4ccb0c=_0x1d0665[_0x260c74+0x1];if(!_0x4ccb0c)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x162bd9={};let _0x10cf75=0x1,_0x10b77f=0x1;for(let _0x1ef106=0x3;_0x1ef106<_0x4ccb0c['length'];_0x1ef106++){const _0x3b0880=_0x4ccb0c[_0x1ef106];if(!_0x3b0880)continue;const _0x593687='co'+_0x10cf75;if(!_0x162bd9[_0x593687])_0x162bd9[_0x593687]=[];_0x162bd9[_0x593687]['push']('ilo'+_0x10b77f),_0x10b77f++,_0x10b77f>0x3&&(_0x10cf75++,_0x10b77f=0x1);}const _0x2d5fd3=_0x1d0665['findIndex'](_0x19115a=>_0x19115a['includes']('Name\x20of\x20Students'));if(_0x2d5fd3===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x4e9a2e=_0x1d0665[_0x2d5fd3];if(!_0x4e9a2e)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x218812=_0x4e9a2e['findIndex'](_0x5ecf0e=>_0x5ecf0e?.['includes']('Name\x20of\x20Students'));if(_0x218812===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x495b4a=_0x218812+0x2,_0x5492c8=[];for(let _0xf633ca=_0x2d5fd3+0x1;_0xf633ca<_0x1d0665['length'];_0xf633ca++){const _0x2068ff=_0x1d0665[_0xf633ca];if(!_0x2068ff)continue;if(_0x2068ff['some'](_0x15831e=>_0x15831e?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x15831e?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x15831e?.['toUpperCase']()['includes']('INACTIVE')||_0x15831e?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x2068ff[_0x218812])continue;const _0x10334f=_0x2068ff[_0x218812]['replace'](/"/g,'')['trim'](),_0x652b0d=_0x2068ff['slice'](_0x495b4a)['map'](_0x211846=>_0x211846===null?null:!isNaN(Number(_0x211846))?parseFloat(_0x211846):0x0);let _0x288f69=0x0;const _0x4e684b={};Object['entries'](_0x162bd9)['forEach'](([_0x1e8362,_0x4c2b7b])=>{const _0x239743={};_0x4c2b7b['forEach'](_0x227df8=>{_0x239743[_0x227df8]=_0x652b0d[_0x288f69]??0x0,_0x288f69++;}),_0x4e684b[_0x1e8362]={'transmuted_score':_0x239743};}),_0x5492c8['push']({'student_name':_0x10334f,'coaep':_0x4e684b});}const _0x51c8da=_0x1d0665['find'](_0x3b5be9=>_0x3b5be9['some'](_0x265017=>_0x265017?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x4ddbd2=_0x1d0665['find'](_0xa338ba=>_0xa338ba['some'](_0xb99aca=>_0xb99aca?.['includes']('AVERAGE'))),_0x1042ed=_0x51c8da?_0x51c8da['slice'](_0x495b4a)['map'](_0x21e5f6=>_0x21e5f6&&!isNaN(Number(_0x21e5f6))?parseInt(_0x21e5f6):0x0):[],_0xda684c=_0x4ddbd2?_0x4ddbd2['slice'](_0x495b4a)['map'](_0xfb78d2=>_0xfb78d2&&_0xfb78d2!=='#DIV/0!'&&!isNaN(Number(_0xfb78d2))?parseInt(_0xfb78d2):0x0):[],_0x321619={};let _0x1f6065=0x0;return Object['entries'](_0x162bd9)['forEach'](([_0x25a4ab,_0x5ca5b3])=>{if(!_0x321619[_0x25a4ab])_0x321619[_0x25a4ab]={};_0x5ca5b3['forEach'](_0xc778=>{_0x321619[_0x25a4ab][_0xc778]={'achievedMinimum':_0x1042ed[_0x1f6065]??0x0,'average':_0xda684c[_0x1f6065]??0x0},_0x1f6065++;});}),{'assessmentData':{'classAssignment':_0x40cb33,'student':_0x5492c8,'total':_0x321619}};}
|
|
27
27
|
|
|
28
|
-
async function uploadAssessmentData(
|
|
28
|
+
async function uploadAssessmentData(_0x124003,_0x6af44a){try{const _0x1b10c2=await convertToCSVFile(_0x6af44a),_0x532aa2=await _0x1b10c2['text'](),_0x2d4f07=parseAssessmentCsv(_0x532aa2),_0x15e3a1=await fetch(_0x124003+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x2d4f07)});if(!_0x15e3a1['ok']){const _0x50204d=await _0x15e3a1['json']();throw _0x50204d;}return _0x15e3a1['json']();}catch(_0x522039){throw _0x522039;}}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
async function uploadDeptFaculty(_0xf36090,_0x14b3d8){try{const _0x83e971=await convertToCSVFile(_0x14b3d8),_0x247f01=new FormData();_0x247f01['append']('csvFile',_0x83e971);const _0x4776d7=await fetch(_0xf36090+'/dept-faculties/upload',{'method':'POST','body':_0x247f01});if(!_0x4776d7['ok']){const _0x4e1643=await _0x4776d7['json']();throw _0x4e1643;}return _0x4776d7['json']();}catch(_0x34751d){throw _0x34751d;}}
|
|
31
|
+
|
|
32
|
+
class Client{['BASE_URL'];constructor(_0x5a8462){this['BASE_URL']=_0x5a8462;}['Parser'](){return {'curriculum':async _0x28a23a=>{const _0x2b701e=await uploadCurriculum(this['BASE_URL'],_0x28a23a);return _0x2b701e;},'courseOffering':async _0x5ae375=>{const _0x50ee05=await uploadCourseOffering(this['BASE_URL'],_0x5ae375);return _0x50ee05;},'coaep':async(_0x4f2264,_0x899915)=>{const _0x35ab2b=await uploadCOAEP(this['BASE_URL'],_0x4f2264,_0x899915);return _0x35ab2b;},'enrolledStudent':async _0x481622=>{const _0x459d0f=await uploadEnrolledStudent(this['BASE_URL'],_0x481622);return _0x459d0f;},'classlist':async(_0x5d5614,_0x20c46f,_0x29d32d)=>{const _0x1e40f8=await uploadClassList(this['BASE_URL'],_0x5d5614,_0x20c46f,_0x29d32d);return _0x1e40f8;},'assessmentData':async _0x53394a=>{const _0x32606d=await uploadAssessmentData(this['BASE_URL'],_0x53394a);return _0x32606d;},'deptFaculty':async _0x58261c=>{const _0x1a53f4=await uploadDeptFaculty(this['BASE_URL'],_0x58261c);return _0x1a53f4;}};}}
|
|
31
33
|
|
|
32
34
|
export { Client as default };
|
package/main.d.ts
CHANGED
|
@@ -18,5 +18,6 @@ export default class Client {
|
|
|
18
18
|
enrolledStudent: (xls: File) => Promise<Record<string, unknown>>;
|
|
19
19
|
classlist: (xls: File, subj_code: number, period_id: number) => Promise<Record<string, unknown>>;
|
|
20
20
|
assessmentData: (xls: File) => Promise<Record<string, unknown>>;
|
|
21
|
+
deptFaculty: (xls: File) => Promise<Record<string, unknown>>;
|
|
21
22
|
};
|
|
22
23
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uploadDeptFaculty(url: string, xls: File): Promise<Record<string, unknown>>;
|