@obe-loms/coms-parser 1.2.4 → 1.2.5
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 _0x52ee4c from 'papaparse';
|
|
2
|
+
import * as _0x3e8045 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0xdaf3b5){let _0x5bf31b='',_0x37851a='',_0x2730af=0x0,_0x1ce041=null;const _0x23f043=[];return _0x52ee4c['parse'](_0xdaf3b5,{'skipEmptyLines':!![],'complete':_0x5c8791=>{_0x5c8791['data']['forEach'](_0x2c6917=>{const _0x533711=_0x2c6917['map'](_0x18fb30=>(_0x18fb30??'')['toString']()['trim']()),_0x5ee1b1=_0x533711[0x0]??'';if(_0x5ee1b1['includes']('Rev#')){const _0x24f615=_0x5ee1b1['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x24f615&&(_0x5bf31b=_0x24f615[0x1]?.['trim']()??'',_0x37851a=_0x24f615[0x2]?.['trim']()??'',_0x2730af=parseInt(_0x24f615[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x5ee1b1)){_0x1ce041=0x1;return;}if(/SECOND YEAR/i['test'](_0x5ee1b1)){_0x1ce041=0x2;return;}if(/THIRD YEAR/i['test'](_0x5ee1b1)){_0x1ce041=0x3;return;}if(/FOURTH YEAR/i['test'](_0x5ee1b1)){_0x1ce041=0x4;return;}if(/FIFTH YEAR/i['test'](_0x5ee1b1)){_0x1ce041=0x5;return;}if(/First Semester/i['test'](_0x5ee1b1)||/Second Semester/i['test'](_0x5ee1b1)||/Summer/i['test'](_0x5ee1b1))return;const _0x49b963=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x49b963['forEach'](({sem:_0xdc57b4,offset:_0x5af4e5})=>{const _0x341519=_0x533711[_0x5af4e5]??'',_0x2d44c0=_0x533711[_0x5af4e5+0x1]??'',_0x1b9be6=_0x533711[_0x5af4e5+0x2]??'',_0x52b7b6=_0x533711[_0x5af4e5+0x3]??'',_0x5d7036=_0x533711[_0x5af4e5+0x4]??'';_0x341519&&_0x1ce041&&_0x23f043['push']({'curr_id':_0x5bf31b,'program_name':_0x37851a,'revision_no':_0x2730af,'year_level':_0x1ce041,'sem':_0xdc57b4,'course_id':_0x341519,'course_desc':_0x2d44c0,'total_units':_0x1b9be6,'lec_unit':_0x52b7b6,'lab_unit':_0x5d7036});});});}}),_0x23f043;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x5396ac){return new Promise((_0x552f85,_0x39e18a)=>{const _0x4f3403=new FileReader();_0x4f3403['onload']=_0x3c528c=>{const _0x2d0063=_0x3c528c['target']?.['result'];if(!_0x2d0063){_0x39e18a(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x32330e=_0x3e8045['read'](_0x2d0063,{'type':'array'}),_0x2fcd47=_0x32330e['SheetNames'][0x0];if(!_0x2fcd47){_0x39e18a(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x3275f4=_0x32330e['Sheets'][_0x2fcd47];if(!_0x3275f4){_0x39e18a(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x29930d=_0x3e8045['utils']['sheet_to_csv'](_0x3275f4,{'strip':!![]}),_0x19351a=_0x5396ac['name']['replace'](/\.[^/.]+$/,'.csv'),_0x5240ca=new File([_0x29930d],_0x19351a,{'type':'text/csv','lastModified':Date['now']()});_0x552f85(_0x5240ca);}catch(_0x386cec){_0x39e18a(_0x386cec);}},_0x4f3403['onerror']=()=>{_0x39e18a(new Error('File\x20reading\x20failed'));},_0x4f3403['readAsArrayBuffer'](_0x5396ac);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x4a6ae0,_0x4291b6){try{const _0x593de8=await convertToCSVFile(_0x4291b6),_0x4f0015=await _0x593de8['text'](),_0x543389=parseCurriculum(_0x4f0015),_0x4c72e7=_0x52ee4c['unparse'](_0x543389),_0x9e90a=new File([_0x4c72e7],_0x593de8['name'],{'type':'text/csv'}),_0x30bb81=new FormData();_0x30bb81['append']('csvFile',_0x9e90a);const _0x3345fb=await fetch(_0x4a6ae0+'/curr-courses/upload',{'method':'POST','body':_0x30bb81});if(!_0x3345fb['ok']){const _0x431917=await _0x3345fb['json']();throw _0x431917;}return _0x3345fb['json']();}catch(_0x56bc2a){throw _0x56bc2a;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x4840ed){let _0x1b4706='',_0x294c51='';const _0xaabe26=[],_0x455238=_0x52ee4c['parse'](_0x4840ed,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x3191fc=_0x455238['data'];for(let _0x54319a=0x0;_0x54319a<Math['min'](0x5,_0x3191fc['length']);_0x54319a++){const _0x351626=_0x3191fc[_0x54319a];if(_0x351626&&_0x351626['length']>0x0){const _0x3e394f=_0x351626[0x0]?.['toString']()||'',_0x23b7c3=_0x3e394f['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x23b7c3){_0x1b4706=_0x23b7c3[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x23b7c3[0x2]){const _0x142c63=_0x23b7c3[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x142c63&&_0x142c63[0x2]&&_0x142c63[0x4]&&(_0x294c51=_0x142c63[0x2]+_0x142c63[0x4]);}}}}let _0x5db849=-1;for(let _0x4e6538=0x0;_0x4e6538<_0x3191fc['length'];_0x4e6538++){const _0x134a56=_0x3191fc[_0x4e6538];if(_0x134a56&&_0x134a56['some'](_0x154100=>_0x154100?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x5db849=_0x4e6538;break;}}if(_0x5db849===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');for(let _0x29db53=_0x5db849+0x1;_0x29db53<_0x3191fc['length'];_0x29db53++){const _0x2f92cb=_0x3191fc[_0x29db53];if(!_0x2f92cb||_0x2f92cb['length']<0x8)continue;const _0xab4439=_0x2f92cb[0x0]?.['toString']()['trim']()||'',_0x1e5ce8=_0x2f92cb[0x1]?.['toString']()['trim']()||'',_0x56bb70=_0x2f92cb[0x2]?.['toString']()['trim']()||'',_0xdbcbb9=_0x2f92cb[0x3]?.['toString']()['trim']()||'',_0x5ae2ac=_0x2f92cb[0x4]?.['toString']()['trim']()||'',_0x5d3596=_0x2f92cb[0x5]?.['toString']()['trim']()||'',_0xd5217=_0x2f92cb[0x6]?.['toString']()['trim']()||'',_0x7bbb98=_0x2f92cb[0x7]?.['toString']()['trim']()||'';if(!_0xab4439)continue;let _0x228bec=0x0;const _0x5805c1=_0xdbcbb9['match'](/(\d+)/);_0x5805c1&&_0x5805c1[0x1]&&(_0x228bec=parseInt(_0x5805c1[0x1],0xa));const _0x2e761c={'sem':_0x1b4706,'school_year':_0x294c51,'code':_0xab4439,'course_no':_0x1e5ce8,'course_desc':_0x56bb70,'unit':_0x228bec,'time':_0x5ae2ac,'days':_0x5d3596,'faculty':_0xd5217,'room':_0x7bbb98};_0xaabe26['push'](_0x2e761c);}return _0xaabe26;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x171e54,_0x23a2be){try{const _0x46c401=await convertToCSVFile(_0x23a2be),_0x5d096a=await _0x46c401['text'](),_0x1cddce=parseCourseOffering(_0x5d096a),_0x5c43c5=_0x52ee4c['unparse'](_0x1cddce),_0x173083=new File([_0x5c43c5],_0x46c401['name'],{'type':'text/csv'}),_0xf40d59=new FormData();_0xf40d59['append']('csvFile',_0x173083);const _0x4cbfc4=await fetch(_0x171e54+'/course-offerings/upload',{'method':'POST','body':_0xf40d59});if(!_0x4cbfc4['ok']){const _0x589986=await _0x4cbfc4['json']();throw _0x589986;}return _0x4cbfc4['json']();}catch(_0x1e95d0){throw _0x1e95d0;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x2d7162){if(!_0x2d7162)return {'performance_target':null,'passing_score':null};const _0x290c0f=_0x2d7162['match'](/\d+/g);return {'performance_target':_0x290c0f?.[0x0]?parseInt(_0x290c0f[0x0],0xa):null,'passing_score':_0x290c0f?.[0x1]?parseInt(_0x290c0f[0x1],0xa):null};}
|
|
15
15
|
|
|
16
|
-
function extractInstructionalVerb(
|
|
16
|
+
function extractInstructionalVerb(_0x7a4fb3){const _0xcca95a=_0x7a4fb3['trim'](),_0x4095a0=/\b(will|shall)\b\s+(?:be\s+able\s+to\s+)?([a-zA-Z]+)/i,_0x1a041b=_0xcca95a['match'](_0x4095a0);return _0x1a041b&&_0x1a041b[0x2]!==undefined?_0x1a041b[0x2]:null;}
|
|
17
17
|
|
|
18
|
-
function parseCOAEP(
|
|
18
|
+
function parseCOAEP(_0xed292a){const _0x56dbc5=_0x52ee4c['parse'](_0xed292a,{'skipEmptyLines':![]})['data'],_0x39a497={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}};let _0x21f8cd=-1,_0x5b7043=-1,_0x180e27=-1,_0x903a0=-1;_0x56dbc5['forEach'](_0x38f5a2=>{_0x21f8cd=_0x38f5a2['indexOf']('Course\x20Outcome\x20Statement'),_0x5b7043=_0x38f5a2['indexOf']('Intended\x20Learning\x20Outcome'),_0x180e27=_0x38f5a2['indexOf']('Assessment\x20Tool'),_0x903a0=_0x38f5a2['indexOf']('Performance\x20Target');if(_0x21f8cd!==-1&&_0x5b7043!==-1&&_0x180e27!==-1&&_0x903a0!==-1)return;}),_0x56dbc5['forEach'](_0x6015b9=>{const _0x2c1dda=_0x6015b9['indexOf']('Name\x20of\x20Faculty:'),_0x4aa202=_0x6015b9['indexOf']('School\x20Year'),_0x13f70c=_0x6015b9['indexOf']('Course:'),_0x508f7e=_0x6015b9['indexOf']('Semester');_0x39a497['COAEP']['faculty']=_0x6015b9[_0x2c1dda+0x1]?.['trim']()||_0x39a497['COAEP']['faculty'],_0x39a497['COAEP']['sy']=_0x6015b9[_0x4aa202+0x1]?.['trim']()||_0x39a497['COAEP']['sy'],_0x39a497['COAEP']['course']=_0x6015b9[_0x13f70c+0x1]?.['trim']()||_0x39a497['COAEP']['course'];const _0x5cbef0=_0x6015b9[_0x508f7e+0x1]?.['trim']()||'',_0x43eeb2=_0x5cbef0['match'](/\d+/)?.[0x0];_0x39a497['COAEP']['semester']=_0x43eeb2?parseInt(_0x43eeb2,0xa):_0x39a497['COAEP']['semester'];});let _0xbdb6b9=null;return _0x56dbc5['forEach'](_0x277795=>{const _0x4bb8d6=_0x277795[0x1]?.['trim']()||'',_0xa3a69a=_0x277795[0x2]?.['trim']()||'',_0x1117be=_0x277795[0x4]?.['trim']()||'',_0x5756cb=_0x277795[0x5]?.['replace'](/^ILO\d+[:.]?\s*/,'')||'',_0x18074b=_0x277795[0x6]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x4bb8d6===''&&_0xa3a69a===''&&_0x1117be===''&&_0x5756cb===''&&_0x18074b==='')return;if(_0x4bb8d6&&/^\d+$/['test'](_0x4bb8d6)){_0xbdb6b9&&_0x39a497['COAEP']['co']['push'](_0xbdb6b9);const _0x5c66f1=_0xa3a69a,_0x410f3a=extractInstructionalVerb(_0x5c66f1)||'';_0xbdb6b9={'statement':_0x5c66f1,'verb':_0x410f3a,'ilo':[]};}if(_0xbdb6b9&&_0x1117be){const _0x30209f=_0x1117be['replace'](/^ILO\d+[:.]?\s*/,''),{performance_target:_0x3a4d21,passing_score:_0x545dbb}=performaceTarget(_0x18074b);_0xbdb6b9['ilo']['push']({'statement':_0x30209f,'verb':extractInstructionalVerb(_0x30209f)||'','assessment_tool':_0x5756cb,'performance_target':_0x3a4d21,'passing_score':_0x545dbb});}}),_0xbdb6b9&&_0x39a497['COAEP']['co']['push'](_0xbdb6b9),_0x39a497;}
|
|
19
19
|
|
|
20
|
-
async function uploadCOAEP(
|
|
20
|
+
async function uploadCOAEP(_0x14b130,_0x344d99,_0x557cbb){try{const _0x380b5b=await convertToCSVFile(_0x344d99),_0x4b4737=await _0x380b5b['text'](),_0x23ea19=parseCOAEP(_0x4b4737),_0x31238c=await fetch(_0x14b130+'/coaeps/upload?course_id='+_0x557cbb,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x23ea19)});if(!_0x31238c['ok']){const _0x43a9c3=await _0x31238c['json']();throw _0x43a9c3;}return _0x31238c['json']();}catch(_0x3e7e13){throw _0x3e7e13;}}
|
|
21
21
|
|
|
22
|
-
async function uploadEnrolledStudent(
|
|
22
|
+
async function uploadEnrolledStudent(_0x459dfc,_0x415dfd){try{const _0x91fac=await convertToCSVFile(_0x415dfd),_0x4cedea=new FormData();_0x4cedea['append']('csvFile',_0x91fac);const _0x4a9ce6=await fetch(_0x459dfc+'/enrolled-students/upload',{'method':'POST','body':_0x4cedea});if(!_0x4a9ce6['ok']){const _0x1194b3=await _0x4a9ce6['json']();throw _0x1194b3;}return _0x4a9ce6['json']();}catch(_0x47d8af){throw _0x47d8af;}}
|
|
23
23
|
|
|
24
|
-
function parseClassList(
|
|
24
|
+
function parseClassList(_0x5e1072){const _0x217376=_0x52ee4c['parse'](_0x5e1072,{'skipEmptyLines':!![]})['data'];let _0x2993d7='',_0x29e6d0='',_0x50fd40='';const _0x55d004=[];return _0x217376['forEach'](_0x3b748f=>{const _0x3ef9bc=_0x3b748f['map'](_0x905f22=>(_0x905f22??'')['toString']()['trim']()),_0x2e9b9f=_0x3ef9bc[0x0]??'';if(_0x2e9b9f['startsWith']('Course\x20No:')){const _0x44ac10=_0x2e9b9f['replace']('Course\x20No:','')['trim'](),_0x5a346b=_0x44ac10['split'](/\s+/);_0x50fd40=_0x5a346b[0x0]??'';const [_0x515660,_0x5cdeb6]=(_0x5a346b[0x1]??'')['split']('-');_0x29e6d0=_0x515660??'';const _0x30470c=(_0x5cdeb6??'')['match'](/[a-z]$/);_0x2993d7=_0x30470c?_0x30470c[0x0]:'';}if(/^\d+$/['test'](_0x2e9b9f)){const _0x4b7de2=_0x3ef9bc[0x2]??'';_0x55d004['push']({'subj_code':_0x50fd40,'student_no':_0x4b7de2,'course_id':_0x29e6d0,'section':_0x2993d7});}}),{'enrolledCourses':_0x55d004};}
|
|
25
25
|
|
|
26
|
-
async function uploadClassList(
|
|
26
|
+
async function uploadClassList(_0x25b854,_0x188dbb,_0x597fa1,_0x4d5bb7){try{const _0x88a719=await convertToCSVFile(_0x188dbb),_0x3c3049=await _0x88a719['text'](),_0x533148=parseClassList(_0x3c3049),_0x2a7b6e='subj_code='+_0x597fa1+'&period_id='+_0x4d5bb7,_0x3142ba=await fetch(_0x25b854+'/enrolled-courses/upload?'+_0x2a7b6e,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x533148)});if(!_0x3142ba['ok']){const _0x5eb42e=await _0x3142ba['json']();throw _0x5eb42e;}return _0x3142ba['json']();}catch(_0x3c9fac){throw _0x3c9fac;}}
|
|
27
27
|
|
|
28
|
-
function parseAssessmentCsv(
|
|
28
|
+
function parseAssessmentCsv(_0x5eb7ed){const {data:_0xdcd88b}=_0x52ee4c['parse'](_0x5eb7ed,{'skipEmptyLines':!![]}),_0x530cbe=_0xdcd88b['filter'](_0x2e298f=>_0x2e298f['length']>0x0),_0x30fc4c=_0x530cbe['find'](_0x323681=>_0x323681['some'](_0x51efdf=>_0x51efdf?.['includes']('Faculty'))),_0xf78967=_0x30fc4c?_0x30fc4c['findIndex'](_0x7f66fd=>_0x7f66fd?.['includes']('Faculty')):-1,_0xa7a84a=_0xf78967!==-1&&_0x30fc4c?_0x30fc4c[_0xf78967+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x44a740=_0x530cbe['find'](_0x3ccfe1=>_0x3ccfe1['some'](_0x2b8707=>_0x2b8707?.['includes']('Semester'))),_0x515c61=_0x44a740?_0x44a740['findIndex'](_0x2f359a=>_0x2f359a?.['includes']('Semester')):-1,_0x44e58e=_0x515c61!==-1&&_0x44a740?_0x44a740[_0x515c61+0x2]?.['trim']()??'':'',_0x591d70=_0x44e58e['includes']('1st')?0x1:_0x44e58e['includes']('2nd')?0x2:0x0,_0xbb7f08=_0x530cbe['find'](_0x34aa9a=>_0x34aa9a['some'](_0x46a4b8=>_0x46a4b8?.['includes']('Course\x20&\x20Sec'))),_0x254b20=_0xbb7f08?_0xbb7f08['findIndex'](_0x2722ab=>_0x2722ab?.['includes']('Course\x20&\x20Sec')):-1,_0xbd9004=_0x254b20!==-1&&_0xbb7f08?_0xbb7f08[_0x254b20+0x2]?.['trim']()??'':'';let _0x29a710='',_0x42de10='';if(_0xbd9004){const _0x329b61=_0xbd9004['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x329b61&&(_0x29a710=_0x329b61[0x1]??'',_0x329b61[0x2]&&(_0x42de10=_0x329b61[0x2]['replace'](/^OC/i,'')));}const _0x180c3f=_0x530cbe['find'](_0x512157=>_0x512157['some'](_0x521d77=>_0x521d77?.['includes']('School\x20Year'))),_0x399c36=_0x180c3f?_0x180c3f['findIndex'](_0x4d414e=>_0x4d414e?.['includes']('School\x20Year')):-1,_0x41a64a=_0x399c36!==-1&&_0x180c3f?_0x180c3f[_0x399c36+0x2]?.['trim']()??'':'';let _0x2a6328=0x0;if(_0x41a64a){const _0x45a665=_0x41a64a['match'](/(\d{4})-(\d{4})/);if(_0x45a665){const _0x18e863=(_0x45a665[0x1]??'')['slice'](0x2),_0x1f32c0=(_0x45a665[0x2]??'')['slice'](0x2);_0x2a6328=parseInt(_0x18e863+_0x1f32c0,0xa);}}const _0x53d0a1={'faculty':_0xa7a84a,'course':_0x29a710,'section':_0x42de10,'semester':_0x591d70,'sy':_0x2a6328},_0x3fc26c=_0x530cbe['findIndex'](_0x44aae5=>_0x44aae5['some'](_0x3cfcb8=>_0x3cfcb8?.['trim']()==='CO\x20#'));if(_0x3fc26c===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x1b486b=_0x530cbe[_0x3fc26c+0x1];if(!_0x1b486b)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x57421e={};let _0x42f643=0x1,_0xbba9d3=0x1;for(let _0x30250b=0x3;_0x30250b<_0x1b486b['length'];_0x30250b++){const _0x544de3=_0x1b486b[_0x30250b];if(!_0x544de3)continue;const _0x4d6029='co'+_0x42f643;if(!_0x57421e[_0x4d6029])_0x57421e[_0x4d6029]=[];_0x57421e[_0x4d6029]['push']('ilo'+_0xbba9d3),_0xbba9d3++,_0xbba9d3>0x3&&(_0x42f643++,_0xbba9d3=0x1);}const _0x1cefcc=_0x530cbe['findIndex'](_0x1a50fb=>_0x1a50fb['includes']('Name\x20of\x20Students'));if(_0x1cefcc===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x3521ee=_0x530cbe[_0x1cefcc];if(!_0x3521ee)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x234561=_0x3521ee['findIndex'](_0x223c80=>_0x223c80?.['includes']('Name\x20of\x20Students'));if(_0x234561===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x825c04=_0x234561+0x2,_0x646b9f=[];for(let _0x14bca8=_0x1cefcc+0x1;_0x14bca8<_0x530cbe['length'];_0x14bca8++){const _0x865bee=_0x530cbe[_0x14bca8];if(!_0x865bee)continue;if(_0x865bee['some'](_0x18dd77=>_0x18dd77?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x18dd77?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x18dd77?.['toUpperCase']()['includes']('INACTIVE')||_0x18dd77?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x865bee[_0x234561])continue;const _0x3df88b=_0x865bee[_0x234561]['replace'](/"/g,'')['trim'](),_0x299b18=_0x865bee['slice'](_0x825c04)['map'](_0x257daf=>_0x257daf===null?null:!isNaN(Number(_0x257daf))?parseFloat(_0x257daf):0x0);let _0x307c09=0x0;const _0x121f08={};Object['entries'](_0x57421e)['forEach'](([_0x580d76,_0x266cbe])=>{const _0x5427fd={};_0x266cbe['forEach'](_0x34a665=>{_0x5427fd[_0x34a665]=_0x299b18[_0x307c09]??0x0,_0x307c09++;}),_0x121f08[_0x580d76]={'transmuted_score':_0x5427fd};}),_0x646b9f['push']({'student_name':_0x3df88b,'coaep':_0x121f08});}const _0x47ad53=_0x530cbe['find'](_0x4147c4=>_0x4147c4['some'](_0x23eabd=>_0x23eabd?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x2989f5=_0x530cbe['find'](_0x42a36d=>_0x42a36d['some'](_0xeb8756=>_0xeb8756?.['includes']('AVERAGE'))),_0x4cbcff=_0x47ad53?_0x47ad53['slice'](_0x825c04)['map'](_0x24142d=>_0x24142d&&!isNaN(Number(_0x24142d))?parseInt(_0x24142d):0x0):[],_0x36c7ed=_0x2989f5?_0x2989f5['slice'](_0x825c04)['map'](_0x5685f1=>_0x5685f1&&_0x5685f1!=='#DIV/0!'&&!isNaN(Number(_0x5685f1))?parseInt(_0x5685f1):0x0):[],_0x62337e={};let _0x36df23=0x0;return Object['entries'](_0x57421e)['forEach'](([_0x3a5559,_0x4c65e8])=>{if(!_0x62337e[_0x3a5559])_0x62337e[_0x3a5559]={};_0x4c65e8['forEach'](_0x3f0f4f=>{_0x62337e[_0x3a5559][_0x3f0f4f]={'achievedMinimum':_0x4cbcff[_0x36df23]??0x0,'average':_0x36c7ed[_0x36df23]??0x0},_0x36df23++;});}),{'assessmentData':{'classAssignment':_0x53d0a1,'student':_0x646b9f,'total':_0x62337e}};}
|
|
29
29
|
|
|
30
|
-
async function uploadAssessmentData(
|
|
30
|
+
async function uploadAssessmentData(_0x362d38,_0x4f1c1f){try{const _0x1548b3=await convertToCSVFile(_0x4f1c1f),_0x25ce3c=await _0x1548b3['text'](),_0x253e0d=parseAssessmentCsv(_0x25ce3c),_0x13b2d2=await fetch(_0x362d38+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x253e0d)});if(!_0x13b2d2['ok']){const _0x380334=await _0x13b2d2['json']();throw _0x380334;}return _0x13b2d2['json']();}catch(_0x326ca4){throw _0x326ca4;}}
|
|
31
31
|
|
|
32
|
-
async function uploadDeptFaculty(
|
|
32
|
+
async function uploadDeptFaculty(_0x4fde7d,_0x54b681){try{const _0x5f5c00=await convertToCSVFile(_0x54b681),_0x4967d9=new FormData();_0x4967d9['append']('csvFile',_0x5f5c00);const _0x2c0976=await fetch(_0x4fde7d+'/dept-faculties/upload',{'method':'POST','body':_0x4967d9});if(!_0x2c0976['ok']){const _0x451b25=await _0x2c0976['json']();throw _0x451b25;}return _0x2c0976['json']();}catch(_0x9a98d){throw _0x9a98d;}}
|
|
33
33
|
|
|
34
|
-
class Client{['BASE_URL'];constructor(
|
|
34
|
+
class Client{['BASE_URL'];constructor(_0x56c15c){this['BASE_URL']=_0x56c15c;}['Parser'](){return {'curriculum':async _0x468aa=>{const _0x3b7483=await uploadCurriculum(this['BASE_URL'],_0x468aa);return _0x3b7483;},'courseOffering':async _0x28bb6e=>{const _0x478a45=await uploadCourseOffering(this['BASE_URL'],_0x28bb6e);return _0x478a45;},'coaep':async(_0x1362f0,_0x32643f)=>{const _0x3b518f=await uploadCOAEP(this['BASE_URL'],_0x1362f0,_0x32643f);return _0x3b518f;},'enrolledStudent':async _0x888758=>{const _0x367624=await uploadEnrolledStudent(this['BASE_URL'],_0x888758);return _0x367624;},'classlist':async(_0x32136b,_0x4c4475,_0x5e1360)=>{const _0x491ebc=await uploadClassList(this['BASE_URL'],_0x32136b,_0x4c4475,_0x5e1360);return _0x491ebc;},'assessmentData':async _0x462e3f=>{const _0x56b0c1=await uploadAssessmentData(this['BASE_URL'],_0x462e3f);return _0x56b0c1;},'deptFaculty':async _0x49e8e9=>{const _0x30b349=await uploadDeptFaculty(this['BASE_URL'],_0x49e8e9);return _0x30b349;}};}}
|
|
35
35
|
|
|
36
36
|
export { Client as default };
|