@obe-loms/coms-parser 1.2.4 → 1.2.6
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 -18
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x224f08 from 'papaparse';
|
|
2
|
+
import * as _0x227779 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x1dd36f){let _0x4807fe='',_0x1b5984='',_0x5b90a2=0x0,_0x20f4e9=null;const _0x3e6b44=[];return _0x224f08['parse'](_0x1dd36f,{'skipEmptyLines':!![],'complete':_0x22f693=>{_0x22f693['data']['forEach'](_0xdbc57d=>{const _0x2c37d9=_0xdbc57d['map'](_0x51937b=>(_0x51937b??'')['toString']()['trim']()),_0x191349=_0x2c37d9[0x0]??'';if(_0x191349['includes']('Rev#')){const _0x4c0743=_0x191349['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x4c0743&&(_0x4807fe=_0x4c0743[0x1]?.['trim']()??'',_0x1b5984=_0x4c0743[0x2]?.['trim']()??'',_0x5b90a2=parseInt(_0x4c0743[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x191349)){_0x20f4e9=0x1;return;}if(/SECOND YEAR/i['test'](_0x191349)){_0x20f4e9=0x2;return;}if(/THIRD YEAR/i['test'](_0x191349)){_0x20f4e9=0x3;return;}if(/FOURTH YEAR/i['test'](_0x191349)){_0x20f4e9=0x4;return;}if(/FIFTH YEAR/i['test'](_0x191349)){_0x20f4e9=0x5;return;}if(/First Semester/i['test'](_0x191349)||/Second Semester/i['test'](_0x191349)||/Summer/i['test'](_0x191349))return;const _0x49b17d=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x49b17d['forEach'](({sem:_0x1002f0,offset:_0x173021})=>{const _0x55736=_0x2c37d9[_0x173021]??'',_0x5d44e2=_0x2c37d9[_0x173021+0x1]??'',_0x34bf06=_0x2c37d9[_0x173021+0x2]??'',_0x23e49b=_0x2c37d9[_0x173021+0x3]??'',_0x4e3160=_0x2c37d9[_0x173021+0x4]??'';_0x55736&&_0x20f4e9&&_0x3e6b44['push']({'curr_id':_0x4807fe,'program_name':_0x1b5984,'revision_no':_0x5b90a2,'year_level':_0x20f4e9,'sem':_0x1002f0,'course_id':_0x55736,'course_desc':_0x5d44e2,'total_units':_0x34bf06,'lec_unit':_0x23e49b,'lab_unit':_0x4e3160});});});}}),_0x3e6b44;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x4429af){return new Promise((_0x2cff48,_0x366875)=>{const _0x221737=new FileReader();_0x221737['onload']=_0x233925=>{const _0x4a40c8=_0x233925['target']?.['result'];if(!_0x4a40c8){_0x366875(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x454700=_0x227779['read'](_0x4a40c8,{'type':'array'}),_0x24fcbe=_0x454700['SheetNames'][0x0];if(!_0x24fcbe){_0x366875(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x563b3b=_0x454700['Sheets'][_0x24fcbe];if(!_0x563b3b){_0x366875(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x3f913e=_0x227779['utils']['sheet_to_csv'](_0x563b3b,{'strip':!![]}),_0x2dcefe=_0x4429af['name']['replace'](/\.[^/.]+$/,'.csv'),_0x3517b4=new File([_0x3f913e],_0x2dcefe,{'type':'text/csv','lastModified':Date['now']()});_0x2cff48(_0x3517b4);}catch(_0x1577c4){_0x366875(_0x1577c4);}},_0x221737['onerror']=()=>{_0x366875(new Error('File\x20reading\x20failed'));},_0x221737['readAsArrayBuffer'](_0x4429af);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x46c4b9,_0x16d21c){try{const _0x5a6d67=await convertToCSVFile(_0x16d21c),_0x5a1c16=await _0x5a6d67['text'](),_0x567148=parseCurriculum(_0x5a1c16),_0x5efefd=_0x224f08['unparse'](_0x567148),_0xb5da79=new File([_0x5efefd],_0x5a6d67['name'],{'type':'text/csv'}),_0x4f3cb2=new FormData();_0x4f3cb2['append']('csvFile',_0xb5da79);const _0x395053=await fetch(_0x46c4b9+'/curr-courses/upload',{'method':'POST','body':_0x4f3cb2});if(!_0x395053['ok']){const _0x500ed0=await _0x395053['json']();throw _0x500ed0;}return _0x395053['json']();}catch(_0x3e853a){throw _0x3e853a;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x35e0b8){let _0x1a8670='',_0x195816='';const _0x2dc5f0=[],_0x4f914b=_0x224f08['parse'](_0x35e0b8,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x35b73d=_0x4f914b['data'];for(let _0x127917=0x0;_0x127917<Math['min'](0x5,_0x35b73d['length']);_0x127917++){const _0x3da851=_0x35b73d[_0x127917];if(_0x3da851&&_0x3da851['length']>0x0){const _0x36c25f=_0x3da851[0x0]?.['toString']()||'',_0xf342e3=_0x36c25f['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0xf342e3){_0x1a8670=_0xf342e3[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0xf342e3[0x2]){const _0x3d356a=_0xf342e3[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x3d356a&&_0x3d356a[0x2]&&_0x3d356a[0x4]&&(_0x195816=_0x3d356a[0x2]+_0x3d356a[0x4]);}}}}let _0x5612c1=-1;for(let _0x3ca520=0x0;_0x3ca520<_0x35b73d['length'];_0x3ca520++){const _0x3e67f6=_0x35b73d[_0x3ca520];if(_0x3e67f6&&_0x3e67f6['some'](_0x36c906=>_0x36c906?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x5612c1=_0x3ca520;break;}}if(_0x5612c1===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');for(let _0x3ee57b=_0x5612c1+0x1;_0x3ee57b<_0x35b73d['length'];_0x3ee57b++){const _0x3f0f27=_0x35b73d[_0x3ee57b];if(!_0x3f0f27||_0x3f0f27['length']<0x8)continue;const _0x411a20=_0x3f0f27[0x0]?.['toString']()['trim']()||'',_0x304704=_0x3f0f27[0x1]?.['toString']()['trim']()||'',_0x25c264=_0x3f0f27[0x2]?.['toString']()['trim']()||'',_0x212791=_0x3f0f27[0x3]?.['toString']()['trim']()||'',_0x226d56=_0x3f0f27[0x4]?.['toString']()['trim']()||'',_0x499cf9=_0x3f0f27[0x5]?.['toString']()['trim']()||'',_0x3c2a93=_0x3f0f27[0x6]?.['toString']()['trim']()||'',_0x1a9fda=_0x3f0f27[0x7]?.['toString']()['trim']()||'';if(!_0x411a20)continue;let _0x3f8c9a=0x0;const _0x53b6ca=_0x212791['match'](/(\d+)/);_0x53b6ca&&_0x53b6ca[0x1]&&(_0x3f8c9a=parseInt(_0x53b6ca[0x1],0xa));const _0x2b1f93={'sem':_0x1a8670,'school_year':_0x195816,'code':_0x411a20,'course_no':_0x304704,'course_desc':_0x25c264,'unit':_0x3f8c9a,'time':_0x226d56,'days':_0x499cf9,'faculty':_0x3c2a93,'room':_0x1a9fda};_0x2dc5f0['push'](_0x2b1f93);}return _0x2dc5f0;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0xa1a283,_0x10883a){try{const _0x5db830=await convertToCSVFile(_0x10883a),_0x29d9ed=await _0x5db830['text'](),_0xb90b22=parseCourseOffering(_0x29d9ed),_0x49ecfb=_0x224f08['unparse'](_0xb90b22),_0x29a989=new File([_0x49ecfb],_0x5db830['name'],{'type':'text/csv'}),_0x2fb72e=new FormData();_0x2fb72e['append']('csvFile',_0x29a989);const _0x3fcf40=await fetch(_0xa1a283+'/course-offerings/upload',{'method':'POST','body':_0x2fb72e});if(!_0x3fcf40['ok']){const _0x174fca=await _0x3fcf40['json']();throw _0x174fca;}return _0x3fcf40['json']();}catch(_0x3f6a99){throw _0x3f6a99;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x220203){if(!_0x220203)return {'performance_target':null,'passing_score':null};const _0x29d8c1=_0x220203['match'](/\d+/g);return {'performance_target':_0x29d8c1?.[0x0]?parseInt(_0x29d8c1[0x0],0xa):null,'passing_score':_0x29d8c1?.[0x1]?parseInt(_0x29d8c1[0x1],0xa):null};}
|
|
15
15
|
|
|
16
|
-
function extractInstructionalVerb(
|
|
16
|
+
function extractInstructionalVerb(_0x4548fc){const _0x43bca6=_0x4548fc['trim'](),_0x1d8d41=/\b(will|shall)\b\s+(?:be\s+able\s+to\s+)?([a-zA-Z]+)/i,_0x5d1c7a=_0x43bca6['match'](_0x1d8d41);return _0x5d1c7a&&_0x5d1c7a[0x2]!==undefined?_0x5d1c7a[0x2]:null;}
|
|
17
17
|
|
|
18
|
-
function parseCOAEP(
|
|
18
|
+
function parseCOAEP(_0x1301c6){const _0x559b55=_0x224f08['parse'](_0x1301c6,{'skipEmptyLines':![]})['data'],_0x54b750={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}};let _0x3ef94b=-1,_0x27ba5e=-1,_0x4d6e05=-1,_0x643bcf=-1;_0x559b55['forEach'](_0x8f524=>{_0x3ef94b=_0x8f524['indexOf']('Course\x20Outcome\x20Statement'),_0x27ba5e=_0x8f524['indexOf']('Intended\x20Learning\x20Outcome'),_0x4d6e05=_0x8f524['indexOf']('Assessment\x20Tool'),_0x643bcf=_0x8f524['indexOf']('Performance\x20Target');if(_0x3ef94b!==-1&&_0x27ba5e!==-1&&_0x4d6e05!==-1&&_0x643bcf!==-1)return;}),_0x559b55['forEach'](_0x2b7d64=>{const _0x4e456a=_0x2b7d64['indexOf']('Name\x20of\x20Faculty:'),_0x4d273e=_0x2b7d64['indexOf']('School\x20Year'),_0x3c40df=_0x2b7d64['indexOf']('Course:'),_0x1a7cc1=_0x2b7d64['indexOf']('Semester');_0x54b750['COAEP']['faculty']=_0x2b7d64[_0x4e456a+0x1]?.['trim']()||_0x54b750['COAEP']['faculty'],_0x54b750['COAEP']['sy']=_0x2b7d64[_0x4d273e+0x1]?.['trim']()||_0x54b750['COAEP']['sy'],_0x54b750['COAEP']['course']=_0x2b7d64[_0x3c40df+0x1]?.['trim']()||_0x54b750['COAEP']['course'];const _0x166cfa=_0x2b7d64[_0x1a7cc1+0x1]?.['trim']()||'',_0x4d21e5=_0x166cfa['match'](/\d+/)?.[0x0];_0x54b750['COAEP']['semester']=_0x4d21e5?parseInt(_0x4d21e5,0xa):_0x54b750['COAEP']['semester'];});let _0x2febff=null;return _0x559b55['forEach'](_0x5ca675=>{const _0x299e9f=_0x5ca675[0x1]?.['trim']()||'',_0x4dc072=_0x5ca675[0x2]?.['trim']()||'',_0x571e76=_0x5ca675[0x4]?.['trim']()||'',_0x4cd898=_0x5ca675[0x5]?.['replace'](/^ILO\d+[:.]?\s*/,'')||'',_0x5123c8=_0x5ca675[0x6]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x299e9f&&/^\d+$/['test'](_0x299e9f)){_0x2febff&&_0x54b750['COAEP']['co']['push'](_0x2febff);const _0x536711=_0x4dc072,_0x34913e=extractInstructionalVerb(_0x536711)||'';_0x2febff={'statement':_0x536711,'verb':_0x34913e,'ilo':[]};}if(_0x2febff&&_0x571e76&&_0x4cd898&&_0x5123c8){const _0x497081=_0x571e76['replace'](/^ILO\d+[:.]?\s*/,''),{performance_target:_0x59628a,passing_score:_0x55cc46}=performaceTarget(_0x5123c8);_0x2febff['ilo']['push']({'statement':_0x497081,'verb':extractInstructionalVerb(_0x497081)||'','assessment_tool':_0x4cd898,'performance_target':_0x59628a,'passing_score':_0x55cc46});}}),_0x2febff&&_0x54b750['COAEP']['co']['push'](_0x2febff),_0x54b750;}
|
|
19
19
|
|
|
20
|
-
async function uploadCOAEP(
|
|
20
|
+
async function uploadCOAEP(_0x5efc72,_0x151e0d,_0x8de6eb){try{const _0x2e82f6=await convertToCSVFile(_0x151e0d),_0x4e6e60=await _0x2e82f6['text'](),_0x4529aa=parseCOAEP(_0x4e6e60),_0x361c0b=await fetch(_0x5efc72+'/coaeps/upload?course_id='+_0x8de6eb,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x4529aa)});if(!_0x361c0b['ok']){const _0x3b73cc=await _0x361c0b['json']();throw _0x3b73cc;}return _0x361c0b['json']();}catch(_0x26f795){throw _0x26f795;}}
|
|
21
21
|
|
|
22
|
-
async function uploadEnrolledStudent(
|
|
22
|
+
async function uploadEnrolledStudent(_0x3f86a3,_0x13e688){try{const _0x365c92=await convertToCSVFile(_0x13e688),_0x3a5fda=new FormData();_0x3a5fda['append']('csvFile',_0x365c92);const _0x588201=await fetch(_0x3f86a3+'/enrolled-students/upload',{'method':'POST','body':_0x3a5fda});if(!_0x588201['ok']){const _0x4c253d=await _0x588201['json']();throw _0x4c253d;}return _0x588201['json']();}catch(_0x46c3a1){throw _0x46c3a1;}}
|
|
23
23
|
|
|
24
|
-
function parseClassList(
|
|
24
|
+
function parseClassList(_0x4a82cc){const _0x1f1a03=_0x224f08['parse'](_0x4a82cc,{'skipEmptyLines':!![]})['data'];let _0x4bf7a0='',_0x39406d='',_0x610ae6='';const _0x27bf5a=[];return _0x1f1a03['forEach'](_0x122197=>{const _0x453ab3=_0x122197['map'](_0xa0fd8a=>(_0xa0fd8a??'')['toString']()['trim']()),_0x566d18=_0x453ab3[0x0]??'';if(_0x566d18['startsWith']('Course\x20No:')){const _0x2c3c3c=_0x566d18['replace']('Course\x20No:','')['trim'](),_0x25c6dc=_0x2c3c3c['split'](/\s+/);_0x610ae6=_0x25c6dc[0x0]??'';const [_0x58b31c,_0x2be96c]=(_0x25c6dc[0x1]??'')['split']('-');_0x39406d=_0x58b31c??'';const _0x1ddda5=(_0x2be96c??'')['match'](/[a-z]$/);_0x4bf7a0=_0x1ddda5?_0x1ddda5[0x0]:'';}if(/^\d+$/['test'](_0x566d18)){const _0x1bbf04=_0x453ab3[0x2]??'';_0x27bf5a['push']({'subj_code':_0x610ae6,'student_no':_0x1bbf04,'course_id':_0x39406d,'section':_0x4bf7a0});}}),{'enrolledCourses':_0x27bf5a};}
|
|
25
25
|
|
|
26
|
-
async function uploadClassList(
|
|
26
|
+
async function uploadClassList(_0x18e512,_0x27b23d,_0x2f8450,_0x3c3b75){try{const _0xe73a34=await convertToCSVFile(_0x27b23d),_0x49d603=await _0xe73a34['text'](),_0x1dd0d1=parseClassList(_0x49d603),_0x25e29a='subj_code='+_0x2f8450+'&period_id='+_0x3c3b75,_0x1a6065=await fetch(_0x18e512+'/enrolled-courses/upload?'+_0x25e29a,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x1dd0d1)});if(!_0x1a6065['ok']){const _0x168bbe=await _0x1a6065['json']();throw _0x168bbe;}return _0x1a6065['json']();}catch(_0x14cf02){throw _0x14cf02;}}
|
|
27
27
|
|
|
28
|
-
function parseAssessmentCsv(
|
|
28
|
+
function parseAssessmentCsv(_0xb145f4){const {data:_0x38b3bf}=_0x224f08['parse'](_0xb145f4,{'skipEmptyLines':!![]}),_0x3729aa=_0x38b3bf['filter'](_0x2706c3=>_0x2706c3['length']>0x0),_0x473acc=_0x3729aa['find'](_0xb92d41=>_0xb92d41['some'](_0x995cfb=>_0x995cfb?.['includes']('Faculty'))),_0x16e7ef=_0x473acc?_0x473acc['findIndex'](_0x2914e9=>_0x2914e9?.['includes']('Faculty')):-1,_0x15a623=_0x16e7ef!==-1&&_0x473acc?_0x473acc[_0x16e7ef+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x20fe30=_0x3729aa['find'](_0x3e753d=>_0x3e753d['some'](_0x29d848=>_0x29d848?.['includes']('Semester'))),_0xaebc36=_0x20fe30?_0x20fe30['findIndex'](_0x23b9a6=>_0x23b9a6?.['includes']('Semester')):-1,_0x1372cd=_0xaebc36!==-1&&_0x20fe30?_0x20fe30[_0xaebc36+0x2]?.['trim']()??'':'',_0x2cd653=_0x1372cd['includes']('1st')?0x1:_0x1372cd['includes']('2nd')?0x2:0x0,_0x25b9c8=_0x3729aa['find'](_0xd29c5b=>_0xd29c5b['some'](_0x37cf07=>_0x37cf07?.['includes']('Course\x20&\x20Sec'))),_0x4383f3=_0x25b9c8?_0x25b9c8['findIndex'](_0x4672b2=>_0x4672b2?.['includes']('Course\x20&\x20Sec')):-1,_0x47ac34=_0x4383f3!==-1&&_0x25b9c8?_0x25b9c8[_0x4383f3+0x2]?.['trim']()??'':'';let _0x2f0c29='',_0x32c325='';if(_0x47ac34){const _0x4621a3=_0x47ac34['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x4621a3&&(_0x2f0c29=_0x4621a3[0x1]??'',_0x4621a3[0x2]&&(_0x32c325=_0x4621a3[0x2]['replace'](/^OC/i,'')));}const _0x45c374=_0x3729aa['find'](_0x5c5c24=>_0x5c5c24['some'](_0x32a067=>_0x32a067?.['includes']('School\x20Year'))),_0x10494e=_0x45c374?_0x45c374['findIndex'](_0x133bcd=>_0x133bcd?.['includes']('School\x20Year')):-1,_0xe3fecd=_0x10494e!==-1&&_0x45c374?_0x45c374[_0x10494e+0x2]?.['trim']()??'':'';let _0x3ff0e3=0x0;if(_0xe3fecd){const _0x327efe=_0xe3fecd['match'](/(\d{4})-(\d{4})/);if(_0x327efe){const _0x28e3f0=(_0x327efe[0x1]??'')['slice'](0x2),_0x32893e=(_0x327efe[0x2]??'')['slice'](0x2);_0x3ff0e3=parseInt(_0x28e3f0+_0x32893e,0xa);}}const _0x1fb4c5={'faculty':_0x15a623,'course':_0x2f0c29,'section':_0x32c325,'semester':_0x2cd653,'sy':_0x3ff0e3},_0x2701d3=_0x3729aa['findIndex'](_0x29dce2=>_0x29dce2['some'](_0x5a524b=>_0x5a524b?.['trim']()==='CO\x20#'));if(_0x2701d3===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x98c724=_0x3729aa[_0x2701d3+0x1];if(!_0x98c724)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x451046={};let _0x46ef0f=0x1,_0x29f8b5=0x1;for(let _0x498c64=0x3;_0x498c64<_0x98c724['length'];_0x498c64++){const _0x3b20ab=_0x98c724[_0x498c64];if(!_0x3b20ab)continue;const _0x2755ec='co'+_0x46ef0f;if(!_0x451046[_0x2755ec])_0x451046[_0x2755ec]=[];_0x451046[_0x2755ec]['push']('ilo'+_0x29f8b5),_0x29f8b5++,_0x29f8b5>0x3&&(_0x46ef0f++,_0x29f8b5=0x1);}const _0x229c56=_0x3729aa['findIndex'](_0x2a57ba=>_0x2a57ba['includes']('Name\x20of\x20Students'));if(_0x229c56===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x223535=_0x3729aa[_0x229c56];if(!_0x223535)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x2f6891=_0x223535['findIndex'](_0x358a71=>_0x358a71?.['includes']('Name\x20of\x20Students'));if(_0x2f6891===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x30b10b=_0x2f6891+0x2,_0xabaa4e=[];for(let _0x4cc65b=_0x229c56+0x1;_0x4cc65b<_0x3729aa['length'];_0x4cc65b++){const _0x2c2659=_0x3729aa[_0x4cc65b];if(!_0x2c2659)continue;if(_0x2c2659['some'](_0x20b758=>_0x20b758?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x20b758?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x20b758?.['toUpperCase']()['includes']('INACTIVE')||_0x20b758?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x2c2659[_0x2f6891])continue;const _0x4afad4=_0x2c2659[_0x2f6891]['replace'](/"/g,'')['trim'](),_0x420b45=_0x2c2659['slice'](_0x30b10b)['map'](_0xb66038=>_0xb66038===null?null:!isNaN(Number(_0xb66038))?parseFloat(_0xb66038):0x0);let _0x5eec5a=0x0;const _0x34dbdf={};Object['entries'](_0x451046)['forEach'](([_0x6a50aa,_0x3c7831])=>{const _0x3b90c4={};_0x3c7831['forEach'](_0x28f324=>{_0x3b90c4[_0x28f324]=_0x420b45[_0x5eec5a]??0x0,_0x5eec5a++;}),_0x34dbdf[_0x6a50aa]={'transmuted_score':_0x3b90c4};}),_0xabaa4e['push']({'student_name':_0x4afad4,'coaep':_0x34dbdf});}const _0x1242cf=_0x3729aa['find'](_0xde1724=>_0xde1724['some'](_0x52de1c=>_0x52de1c?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x73f495=_0x3729aa['find'](_0x678e2b=>_0x678e2b['some'](_0x148b56=>_0x148b56?.['includes']('AVERAGE'))),_0x216cb6=_0x1242cf?_0x1242cf['slice'](_0x30b10b)['map'](_0x345063=>_0x345063&&!isNaN(Number(_0x345063))?parseInt(_0x345063):0x0):[],_0x3d20f0=_0x73f495?_0x73f495['slice'](_0x30b10b)['map'](_0x40955c=>_0x40955c&&_0x40955c!=='#DIV/0!'&&!isNaN(Number(_0x40955c))?parseInt(_0x40955c):0x0):[],_0x33da85={};let _0x1d891d=0x0;return Object['entries'](_0x451046)['forEach'](([_0x8e38b5,_0x3b661e])=>{if(!_0x33da85[_0x8e38b5])_0x33da85[_0x8e38b5]={};_0x3b661e['forEach'](_0x5a1d2a=>{_0x33da85[_0x8e38b5][_0x5a1d2a]={'achievedMinimum':_0x216cb6[_0x1d891d]??0x0,'average':_0x3d20f0[_0x1d891d]??0x0},_0x1d891d++;});}),{'assessmentData':{'classAssignment':_0x1fb4c5,'student':_0xabaa4e,'total':_0x33da85}};}
|
|
29
29
|
|
|
30
|
-
async function uploadAssessmentData(
|
|
30
|
+
async function uploadAssessmentData(_0x1787cc,_0x2b6893){try{const _0x43b3b3=await convertToCSVFile(_0x2b6893),_0x456b78=await _0x43b3b3['text'](),_0xa433c5=parseAssessmentCsv(_0x456b78),_0x303944=await fetch(_0x1787cc+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0xa433c5)});if(!_0x303944['ok']){const _0x29a228=await _0x303944['json']();throw _0x29a228;}return _0x303944['json']();}catch(_0x1740ae){throw _0x1740ae;}}
|
|
31
31
|
|
|
32
|
-
async function uploadDeptFaculty(
|
|
32
|
+
async function uploadDeptFaculty(_0x228ab0,_0x2b373e){try{const _0x417232=await convertToCSVFile(_0x2b373e),_0x5b14a5=new FormData();_0x5b14a5['append']('csvFile',_0x417232);const _0x10a2e8=await fetch(_0x228ab0+'/dept-faculties/upload',{'method':'POST','body':_0x5b14a5});if(!_0x10a2e8['ok']){const _0x141767=await _0x10a2e8['json']();throw _0x141767;}return _0x10a2e8['json']();}catch(_0x5b7e9e){throw _0x5b7e9e;}}
|
|
33
33
|
|
|
34
|
-
class Client{['BASE_URL'];constructor(
|
|
34
|
+
class Client{['BASE_URL'];constructor(_0x49f543){this['BASE_URL']=_0x49f543;}['Parser'](){return {'curriculum':async _0x735541=>{const _0x168754=await uploadCurriculum(this['BASE_URL'],_0x735541);return _0x168754;},'courseOffering':async _0x120313=>{const _0x58c0d8=await uploadCourseOffering(this['BASE_URL'],_0x120313);return _0x58c0d8;},'coaep':async(_0x47da00,_0x3b3cff)=>{const _0x73a322=await uploadCOAEP(this['BASE_URL'],_0x47da00,_0x3b3cff);return _0x73a322;},'enrolledStudent':async _0x11b4a8=>{const _0x39e271=await uploadEnrolledStudent(this['BASE_URL'],_0x11b4a8);return _0x39e271;},'classlist':async(_0x20d33e,_0x4d7d25,_0x1c1cb8)=>{const _0x43b6bb=await uploadClassList(this['BASE_URL'],_0x20d33e,_0x4d7d25,_0x1c1cb8);return _0x43b6bb;},'assessmentData':async _0x2cbfd4=>{const _0xcb6ad8=await uploadAssessmentData(this['BASE_URL'],_0x2cbfd4);return _0xcb6ad8;},'deptFaculty':async _0x159472=>{const _0x4b30de=await uploadDeptFaculty(this['BASE_URL'],_0x159472);return _0x4b30de;}};}}
|
|
35
35
|
|
|
36
36
|
export { Client as default };
|