@obe-loms/coms-parser 1.1.4 → 1.2.0
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 +16 -16
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x1ec977 from 'papaparse';
|
|
2
|
+
import * as _0x2ad8be from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x5d82bf){let _0x59a6bd='',_0x35b239='',_0x1388e7=0x0,_0xfefd8c=null;const _0x4d735a=[];return _0x1ec977['parse'](_0x5d82bf,{'skipEmptyLines':!![],'complete':_0xccc6ec=>{_0xccc6ec['data']['forEach'](_0x53943b=>{const _0xa56a40=_0x53943b['map'](_0x22f4ed=>(_0x22f4ed??'')['toString']()['trim']()),_0x1da509=_0xa56a40[0x0]??'';if(_0x1da509['includes']('Rev#')){const _0xb6caf3=_0x1da509['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0xb6caf3&&(_0x59a6bd=_0xb6caf3[0x1]?.['trim']()??'',_0x35b239=_0xb6caf3[0x2]?.['trim']()??'',_0x1388e7=parseInt(_0xb6caf3[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x1da509)){_0xfefd8c=0x1;return;}if(/SECOND YEAR/i['test'](_0x1da509)){_0xfefd8c=0x2;return;}if(/THIRD YEAR/i['test'](_0x1da509)){_0xfefd8c=0x3;return;}if(/FOURTH YEAR/i['test'](_0x1da509)){_0xfefd8c=0x4;return;}if(/FIFTH YEAR/i['test'](_0x1da509)){_0xfefd8c=0x5;return;}if(/First Semester/i['test'](_0x1da509)||/Second Semester/i['test'](_0x1da509)||/Summer/i['test'](_0x1da509))return;const _0x5107f0=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x5107f0['forEach'](({sem:_0x2182f1,offset:_0x59a35e})=>{const _0x540bce=_0xa56a40[_0x59a35e]??'',_0x3c78d7=_0xa56a40[_0x59a35e+0x1]??'',_0x5ead34=_0xa56a40[_0x59a35e+0x2]??'',_0x27aaff=_0xa56a40[_0x59a35e+0x3]??'',_0x245556=_0xa56a40[_0x59a35e+0x4]??'';_0x540bce&&_0xfefd8c&&_0x4d735a['push']({'curr_id':_0x59a6bd,'program_name':_0x35b239,'revision_no':_0x1388e7,'year_level':_0xfefd8c,'sem':_0x2182f1,'course_id':_0x540bce,'course_desc':_0x3c78d7,'total_units':_0x5ead34,'lec_unit':_0x27aaff,'lab_unit':_0x245556});});});}}),_0x4d735a;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x17e0df){return new Promise((_0x577897,_0x34e47c)=>{const _0x3e2a3d=new FileReader();_0x3e2a3d['onload']=_0x4e7687=>{const _0x3900af=_0x4e7687['target']?.['result'];if(!_0x3900af){_0x34e47c(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x150a94=_0x2ad8be['read'](_0x3900af,{'type':'array'}),_0x212e6f=_0x150a94['SheetNames'][0x0];if(!_0x212e6f){_0x34e47c(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x3dca89=_0x150a94['Sheets'][_0x212e6f];if(!_0x3dca89){_0x34e47c(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x5f14ed=_0x2ad8be['utils']['sheet_to_csv'](_0x3dca89,{'strip':!![]}),_0x2653b6=_0x17e0df['name']['replace'](/\.[^/.]+$/,'.csv'),_0x496c55=new File([_0x5f14ed],_0x2653b6,{'type':'text/csv','lastModified':Date['now']()});_0x577897(_0x496c55);}catch(_0x1eef71){_0x34e47c(_0x1eef71);}},_0x3e2a3d['onerror']=()=>{_0x34e47c(new Error('File\x20reading\x20failed'));},_0x3e2a3d['readAsArrayBuffer'](_0x17e0df);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x161e1e,_0x554065){try{const _0x3fc73a=await convertToCSVFile(_0x554065),_0xb2dbde=await _0x3fc73a['text'](),_0x26492e=parseCurriculum(_0xb2dbde),_0x45f21=_0x1ec977['unparse'](_0x26492e),_0x19d6a1=new File([_0x45f21],_0x3fc73a['name'],{'type':'text/csv'}),_0x54cb50=new FormData();_0x54cb50['append']('csvFile',_0x19d6a1);const _0x1b2fb6=await fetch(_0x161e1e+'/curr-courses/upload',{'method':'POST','body':_0x54cb50});if(!_0x1b2fb6['ok']){const _0x1118d3=await _0x1b2fb6['json']();throw _0x1118d3;}return _0x1b2fb6['json']();}catch(_0xdcfe6a){throw _0xdcfe6a;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x50c30e){let _0x46c0d3='',_0x5208fa='';const _0x10de99=[],_0x20b1e9=_0x1ec977['parse'](_0x50c30e,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x13f832=_0x20b1e9['data'];for(let _0x6e3428=0x0;_0x6e3428<Math['min'](0x5,_0x13f832['length']);_0x6e3428++){const _0x81fac7=_0x13f832[_0x6e3428];if(_0x81fac7&&_0x81fac7['length']>0x0){const _0x324409=_0x81fac7[0x0]?.['toString']()||'',_0x517eb5=_0x324409['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x517eb5){_0x46c0d3=_0x517eb5[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x517eb5[0x2]){const _0x1f7103=_0x517eb5[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x1f7103&&_0x1f7103[0x2]&&_0x1f7103[0x4]&&(_0x5208fa=_0x1f7103[0x2]+_0x1f7103[0x4]);}}}}let _0x18bc5d=-1;for(let _0x25adc3=0x0;_0x25adc3<_0x13f832['length'];_0x25adc3++){const _0x257ffe=_0x13f832[_0x25adc3];if(_0x257ffe&&_0x257ffe['some'](_0x1e6c94=>_0x1e6c94?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x18bc5d=_0x25adc3;break;}}if(_0x18bc5d===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');for(let _0x4c1451=_0x18bc5d+0x1;_0x4c1451<_0x13f832['length'];_0x4c1451++){const _0x18016b=_0x13f832[_0x4c1451];if(!_0x18016b||_0x18016b['length']<0x8)continue;const _0x281039=_0x18016b[0x0]?.['toString']()['trim']()||'',_0x5d17bf=_0x18016b[0x1]?.['toString']()['trim']()||'',_0x5835dd=_0x18016b[0x2]?.['toString']()['trim']()||'',_0xabdc86=_0x18016b[0x3]?.['toString']()['trim']()||'',_0x2dda65=_0x18016b[0x4]?.['toString']()['trim']()||'',_0x5ae6dd=_0x18016b[0x5]?.['toString']()['trim']()||'',_0x1f4a6a=_0x18016b[0x6]?.['toString']()['trim']()||'',_0xd794b3=_0x18016b[0x7]?.['toString']()['trim']()||'';if(!_0x281039)continue;let _0x39876=0x0;const _0x14133c=_0xabdc86['match'](/(\d+)/);_0x14133c&&_0x14133c[0x1]&&(_0x39876=parseInt(_0x14133c[0x1],0xa));const _0x3e6e38={'sem':_0x46c0d3,'school_year':_0x5208fa,'code':_0x281039,'course_no':_0x5d17bf,'course_desc':_0x5835dd,'unit':_0x39876,'time':_0x2dda65,'days':_0x5ae6dd,'faculty':_0x1f4a6a,'room':_0xd794b3};_0x10de99['push'](_0x3e6e38);}return _0x10de99;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x1ff3e9,_0x452cf2){try{const _0x2c5c9f=await convertToCSVFile(_0x452cf2),_0x18f114=await _0x2c5c9f['text'](),_0xe394e=parseCourseOffering(_0x18f114),_0x239e2d=_0x1ec977['unparse'](_0xe394e),_0x3bb5b4=new File([_0x239e2d],_0x2c5c9f['name'],{'type':'text/csv'}),_0x46751a=new FormData();_0x46751a['append']('csvFile',_0x3bb5b4);const _0x466ef8=await fetch(_0x1ff3e9+'/course-offerings/upload',{'method':'POST','body':_0x46751a});if(!_0x466ef8['ok']){const _0x27b298=await _0x466ef8['json']();throw _0x27b298;}return _0x466ef8['json']();}catch(_0x2515e5){throw _0x2515e5;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x1ed2fb){if(!_0x1ed2fb)return {'performance_target':null,'passing_score':null};const _0x5cf0e2=_0x1ed2fb['match'](/\d+/g);return {'performance_target':_0x5cf0e2?.[0x0]?parseInt(_0x5cf0e2[0x0],0xa):null,'passing_score':_0x5cf0e2?.[0x1]?parseInt(_0x5cf0e2[0x1],0xa):null};}
|
|
15
15
|
|
|
16
|
-
function parseCOAEP(
|
|
16
|
+
function parseCOAEP(_0x3d0ad6){const _0xd36abf=_0x1ec977['parse'](_0x3d0ad6,{'skipEmptyLines':![]})['data'],_0x208827={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}};_0xd36abf['forEach'](_0x5afa6c=>{_0x5afa6c[0x1]?.['includes']('Name\x20of\x20Faculty:')&&(_0x208827['COAEP']['faculty']=_0x5afa6c[0x2]?.['trim']()||null);if(_0x5afa6c['includes']('School\x20Year')){const _0x2113c1=_0x5afa6c['indexOf']('School\x20Year');_0x208827['COAEP']['sy']=_0x5afa6c[_0x2113c1+0x1]?.['trim']()||null;}if(_0x5afa6c[0x1]?.['includes']('Course:')){const _0x40807c=_0x5afa6c[0x2]?.['trim']()||'';_0x208827['COAEP']['course']=_0x40807c||null;}if(_0x5afa6c['includes']('Semester')){const _0x57807a=_0x5afa6c['indexOf']('Semester'),_0x595633=_0x5afa6c[_0x57807a+0x1]?.['trim']()||'',_0xe05f3d=_0x595633['match'](/\d+/)?.[0x0];_0x208827['COAEP']['semester']=_0xe05f3d?parseInt(_0xe05f3d,0xa):null;}});let _0x3a9bce=null;return _0xd36abf['forEach'](_0x19ddd4=>{const _0x367f26=_0x19ddd4[0x0]?.['trim']()||'',_0xa2789e=_0x19ddd4[0x1]?.['trim']()||'',_0x2f1d79=_0x19ddd4[0x3]?.['trim']()||'';if(_0x367f26&&/^\d+$/['test'](_0x367f26)){_0x3a9bce&&_0x208827['COAEP']['co']['push'](_0x3a9bce);const _0xcca40d=_0xa2789e,_0x374e50=_0xcca40d['trim']()['split'](/\s+/)[0x0]??'';_0x3a9bce={'statement':_0xcca40d,'verb':_0x374e50,'ilo':[]};}if(_0x3a9bce&&_0x2f1d79){const _0x569b62=_0x2f1d79['replace'](/^ILO\d+\s*/,'')['replace'](/\s+/g,'\x20')['trim'](),_0x3eb01e=_0x19ddd4[0x4]?.['replace'](/\s+/g,'\x20')['trim']()||'',_0x416095=_0x19ddd4[0x5]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x20646b,passing_score:_0x10f6c3}=performaceTarget(_0x416095);_0x3a9bce['ilo']['push']({'statement':_0x569b62,'verb':_0x569b62['split'](/\s+/)[0x0]??'','assessment_tool':_0x3eb01e,'performance_target':_0x20646b,'passing_score':_0x10f6c3});}}),_0x3a9bce&&_0x208827['COAEP']['co']['push'](_0x3a9bce),_0x208827;}
|
|
17
17
|
|
|
18
|
-
async function uploadCOAEP(
|
|
18
|
+
async function uploadCOAEP(_0x5cd3f0,_0x1413b9,_0x1b884e){try{const _0x1fb723=await convertToCSVFile(_0x1413b9),_0x1ea0fc=await _0x1fb723['text'](),_0x1b28f6=parseCOAEP(_0x1ea0fc),_0x1b172d=await fetch(_0x5cd3f0+'/coaeps/upload?course_id='+_0x1b884e,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x1b28f6)});if(!_0x1b172d['ok']){const _0x27a797=await _0x1b172d['json']();throw _0x27a797;}return _0x1b172d['json']();}catch(_0x581be8){throw _0x581be8;}}
|
|
19
19
|
|
|
20
|
-
async function uploadEnrolledStudent(
|
|
20
|
+
async function uploadEnrolledStudent(_0x3b177a,_0x3cc3af){try{const _0xa893ff=await convertToCSVFile(_0x3cc3af),_0x5e1d38=new FormData();_0x5e1d38['append']('csvFile',_0xa893ff);const _0x4d8c62=await fetch(_0x3b177a+'/enrolled-students/upload',{'method':'POST','body':_0x5e1d38});if(!_0x4d8c62['ok']){const _0x557d77=await _0x4d8c62['json']();throw _0x557d77;}return _0x4d8c62['json']();}catch(_0x2eca2e){throw _0x2eca2e;}}
|
|
21
21
|
|
|
22
|
-
function parseClassList(
|
|
22
|
+
function parseClassList(_0x532f23){const _0x2e6446=_0x1ec977['parse'](_0x532f23,{'skipEmptyLines':!![]})['data'];let _0x1eed58='',_0x2e1d64='',_0x48e257='';const _0x4fd6dc=[];return _0x2e6446['forEach'](_0x3e15ab=>{const _0x4da2dd=_0x3e15ab['map'](_0x58e655=>(_0x58e655??'')['toString']()['trim']()),_0x26c150=_0x4da2dd[0x0]??'';if(_0x26c150['startsWith']('Course\x20No:')){const _0x389546=_0x26c150['replace']('Course\x20No:','')['trim'](),_0x326c25=_0x389546['split'](/\s+/);_0x48e257=_0x326c25[0x0]??'';const [_0xd30e0c,_0xaf4d0e]=(_0x326c25[0x1]??'')['split']('-');_0x2e1d64=_0xd30e0c??'';const _0x2db8c2=(_0xaf4d0e??'')['match'](/[a-z]$/);_0x1eed58=_0x2db8c2?_0x2db8c2[0x0]:'';}if(/^\d+$/['test'](_0x26c150)){const _0x6776d6=_0x4da2dd[0x2]??'';_0x4fd6dc['push']({'subj_code':_0x48e257,'student_no':_0x6776d6,'course_id':_0x2e1d64,'section':_0x1eed58});}}),{'enrolledCourses':_0x4fd6dc};}
|
|
23
23
|
|
|
24
|
-
async function uploadClassList(
|
|
24
|
+
async function uploadClassList(_0x37d786,_0x2a2d1d,_0x2c9814,_0x11255f){try{const _0x34c93f=await convertToCSVFile(_0x2a2d1d),_0x3ddefd=await _0x34c93f['text'](),_0x53eaaa=parseClassList(_0x3ddefd),_0x1b1dbe='subj_code='+_0x2c9814+'&period_id='+_0x11255f,_0x5b218b=await fetch(_0x37d786+'/enrolled-courses/upload?'+_0x1b1dbe,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x53eaaa)});if(!_0x5b218b['ok']){const _0x21e8a6=await _0x5b218b['json']();throw _0x21e8a6;}return _0x5b218b['json']();}catch(_0x823b59){throw _0x823b59;}}
|
|
25
25
|
|
|
26
|
-
function parseAssessmentCsv(
|
|
26
|
+
function parseAssessmentCsv(_0x1f561f){const {data:_0x139037}=_0x1ec977['parse'](_0x1f561f,{'skipEmptyLines':!![]}),_0x1cbed5=_0x139037['filter'](_0x5da998=>_0x5da998['length']>0x0),_0x521524=_0x1cbed5['find'](_0x15608a=>_0x15608a['some'](_0xee86dd=>_0xee86dd?.['includes']('Faculty'))),_0x4afa7f=_0x521524?_0x521524['findIndex'](_0x4c234f=>_0x4c234f?.['includes']('Faculty')):-1,_0x4a00a2=_0x4afa7f!==-1&&_0x521524?_0x521524[_0x4afa7f+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x3a36c3=_0x1cbed5['find'](_0x37701f=>_0x37701f['some'](_0x6511f1=>_0x6511f1?.['includes']('Semester'))),_0x2a9d8b=_0x3a36c3?_0x3a36c3['findIndex'](_0x26c52f=>_0x26c52f?.['includes']('Semester')):-1,_0x4bdf4f=_0x2a9d8b!==-1&&_0x3a36c3?_0x3a36c3[_0x2a9d8b+0x2]?.['trim']()??'':'',_0x3eefd7=_0x4bdf4f['includes']('1st')?0x1:_0x4bdf4f['includes']('2nd')?0x2:0x0,_0x427219=_0x1cbed5['find'](_0x21796f=>_0x21796f['some'](_0x49ff80=>_0x49ff80?.['includes']('Course\x20&\x20Sec'))),_0x5b4c5f=_0x427219?_0x427219['findIndex'](_0x3d69c0=>_0x3d69c0?.['includes']('Course\x20&\x20Sec')):-1,_0x1ceca6=_0x5b4c5f!==-1&&_0x427219?_0x427219[_0x5b4c5f+0x2]?.['trim']()??'':'';let _0x5442ef='',_0x212197='';if(_0x1ceca6){const _0x50795e=_0x1ceca6['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x50795e&&(_0x5442ef=_0x50795e[0x1]??'',_0x50795e[0x2]&&(_0x212197=_0x50795e[0x2]['replace'](/^OC/i,'')));}const _0x31a231=_0x1cbed5['find'](_0x3984a1=>_0x3984a1['some'](_0xd83812=>_0xd83812?.['includes']('School\x20Year'))),_0x5a1d15=_0x31a231?_0x31a231['findIndex'](_0x9f6ee0=>_0x9f6ee0?.['includes']('School\x20Year')):-1,_0x3ec38f=_0x5a1d15!==-1&&_0x31a231?_0x31a231[_0x5a1d15+0x2]?.['trim']()??'':'';let _0x3e8d79=0x0;if(_0x3ec38f){const _0x1ad27d=_0x3ec38f['match'](/(\d{4})-(\d{4})/);if(_0x1ad27d){const _0x5d3e4f=(_0x1ad27d[0x1]??'')['slice'](0x2),_0x3d5b78=(_0x1ad27d[0x2]??'')['slice'](0x2);_0x3e8d79=parseInt(_0x5d3e4f+_0x3d5b78,0xa);}}const _0x441762={'faculty':_0x4a00a2,'course':_0x5442ef,'section':_0x212197,'semester':_0x3eefd7,'sy':_0x3e8d79},_0x5344a9=_0x1cbed5['findIndex'](_0xbf2299=>_0xbf2299['some'](_0xdee8ed=>_0xdee8ed?.['trim']()==='CO\x20#'));if(_0x5344a9===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x2e2492=_0x1cbed5[_0x5344a9+0x1];if(!_0x2e2492)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x49c779={};let _0x5303a7=0x1,_0x47361f=0x1;for(let _0x33ad10=0x3;_0x33ad10<_0x2e2492['length'];_0x33ad10++){const _0x14e2e1=_0x2e2492[_0x33ad10];if(!_0x14e2e1)continue;const _0x32bf22='co'+_0x5303a7;if(!_0x49c779[_0x32bf22])_0x49c779[_0x32bf22]=[];_0x49c779[_0x32bf22]['push']('ilo'+_0x47361f),_0x47361f++,_0x47361f>0x3&&(_0x5303a7++,_0x47361f=0x1);}const _0x416559=_0x1cbed5['findIndex'](_0x5c425e=>_0x5c425e['includes']('Name\x20of\x20Students'));if(_0x416559===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x566cdc=_0x1cbed5[_0x416559];if(!_0x566cdc)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x293c5f=_0x566cdc['findIndex'](_0x52ec58=>_0x52ec58?.['includes']('Name\x20of\x20Students'));if(_0x293c5f===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0xa24edb=_0x293c5f+0x2,_0x35243a=[];for(let _0x3ff248=_0x416559+0x1;_0x3ff248<_0x1cbed5['length'];_0x3ff248++){const _0x597023=_0x1cbed5[_0x3ff248];if(!_0x597023)continue;if(_0x597023['some'](_0x193295=>_0x193295?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x193295?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x193295?.['toUpperCase']()['includes']('INACTIVE')||_0x193295?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x597023[_0x293c5f])continue;const _0x5af3ef=_0x597023[_0x293c5f]['replace'](/"/g,'')['trim'](),_0xd5834b=_0x597023['slice'](_0xa24edb)['map'](_0x1f7be8=>_0x1f7be8===null?null:!isNaN(Number(_0x1f7be8))?parseFloat(_0x1f7be8):0x0);let _0x44ab17=0x0;const _0x350fde={};Object['entries'](_0x49c779)['forEach'](([_0x50daf5,_0x20d3cd])=>{const _0x1545bd={};_0x20d3cd['forEach'](_0x5edc62=>{_0x1545bd[_0x5edc62]=_0xd5834b[_0x44ab17]??0x0,_0x44ab17++;}),_0x350fde[_0x50daf5]={'transmuted_score':_0x1545bd};}),_0x35243a['push']({'student_name':_0x5af3ef,'coaep':_0x350fde});}const _0x4ebd4a=_0x1cbed5['find'](_0x4e79eb=>_0x4e79eb['some'](_0x28715a=>_0x28715a?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x572ca1=_0x1cbed5['find'](_0xfa41d4=>_0xfa41d4['some'](_0x42580a=>_0x42580a?.['includes']('AVERAGE'))),_0x4e3a74=_0x4ebd4a?_0x4ebd4a['slice'](_0xa24edb)['map'](_0x31dbc8=>_0x31dbc8&&!isNaN(Number(_0x31dbc8))?parseInt(_0x31dbc8):0x0):[],_0x298218=_0x572ca1?_0x572ca1['slice'](_0xa24edb)['map'](_0x254bfd=>_0x254bfd&&_0x254bfd!=='#DIV/0!'&&!isNaN(Number(_0x254bfd))?parseInt(_0x254bfd):0x0):[],_0x40e5f9={};let _0x2e0295=0x0;return Object['entries'](_0x49c779)['forEach'](([_0x412c98,_0xd4ce86])=>{if(!_0x40e5f9[_0x412c98])_0x40e5f9[_0x412c98]={};_0xd4ce86['forEach'](_0x24e736=>{_0x40e5f9[_0x412c98][_0x24e736]={'achievedMinimum':_0x4e3a74[_0x2e0295]??0x0,'average':_0x298218[_0x2e0295]??0x0},_0x2e0295++;});}),{'assessmentData':{'classAssignment':_0x441762,'student':_0x35243a,'total':_0x40e5f9}};}
|
|
27
27
|
|
|
28
|
-
async function uploadAssessmentData(
|
|
28
|
+
async function uploadAssessmentData(_0x1af8cc,_0x525b96){try{const _0x4f5e28=await convertToCSVFile(_0x525b96),_0x101d3c=await _0x4f5e28['text'](),_0x3f16d6=parseAssessmentCsv(_0x101d3c),_0x4491ca=await fetch(_0x1af8cc+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x3f16d6)});if(!_0x4491ca['ok']){const _0x398a47=await _0x4491ca['json']();throw _0x398a47;}return _0x4491ca['json']();}catch(_0x48f55a){throw _0x48f55a;}}
|
|
29
29
|
|
|
30
|
-
class Client{['BASE_URL'];constructor(
|
|
30
|
+
class Client{['BASE_URL'];constructor(_0x269653){this['BASE_URL']=_0x269653;}['Parser'](){return {'curriculum':async _0x50aeaa=>{const _0x89b877=await uploadCurriculum(this['BASE_URL'],_0x50aeaa);return _0x89b877;},'courseOffering':async _0x88466c=>{const _0x1b707c=await uploadCourseOffering(this['BASE_URL'],_0x88466c);return _0x1b707c;},'coaep':async(_0x2565e2,_0x2e53db)=>{const _0x4bff7d=await uploadCOAEP(this['BASE_URL'],_0x2565e2,_0x2e53db);return _0x4bff7d;},'enrolledStudent':async _0x52d011=>{const _0x133fd9=await uploadEnrolledStudent(this['BASE_URL'],_0x52d011);return _0x133fd9;},'classlist':async(_0x340979,_0x20e7d2,_0x1c4b49)=>{const _0x5d8fc6=await uploadClassList(this['BASE_URL'],_0x340979,_0x20e7d2,_0x1c4b49);return _0x5d8fc6;},'assessmentData':async _0x4db1fb=>{const _0xbbd613=await uploadAssessmentData(this['BASE_URL'],_0x4db1fb);return _0xbbd613;}};}}
|
|
31
31
|
|
|
32
32
|
export { Client as default };
|