@obe-loms/coms-parser 1.6.11 → 1.6.13
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/DataTable/models/CoaepDT.d.ts +0 -14
- package/DataTable/models/DataTable.d.ts +12 -0
- package/bundle.js +30 -30
- package/package.json +1 -1
|
@@ -3,21 +3,7 @@ import { DataTable } from "./DataTable";
|
|
|
3
3
|
import { ParserResult } from "../types/ParserResult";
|
|
4
4
|
import DataTableException from "../types/DataTableException";
|
|
5
5
|
import { CoaepRow } from "../types/CoaepDTRow";
|
|
6
|
-
/**
|
|
7
|
-
* Represents a row in the COAEP DataTable.
|
|
8
|
-
*
|
|
9
|
-
* @return row - Represents a full row of the internal table of the COAEP Data Table
|
|
10
|
-
* @return {string|null } row [0] - Co Number, Nullable
|
|
11
|
-
* @return {[string | null, string | null, string | null, string | null] | null} row [1] - [CO Cognitive Level, Taxonomy Level, Verb, Statement], nullable
|
|
12
|
-
* @return {[string | null, string | null, string | null, string | null] | null} row [2] - [ILO Cognitive Level, Taxonomy Level, Verb, Statement]
|
|
13
|
-
* @return {string|null } row [3] - Assessment Tool
|
|
14
|
-
* @return {[number | null, number | null] | null} row [4] - [PerfTarget, PassingScore]
|
|
15
|
-
*/
|
|
16
6
|
export declare class CoaepDT extends DataTable<COAEP, CoaepRow> {
|
|
17
|
-
faculty: string | null;
|
|
18
|
-
course: string | null;
|
|
19
|
-
sy: string | null;
|
|
20
|
-
semester: number | null;
|
|
21
7
|
/**
|
|
22
8
|
* Initializes the DataTable for COAEP.
|
|
23
9
|
* Also sets up custom validators for the DataTable.
|
|
@@ -5,12 +5,14 @@ export type DataTableInfo<RowType = any[]> = {
|
|
|
5
5
|
name: string;
|
|
6
6
|
headers: string[];
|
|
7
7
|
table: RowType[];
|
|
8
|
+
state: Record<string, any>;
|
|
8
9
|
};
|
|
9
10
|
export declare abstract class DataTable<Obj, RowType> {
|
|
10
11
|
protected name: string;
|
|
11
12
|
protected headers: string[];
|
|
12
13
|
protected table: RowType[];
|
|
13
14
|
protected validators: DTValidator<this, Obj>[];
|
|
15
|
+
protected state: Record<string, any>;
|
|
14
16
|
/**
|
|
15
17
|
* Creates a new DataTable, initializes default values.
|
|
16
18
|
* If no name is given, the name defaults to "DataTable".
|
|
@@ -32,6 +34,16 @@ export declare abstract class DataTable<Obj, RowType> {
|
|
|
32
34
|
* @returns array of strings
|
|
33
35
|
*/
|
|
34
36
|
getHeaders(): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Returns the state of the DataTable.
|
|
39
|
+
* @returns Record<string, any>
|
|
40
|
+
*/
|
|
41
|
+
getState(): Record<string, any>;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the state of the DataTable.
|
|
44
|
+
* @param state - Record<string, any>
|
|
45
|
+
*/
|
|
46
|
+
setState: (state: Record<string, any>) => Promise<void>;
|
|
35
47
|
/**
|
|
36
48
|
* Gets the DataTable from the current object.
|
|
37
49
|
* @returns ParserResult<DataTableInfo>
|
package/bundle.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x2308bc from 'papaparse';
|
|
2
|
+
import * as _0x44c95c from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x2a031d){let _0x5d303b='',_0x47847e='',_0x21358d=0x0,_0x4bd7bc=null;const _0x5736fa=[];return _0x2308bc['parse'](_0x2a031d,{'skipEmptyLines':!![],'complete':_0x56dc61=>{_0x56dc61['data']['forEach'](_0x218c67=>{const _0x1a5188=_0x218c67['map'](_0x19b53f=>(_0x19b53f??'')['toString']()['trim']()),_0x17c3ef=_0x1a5188[0x0]??'';if(_0x17c3ef['includes']('Rev#')){const _0x3bb3f4=_0x17c3ef['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x3bb3f4&&(_0x5d303b=_0x3bb3f4[0x1]?.['trim']()??'',_0x47847e=_0x3bb3f4[0x2]?.['trim']()??'',_0x21358d=parseInt(_0x3bb3f4[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x17c3ef)){_0x4bd7bc=0x1;return;}if(/SECOND YEAR/i['test'](_0x17c3ef)){_0x4bd7bc=0x2;return;}if(/THIRD YEAR/i['test'](_0x17c3ef)){_0x4bd7bc=0x3;return;}if(/FOURTH YEAR/i['test'](_0x17c3ef)){_0x4bd7bc=0x4;return;}if(/FIFTH YEAR/i['test'](_0x17c3ef)){_0x4bd7bc=0x5;return;}if(/First Semester/i['test'](_0x17c3ef)||/Second Semester/i['test'](_0x17c3ef)||/Summer/i['test'](_0x17c3ef))return;const _0x533d52=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x533d52['forEach'](({sem:_0xbaccab,offset:_0x118e79})=>{const _0x5e4c3a=_0x1a5188[_0x118e79]??'',_0x9d14db=_0x1a5188[_0x118e79+0x1]??'',_0x19d768=_0x1a5188[_0x118e79+0x2]??'',_0x5bb244=_0x1a5188[_0x118e79+0x3]??'',_0x35b5e4=_0x1a5188[_0x118e79+0x4]??'';_0x5e4c3a&&_0x4bd7bc&&_0x5736fa['push']({'curr_id':_0x5d303b,'program_name':_0x47847e,'revision_no':_0x21358d,'year_level':_0x4bd7bc,'sem':_0xbaccab,'course_id':_0x5e4c3a,'course_desc':_0x9d14db,'total_units':_0x19d768,'lec_unit':_0x5bb244,'lab_unit':_0x35b5e4});});});}}),_0x5736fa;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x5c50f5,_0x1d38ab){return new Promise((_0x53597f,_0x5985c5)=>{const _0x47df1f=new FileReader();_0x47df1f['onload']=_0x4ad3dc=>{const _0x15dbe2=_0x4ad3dc['target']?.['result'];if(!_0x15dbe2){_0x5985c5(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x2ad319=_0x44c95c['read'](_0x15dbe2,{'type':'array'});!_0x1d38ab&&(_0x1d38ab=_0x2ad319['SheetNames'][0x0]);if(!_0x1d38ab){_0x5985c5(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x5dbb00=_0x2ad319['Sheets'][_0x1d38ab];if(!_0x5dbb00){_0x5985c5(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x4c2f8c=_0x44c95c['utils']['sheet_to_csv'](_0x5dbb00,{'strip':!![]}),_0x5a6088=_0x5c50f5['name']['replace'](/\.[^/.]+$/,'.csv'),_0x42c907=new File([_0x4c2f8c],_0x5a6088,{'type':'text/csv','lastModified':Date['now']()});_0x53597f(_0x42c907);}catch(_0x41e105){_0x5985c5(_0x41e105);}},_0x47df1f['onerror']=()=>{_0x5985c5(new Error('File\x20reading\x20failed'));},_0x47df1f['readAsArrayBuffer'](_0x5c50f5);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x179f30,_0x387525){try{const _0x1748c8=await convertToCSVFile(_0x387525),_0x5c1be4=await _0x1748c8['text'](),_0xfdaec=parseCurriculum(_0x5c1be4),_0x316817=_0x2308bc['unparse'](_0xfdaec),_0x1044cb=new File([_0x316817],_0x1748c8['name'],{'type':'text/csv'}),_0x4064bf=new FormData();_0x4064bf['append']('csvFile',_0x1044cb);const _0x3100f9=await fetch(_0x179f30+'/curr-courses/upload',{'method':'POST','body':_0x4064bf});if(!_0x3100f9['ok']){const _0x3795e7=await _0x3100f9['json']();throw _0x3795e7;}return _0x3100f9['json']();}catch(_0x8c4931){throw _0x8c4931;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x2602bd){let _0x38c8e7='',_0x12c1db='';const _0x1e253e=[],_0x4a6e0a=_0x2308bc['parse'](_0x2602bd,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0xb92462=_0x4a6e0a['data'];for(let _0x5badde=0x0;_0x5badde<Math['min'](0x5,_0xb92462['length']);_0x5badde++){const _0x5659df=_0xb92462[_0x5badde];if(_0x5659df&&_0x5659df['length']>0x0){const _0x321d09=_0x5659df[0x0]?.['toString']()||'',_0x5eede3=_0x321d09['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x5eede3){_0x38c8e7=_0x5eede3[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x5eede3[0x2]){const _0x26ec14=_0x5eede3[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x26ec14&&_0x26ec14[0x2]&&_0x26ec14[0x4]&&(_0x12c1db=_0x26ec14[0x2]+_0x26ec14[0x4]);}}}}let _0x5e167c=-1;for(let _0x3f7aa6=0x0;_0x3f7aa6<_0xb92462['length'];_0x3f7aa6++){const _0x216143=_0xb92462[_0x3f7aa6];if(_0x216143&&_0x216143['some'](_0x17d882=>_0x17d882?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x5e167c=_0x3f7aa6;break;}}if(_0x5e167c===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x5b7f38={'code':'','description':'','unit':0x0};for(let _0xfd0aa2=_0x5e167c+0x1;_0xfd0aa2<_0xb92462['length'];_0xfd0aa2++){const _0x41dbc0=_0xb92462[_0xfd0aa2];if(!_0x41dbc0||_0x41dbc0['length']<0x8)continue;const _0x5cee8b=_0x41dbc0[0x1]?.['toString']()['trim']()||'',_0x29066a=_0x41dbc0[0x4]?.['toString']()['trim']()||'',_0x49dd36=_0x41dbc0[0x5]?.['toString']()['trim']()||'',_0x3e2d5c=_0x41dbc0[0x6]?.['toString']()['trim']()||'',_0x437ae4=_0x41dbc0[0x7]?.['toString']()['trim']()||'',_0xef0d43=_0x41dbc0[0x3]?.['toString']()['trim']()||'';let _0xf4c481=_0x41dbc0[0x0]?.['toString']()['trim']()||'',_0x682762=_0x41dbc0[0x2]?.['toString']()['trim']()||'';if(!_0x5cee8b)continue;if(!_0xf4c481)_0xf4c481=_0x5b7f38['code'];if(!_0x682762)_0x682762=_0x5b7f38['description'];let _0x146b53=_0x5b7f38['unit'];if(_0xef0d43){const _0x5aeaf0=_0xef0d43['match'](/(\d+)/);_0x5aeaf0&&_0x5aeaf0[0x1]&&(_0x146b53=parseInt(_0x5aeaf0[0x1],0xa));}const _0x2ed2a6={'sem':_0x38c8e7,'school_year':_0x12c1db,'code':_0xf4c481,'course_no':_0x5cee8b,'course_desc':_0x682762,'unit':_0x146b53,'time':_0x29066a,'days':_0x49dd36,'faculty':_0x3e2d5c,'room':_0x437ae4};_0x5b7f38['code']=_0xf4c481,_0x5b7f38['description']=_0x682762,_0x5b7f38['unit']=_0x146b53,_0x1e253e['push'](_0x2ed2a6);}return _0x1e253e;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x424e99,_0x5410fb){try{const _0x4ce22e=await convertToCSVFile(_0x5410fb),_0x2f547b=await _0x4ce22e['text'](),_0x70071f=parseCourseOffering(_0x2f547b),_0x14e177=_0x2308bc['unparse'](_0x70071f),_0x4022ea=new File([_0x14e177],_0x4ce22e['name'],{'type':'text/csv'}),_0x4907fd=new FormData();_0x4907fd['append']('csvFile',_0x4022ea);const _0x2d0bfc=await fetch(_0x424e99+'/course-offerings/upload',{'method':'POST','body':_0x4907fd});if(!_0x2d0bfc['ok']){const _0x1dcfc7=await _0x2d0bfc['json']();throw _0x1dcfc7;}return _0x2d0bfc['json']();}catch(_0x1c4cf1){throw _0x1c4cf1;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x604b6e){if(!_0x604b6e)return {'performance_target':null,'passing_score':null};const _0x5f0cec=_0x604b6e['match'](/\d+/g);return {'performance_target':_0x5f0cec?.[0x0]?parseInt(_0x5f0cec[0x0],0xa):null,'passing_score':_0x5f0cec?.[0x1]?parseInt(_0x5f0cec[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(_0x4995aa){let _0x33289c={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x537301=0x0;_0x537301<Math['min'](_0x4995aa['length'],0x14);_0x537301++){const _0x289e2d=(_0x4995aa[_0x537301]??[])['map'](_0x119e37=>_0x119e37['toLowerCase']()['trim']()),_0x43c37b=_0x289e2d['findIndex'](_0x528bbe=>HEADERS$1['co']['some'](_0xc1919=>_0x528bbe['includes'](_0xc1919))),_0x1368b4=_0x289e2d['findIndex'](_0x15ba9a=>HEADERS$1['ilo']['some'](_0x4aba5b=>_0x15ba9a['includes'](_0x4aba5b))),_0x579193=_0x289e2d['findIndex'](_0x39d03a=>HEADERS$1['assessTool']['some'](_0x131d8a=>_0x39d03a['includes'](_0x131d8a))),_0x450b31=_0x289e2d['findIndex'](_0x2c5ebb=>HEADERS$1['perfTarget']['some'](_0x284b25=>_0x2c5ebb['includes'](_0x284b25))),_0x937bc5=[_0x43c37b,_0x1368b4,_0x579193,_0x450b31]['filter'](_0x19b0e7=>_0x19b0e7!==-1)['length'];if(_0x937bc5>=0x3){_0x33289c={'headerRowIndex':_0x537301,'coIdx':_0x43c37b,'iloIdx':_0x1368b4,'assessToolIdx':_0x579193,'perfTargetIdx':_0x450b31};break;}}return _0x33289c;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x19c36c){const _0x43090d={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x19c36c['trim']()},_0x2d32ae=_0x19c36c['match'](/^\((I|E|D)\)/);_0x2d32ae&&(_0x43090d['cognitive_level']=_0x2d32ae[0x1],_0x43090d['rest']=_0x19c36c['slice'](_0x2d32ae[0x0]['length'])['trim']());const _0x1899d3=_0x43090d['rest']?.['match'](/^(.*?)\:/);_0x1899d3&&(_0x43090d['taxonomy_level']=_0x1899d3[0x1]['trim']()['toLowerCase']()||null,_0x43090d['rest']=_0x43090d['rest']?.['slice'](_0x1899d3[0x0]['length'])['trim']()||null);const _0x42d216=_0x43090d['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x42d216)_0x43090d['verb']=_0x42d216[0x1]['trim']()['toLowerCase']()||null;else {const _0x5403b7=_0x43090d['rest']?.['match'](/^\w+/);if(_0x5403b7)_0x43090d['verb']=_0x5403b7[0x0]['trim']()['toLowerCase']()||null;}return _0x43090d;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x5eac9d){const _0x3481e5=_0x2308bc['parse'](_0x5eac9d,{'skipEmptyLines':![]})['data'],_0x17a97a={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0xf04bdb,coIdx:_0x46dc27,iloIdx:_0x7633d,assessToolIdx:_0x416e4a,perfTargetIdx:_0x19ff64}=getCoaepHeader(_0x3481e5);if(_0xf04bdb===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x3481e5['forEach'](_0x1facf8=>{const _0x16fe68=_0x1facf8['indexOf']('Name\x20of\x20Faculty:'),_0x37537d=_0x1facf8['indexOf']('School\x20Year'),_0x453e2b=_0x1facf8['indexOf']('Course:'),_0x37fe58=_0x1facf8['indexOf']('Semester');_0x16fe68!==-1&&(_0x17a97a['COAEP']['faculty']=_0x1facf8[_0x16fe68+0x1]?.['trim']()||_0x17a97a['COAEP']['faculty']);_0x37537d!==-1&&(_0x17a97a['COAEP']['sy']=_0x1facf8[_0x37537d+0x1]?.['trim']()||_0x17a97a['COAEP']['sy']);_0x453e2b!==-1&&(_0x17a97a['COAEP']['course']=_0x1facf8[_0x453e2b+0x1]?.['trim']()||_0x17a97a['COAEP']['course']);if(_0x37fe58!==-1){const _0x46cce9=_0x1facf8[_0x37fe58+0x1]?.['trim']()||'',_0x21224e=_0x46cce9['match'](/\d+/)?.[0x0];_0x17a97a['COAEP']['semester']=_0x21224e?parseInt(_0x21224e,0xa):_0x17a97a['COAEP']['semester'];}});let _0xf23d5a=null;return _0x3481e5['forEach']((_0x3489fa,_0x207b3a)=>{if(_0x207b3a<=_0xf04bdb)return;let _0x956d74=_0x3489fa[_0x46dc27-0x1]?.['trim']()||'',_0x286639=_0x3489fa[_0x46dc27]?.['trim']()||'';/^\d+$/['test'](_0x3489fa[_0x46dc27]?.['trim']()||'')&&(_0x956d74=_0x3489fa[_0x46dc27]?.['trim']()||'',_0x286639=_0x3489fa[_0x46dc27+0x1]?.['trim']()||'');const _0x107be4=_0x3489fa[_0x7633d]?.['trim']()||'',_0x16b3f4=_0x3489fa[_0x416e4a]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x8bc568=_0x3489fa[_0x19ff64]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x956d74&&/^\d+$/['test'](_0x956d74)){_0xf23d5a&&_0x17a97a['COAEP']['co']['push'](_0xf23d5a);const _0xaff605=_0x286639,{verb:_0x34081b,cognitive_level:_0x439db7,taxonomy_level:_0x18c4a6}=extractFromObjective(_0xaff605);if(!_0x34081b)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x956d74+'\x20is\x20in\x20the\x20correct\x20format.'};_0xf23d5a={'statement':_0xaff605,'ilo':[],'verb':_0x34081b,'cognitive_level':_0x439db7,'taxonomy_level':_0x18c4a6};}if(_0xf23d5a&&_0x107be4&&_0x8bc568){const _0x1fce4f=_0x107be4['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x1fce4f['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x1fce4f['length']<0xa)return;let _0x58d2b3=_0x16b3f4;if(!_0x58d2b3&&_0x1fce4f['includes'](':')){const _0x2a3e03=_0x1fce4f['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x2a3e03&&(_0x58d2b3=_0x2a3e03[0x1]?.['trim']()||'');}const {performance_target:_0x2dbea4,passing_score:_0x6a6e4e}=performaceTarget(_0x8bc568),{verb:_0x2646b5,cognitive_level:_0x5ba858,taxonomy_level:_0x90da77}=extractFromObjective(_0x1fce4f);_0xf23d5a['ilo']['push']({'statement':_0x1fce4f,'assessment_tool':_0x58d2b3,'performance_target':_0x2dbea4,'passing_score':_0x6a6e4e,'verb':_0x2646b5,'cognitive_level':_0x5ba858,'taxonomy_level':_0x90da77});}}),_0xf23d5a&&_0x17a97a['COAEP']['co']['push'](_0xf23d5a),_0x17a97a;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x8102b8,_0x51a119,_0x4b7da7){try{const _0x53c6d5=await convertToCSVFile(_0x51a119),_0x28a150=await _0x53c6d5['text'](),_0x551d08=parseCOAEP(_0x28a150);console['log'](_0x551d08);const _0x56faff=await fetch(_0x8102b8+'/coaeps/upload?course_id='+_0x4b7da7,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x551d08)});if(!_0x56faff['ok']){const _0x329273=await _0x56faff['json']();throw _0x329273;}return _0x56faff['json']();}catch(_0x41be23){throw _0x41be23;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x323dbb,_0x43f292){try{const _0x5c39bb=await convertToCSVFile(_0x43f292),_0x43ce43=new FormData();_0x43ce43['append']('csvFile',_0x5c39bb);const _0xf74e7b=await fetch(_0x323dbb+'/enrolled-students/upload',{'method':'POST','body':_0x43ce43});if(!_0xf74e7b['ok']){const _0x387a2d=await _0xf74e7b['json']();throw _0x387a2d;}return _0xf74e7b['json']();}catch(_0x4bcdfd){throw _0x4bcdfd;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x248509){const _0x304a0f=_0x2308bc['parse'](_0x248509,{'skipEmptyLines':!![]})['data'];let _0x389d8f='',_0x2fdb64='',_0x1c7058='';const _0x177a56=[];return _0x304a0f['forEach'](_0x311596=>{const _0x38e030=_0x311596['map'](_0x23e5e9=>(_0x23e5e9??'')['toString']()['trim']()),_0x2f1505=_0x38e030[0x0]??'';if(_0x2f1505['startsWith']('Course\x20No:')){const _0x570775=_0x2f1505['replace']('Course\x20No:','')['trim'](),_0x166df0=_0x570775['split'](/\s+/);_0x1c7058=_0x166df0[0x0]??'';const [_0x1689a2,_0x166c7b]=(_0x166df0[0x1]??'')['split']('-');_0x2fdb64=_0x1689a2??'';const _0x1a4249=(_0x166c7b??'')['match'](/[a-z]$/);_0x389d8f=_0x1a4249?_0x1a4249[0x0]:'';}if(/^\d+$/['test'](_0x2f1505)){const _0x4c5d76=_0x38e030[0x2]??'';_0x177a56['push']({'subj_code':_0x1c7058,'student_no':_0x4c5d76,'course_id':_0x2fdb64,'section':_0x389d8f});}}),{'enrolledCourses':_0x177a56};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x311b42,_0x4337cc,_0x1ae747,_0x3c1b94){try{const _0x3c2f80=await convertToCSVFile(_0x4337cc),_0x3caa51=await _0x3c2f80['text'](),_0x3d6f4d=parseClassList(_0x3caa51),_0x345653='subj_code='+_0x1ae747+'&period_id='+_0x3c1b94,_0x640942=await fetch(_0x311b42+'/enrolled-courses/upload?'+_0x345653,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x3d6f4d)});if(!_0x640942['ok']){const _0x36cfeb=await _0x640942['json']();throw _0x36cfeb;}return _0x640942['json']();}catch(_0x327d17){throw _0x327d17;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x14894a){const {data:_0x4d41bf}=_0x2308bc['parse'](_0x14894a,{'skipEmptyLines':!![]}),_0x5b4459=_0x4d41bf['filter'](_0x3729e3=>_0x3729e3['length']>0x0),_0x23fa3f=_0x5b4459['find'](_0x200ed1=>_0x200ed1['some'](_0x306713=>_0x306713?.['includes']('Faculty'))),_0x127201=_0x23fa3f?_0x23fa3f['findIndex'](_0xb3e88f=>_0xb3e88f?.['includes']('Faculty')):-1,_0x42c331=_0x127201!==-1&&_0x23fa3f?_0x23fa3f[_0x127201+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0xdc838b=_0x5b4459['find'](_0x45cb9f=>_0x45cb9f['some'](_0xc201f2=>_0xc201f2?.['includes']('Semester'))),_0x478d17=_0xdc838b?_0xdc838b['findIndex'](_0x3ca58b=>_0x3ca58b?.['includes']('Semester')):-1,_0x1a81f3=_0x478d17!==-1&&_0xdc838b?_0xdc838b[_0x478d17+0x2]?.['trim']()??'':'',_0x39d90a=_0x1a81f3['includes']('1st')?0x1:_0x1a81f3['includes']('2nd')?0x2:0x0,_0x4d0494=_0x5b4459['find'](_0x43fef8=>_0x43fef8['some'](_0x3030eb=>_0x3030eb?.['includes']('Course\x20&\x20Sec'))),_0x2e2576=_0x4d0494?_0x4d0494['findIndex'](_0x998dd3=>_0x998dd3?.['includes']('Course\x20&\x20Sec')):-1,_0x7b89eb=_0x2e2576!==-1&&_0x4d0494?_0x4d0494[_0x2e2576+0x2]?.['trim']()??'':'';let _0x1aa666='',_0x35f7ec='';if(_0x7b89eb){const _0x147d95=_0x7b89eb['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x147d95&&(_0x1aa666=_0x147d95[0x1]??'',_0x147d95[0x2]&&(_0x35f7ec=_0x147d95[0x2]['replace'](/^OC/i,'')));}const _0x4b899b=_0x5b4459['find'](_0x403fca=>_0x403fca['some'](_0x2746c1=>_0x2746c1?.['includes']('School\x20Year'))),_0x4131ba=_0x4b899b?_0x4b899b['findIndex'](_0xb28c8b=>_0xb28c8b?.['includes']('School\x20Year')):-1,_0xbe97e1=_0x4131ba!==-1&&_0x4b899b?_0x4b899b[_0x4131ba+0x2]?.['trim']()??'':'';let _0x4b7c80=0x0;if(_0xbe97e1){const _0x5572ba=_0xbe97e1['match'](/(\d{4})-(\d{4})/);if(_0x5572ba){const _0x58bf1d=(_0x5572ba[0x1]??'')['slice'](0x2),_0x7f1f19=(_0x5572ba[0x2]??'')['slice'](0x2);_0x4b7c80=parseInt(_0x58bf1d+_0x7f1f19,0xa);}}const _0xc84ec1={'faculty':_0x42c331,'course':_0x1aa666,'section':_0x35f7ec,'semester':_0x39d90a,'sy':_0x4b7c80},_0x1b1251=_0x5b4459['findIndex'](_0x4b20a1=>_0x4b20a1['some'](_0x2b87a9=>_0x2b87a9?.['trim']()==='CO\x20#'));if(_0x1b1251===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x4fc7e7=_0x5b4459[_0x1b1251+0x1];if(!_0x4fc7e7)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x1584e0={};let _0x1d0ff4=0x1,_0x485a49=0x1;for(let _0xbb2853=0x3;_0xbb2853<_0x4fc7e7['length'];_0xbb2853++){const _0x1c0010=_0x4fc7e7[_0xbb2853];if(!_0x1c0010)continue;const _0x57837f='co'+_0x1d0ff4;if(!_0x1584e0[_0x57837f])_0x1584e0[_0x57837f]=[];_0x1584e0[_0x57837f]['push']('ilo'+_0x485a49),_0x485a49++,_0x485a49>0x3&&(_0x1d0ff4++,_0x485a49=0x1);}const _0x4de59a=_0x5b4459['findIndex'](_0x532947=>_0x532947['includes']('Name\x20of\x20Students'));if(_0x4de59a===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x535bc7=_0x5b4459[_0x4de59a];if(!_0x535bc7)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x5343c0=_0x535bc7['findIndex'](_0x4e2aa2=>_0x4e2aa2?.['includes']('Name\x20of\x20Students'));if(_0x5343c0===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x313ee1=_0x5343c0+0x2,_0x1c8749=[];for(let _0x211f92=_0x4de59a+0x1;_0x211f92<_0x5b4459['length'];_0x211f92++){const _0x2911b9=_0x5b4459[_0x211f92];if(!_0x2911b9)continue;if(_0x2911b9['some'](_0x3ee9b9=>_0x3ee9b9?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x3ee9b9?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x3ee9b9?.['toUpperCase']()['includes']('INACTIVE')||_0x3ee9b9?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x2911b9[_0x5343c0])continue;const _0x189f95=_0x2911b9[_0x5343c0]['replace'](/"/g,'')['trim'](),_0x23936e=_0x2911b9['slice'](_0x313ee1)['map'](_0x34a581=>_0x34a581===null?null:!isNaN(Number(_0x34a581))?parseFloat(_0x34a581):0x0);let _0x460457=0x0;const _0x4c6f58={};Object['entries'](_0x1584e0)['forEach'](([_0x3ae163,_0x5315ff])=>{const _0x5c26cb={};_0x5315ff['forEach'](_0x14e053=>{_0x5c26cb[_0x14e053]=_0x23936e[_0x460457]??0x0,_0x460457++;}),_0x4c6f58[_0x3ae163]={'transmuted_score':_0x5c26cb};}),_0x1c8749['push']({'student_name':_0x189f95,'coaep':_0x4c6f58});}const _0xf6e074=_0x5b4459['find'](_0x3e78e3=>_0x3e78e3['some'](_0x175809=>_0x175809?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x262f27=_0x5b4459['find'](_0xb4e66c=>_0xb4e66c['some'](_0x5102bf=>_0x5102bf?.['includes']('AVERAGE'))),_0x931aeb=_0xf6e074?_0xf6e074['slice'](_0x313ee1)['map'](_0x30ce96=>_0x30ce96&&!isNaN(Number(_0x30ce96))?parseInt(_0x30ce96):0x0):[],_0x5e379e=_0x262f27?_0x262f27['slice'](_0x313ee1)['map'](_0x4dff49=>_0x4dff49&&_0x4dff49!=='#DIV/0!'&&!isNaN(Number(_0x4dff49))?parseInt(_0x4dff49):0x0):[],_0x1fe97e={};let _0xdf441a=0x0;return Object['entries'](_0x1584e0)['forEach'](([_0x40f337,_0xfc4242])=>{if(!_0x1fe97e[_0x40f337])_0x1fe97e[_0x40f337]={};_0xfc4242['forEach'](_0x46be7c=>{_0x1fe97e[_0x40f337][_0x46be7c]={'achievedMinimum':_0x931aeb[_0xdf441a]??0x0,'average':_0x5e379e[_0xdf441a]??0x0},_0xdf441a++;});}),{'assessmentData':{'classAssignment':_0xc84ec1,'student':_0x1c8749,'total':_0x1fe97e}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x125cc2,_0x5d3fd5){try{const _0x4b9055=await convertToCSVFile(_0x5d3fd5),_0x35ebc3=await _0x4b9055['text'](),_0x1f57e7=parseAssessmentCsv(_0x35ebc3),_0x6eb25c=await fetch(_0x125cc2+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x1f57e7)});if(!_0x6eb25c['ok']){const _0x586a91=await _0x6eb25c['json']();throw _0x586a91;}return _0x6eb25c['json']();}catch(_0x206d2e){throw _0x206d2e;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x445aa7,_0x3e4a2c){try{const _0x2c2176=await convertToCSVFile(_0x3e4a2c),_0x49b6f2=new FormData();_0x49b6f2['append']('csvFile',_0x2c2176);const _0x2cc217=await fetch(_0x445aa7+'/dept-faculties/upload',{'method':'POST','body':_0x49b6f2});if(!_0x2cc217['ok']){const _0x5da504=await _0x2cc217['json']();throw _0x5da504;}return _0x2cc217['json']();}catch(_0x203d32){throw _0x203d32;}}
|
|
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(_0x284694){let _0xe9c57={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x229211=0x0;_0x229211<Math['min'](_0x284694['length'],0x14);_0x229211++){const _0x44cd05=(_0x284694[_0x229211]??[])['map'](_0x5ecd6f=>_0x5ecd6f['toLowerCase']()['trim']()),_0x1b8e9c=_0x44cd05['findIndex'](_0x18b62b=>HEADERS['po']['some'](_0xd52e2f=>_0x18b62b['toLowerCase']()['includes'](_0xd52e2f))),_0x50e59b=_0x44cd05['findIndex'](_0x29a217=>HEADERS['tl']['some'](_0x492da4=>_0x29a217['toLowerCase']()['includes'](_0x492da4))),_0x33e5d8=_0x44cd05['findIndex'](_0x257128=>HEADERS['pi']['some'](_0x52994e=>_0x257128['toLowerCase']()['includes'](_0x52994e))),_0x69e4d5=_0x44cd05['findIndex'](_0x43267a=>HEADERS['fc']['some'](_0x4b6076=>_0x43267a['toLowerCase']()['includes'](_0x4b6076))),_0x28adff=_0x44cd05['findIndex'](_0x2eaf87=>HEADERS['sc']['some'](_0x339f9e=>_0x2eaf87['toLowerCase']()['includes'](_0x339f9e))),_0x2f3c91=_0x44cd05['findIndex'](_0x2e6078=>HEADERS['at']['some'](_0x5b29c0=>_0x2e6078['toLowerCase']()['includes'](_0x5b29c0))),_0x2c8fe5=_0x44cd05['findIndex'](_0x3c6db9=>HEADERS['pt']['some'](_0x2dad8f=>_0x3c6db9['toLowerCase']()['includes'](_0x2dad8f))),_0x5f05e0=[_0x1b8e9c,_0x50e59b,_0x33e5d8,_0x69e4d5,_0x28adff,_0x2f3c91,_0x2c8fe5]['filter'](_0x599b5b=>_0x599b5b!==-1)['length'];if(_0x5f05e0>=0x3){_0xe9c57={'headerIdx':_0x229211,'poIdx':_0x1b8e9c,'tlIdx':_0x50e59b,'piIdx':_0x33e5d8,'fcIdx':_0x69e4d5,'scIdx':_0x28adff,'atIdx':_0x2f3c91,'ptIdx':_0x2c8fe5};break;}}if(_0xe9c57['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0xe9c57;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x270b56=>{let _0x430760=_0x270b56['split'](',')['reduce']((_0x118c6c,_0x4e5e46)=>{const _0x15ce6a=_0x4e5e46['trim']();if(_0x15ce6a)_0x118c6c['push'](_0x15ce6a);return _0x118c6c;},[]);return _0x430760;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x47c088=>{try{const _0x4da9d1=_0x2308bc['parse'](_0x47c088,{'skipEmptyLines':![]})['data'],{headerIdx:_0xb0349d,poIdx:_0x2f2260,tlIdx:_0x393d5f,piIdx:_0x5054cb,fcIdx:_0x35188d,scIdx:_0x2b10c3,atIdx:_0x26afd1,ptIdx:_0x3d5f6b}=getPoaepHeader(_0x4da9d1),_0x548904=[];let _0x705acb={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x20a3da='',_0x3726b5='',_0x1b29de='';for(let _0x2d6c0a=_0xb0349d+0x1;_0x2d6c0a<_0x4da9d1['length'];_0x2d6c0a++){const _0x38db29=_0x4da9d1[_0x2d6c0a];if(!_0x38db29)break;const _0x2cfb4a=_0x38db29[_0x2f2260]?.['trim']()||'';_0x2cfb4a!==''&&(_0x705acb={'po_desc':_0x2cfb4a,'seq_no':_0x705acb['seq_no']+0x1,'PerfIndicators':[]},_0x548904['push'](_0x705acb),_0x20a3da='',_0x3726b5='',_0x1b29de='');if(_0x705acb['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x2d6c0a+'.');const _0x535828=_0x38db29[_0x5054cb]?.['trim']()||'';if(_0x535828==='')break;const _0x4e6f3e=_0x38db29[_0x35188d]?.['trim']()||'';if(_0x4e6f3e==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x2d6c0a+'.');const _0x3b0b94=_0x38db29[_0x2b10c3]?.['trim']()||_0x20a3da;if(_0x3b0b94==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x2d6c0a+'.');_0x20a3da=_0x3b0b94;const _0x11038b=_0x38db29[_0x26afd1]?.['trim']()||_0x3726b5;if(_0x11038b==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x2d6c0a+'.');_0x3726b5=_0x11038b;const _0x4b986c=_0x38db29[_0x3d5f6b]?.['trim']()||_0x1b29de;if(_0x4b986c==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x2d6c0a+'.');_0x1b29de=_0x4b986c;const _0x1a448e=parseFormativeCourses(_0x4e6f3e);if(_0x1a448e['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x2d6c0a+'.');const _0x50c411=performaceTarget(_0x4b986c);if(!_0x50c411['performance_target']||!_0x50c411['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x2d6c0a+'.');const _0xffb42e={'pi_desc':_0x535828,'FormativeCourses':_0x1a448e['map'](_0x38bdb7=>({'course_id':_0x38bdb7,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x3b0b94},'AssessmentTool':{'at_desc':_0x11038b},'PerformanceTargets':{'target_percent':_0x50c411['performance_target'],'min_score':_0x50c411['passing_score']}};_0x705acb['PerfIndicators']['push'](_0xffb42e);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x548904}};}catch(_0x4a2dcb){return {'success':![],'error':_0x4a2dcb instanceof Error?_0x4a2dcb['message']:_0x4a2dcb,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x4a4683,_0x19693c,_0x3dff1e,_0xb60a86,_0x1437ab){try{const _0xb308a0=await convertToCSVFile(_0x19693c),_0x38c3be=await _0xb308a0['text'](),_0x5c2de4=parsePOAEP(_0x38c3be),_0x557c22=await fetch(_0x4a4683+'/program-outcomes/poaep/upload?curr_id='+_0xb60a86+'&period_id='+_0x1437ab,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x3dff1e},'credentials':'include','body':JSON['stringify'](_0x5c2de4)});if(!_0x557c22['ok']){const _0x1ab4d8=await _0x557c22['json']();throw _0x1ab4d8;}return _0x557c22['json']();}catch(_0x3b8bea){throw _0x3b8bea;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(_0x59d96e='DataTable',_0xf63406){this['name']=_0x59d96e,this['headers']=_0xf63406,this['table']=[],this['validators']=[],this['state']={};}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getState'](){return this['state'];}['setState']=async _0x3641cb=>{await this['assertInitialized'](),this['state']=_0x3641cb;};['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'],'state':this['state']}};}async['setTable'](_0x1e7949){await this['assertInitialized'](),this['table']=_0x1e7949;}async['initializeTable'](_0x3b65ca,_0x92a9bb){try{let _0x4318c4;if(_0x3b65ca instanceof File)_0x4318c4=await this['fromXML'](_0x3b65ca,_0x92a9bb);else _0x4318c4=await this['fromCSVString'](_0x3b65ca);if(!_0x4318c4['success']||!_0x4318c4['data'])return _0x4318c4;if(_0x4318c4['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x4318c4['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x15ed99){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x15ed99};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x948ed6,_0x5a58f8){const _0x4c2b90=await convertToCSVFile(_0x948ed6,_0x5a58f8),_0x503c55=await _0x4c2b90['text']();return this['fromCSVString'](_0x503c55);}async['findValue'](_0x2484d1){let [_0x2b24ed,_0x37c81c]=[-1,-1];if(!_0x2484d1)return {'row':_0x2b24ed,'column':_0x37c81c};for(let _0x476971=0x0;_0x476971<this['table']['length'];_0x476971++){const _0x5b9af9=this['table'][_0x476971];for(let _0x36fbed=0x0;_0x36fbed<_0x5b9af9['length'];_0x36fbed++){if(typeof _0x2484d1==='string'){if(_0x5b9af9[_0x36fbed]===_0x2484d1)return {'row':_0x476971,'column':_0x36fbed};}else {if(_0x5b9af9[_0x36fbed]){if(_0x5b9af9[_0x36fbed]===_0x2484d1)return {'row':_0x476971,'column':_0x36fbed};}}}}return {'row':_0x2b24ed,'column':_0x37c81c};}async['validate'](){const _0x59b6d4=[],_0x38f62d=[];try{await this['assertInitialized']()['then'](()=>{_0x59b6d4['push']('Table\x20is\x20initialized.');})['catch'](_0x219cf3=>_0x38f62d['push'](_0x219cf3));if(_0x38f62d['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x59b6d4,_0x38f62d);const {success:_0x2b739b,message:_0x5b83a7,error:_0x1ea0fe,data:_0x30746b}=await this['toJson']();if(!_0x30746b)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x59b6d4['push'](..._0x30746b['validMsgs']),_0x38f62d['push'](..._0x30746b['tableErrors']);const {jsonObj:_0x504292}=_0x30746b;for(const _0x2c08cf of this['validators']){await _0x2c08cf['validate'](_0x59b6d4,_0x38f62d,this,_0x504292);}let _0x236084=this['name']+'\x20ran\x20its\x20validations.';if(_0x59b6d4['length']>0x0)_0x236084+='\x20'+_0x59b6d4['length']+'\x20validations\x20were\x20successful.';if(_0x38f62d['length']>0x0)_0x236084+='\x20'+_0x38f62d['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x236084,'data':{'validMsgs':_0x59b6d4,'tableErrors':_0x38f62d}};}catch(_0x28b231){return _0x38f62d['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x28b231}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x59b6d4,'tableErrors':_0x38f62d}};}}['useValidator'](_0x5aea6f){this['validators']['push'](_0x5aea6f);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x1c5dd4){this['name']=_0x1c5dd4;}['getName'](){return this['name'];}['report'](_0x3467a2,_0x5eaba3,_0x2d87c6){if(_0x3467a2['length']>0x0)_0x2d87c6['push'](..._0x3467a2);else _0x5eaba3['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'](_0x307cc6,_0x46380d,_0xd8b789,_0x45e9aa){const _0x33d4cf=[];if(!_0x45e9aa){_0x46380d['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x4c0cbc=0x0;_0x4c0cbc<_0x45e9aa['co']['length'];_0x4c0cbc++){const _0x56923e=_0x45e9aa['co'][_0x4c0cbc];if(!_0x56923e){const {row:_0x234514,column:_0x5a6a77}=await _0xd8b789['findValue'](_0x4c0cbc+0x1+'');_0x33d4cf['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x4c0cbc+0x1)+'.','row':_0x234514,'column':_0x5a6a77+0x1,'from':this['name']});continue;}if(!_0x56923e?.['ilo']){const {row:_0x5c089a,column:_0xf18882}=await _0xd8b789['findValue'](_0x56923e['statement']);_0x33d4cf['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x4c0cbc+0x1)+'.','row':_0x5c089a,'column':_0xf18882,'from':this['name']});continue;}const _0x5313ad=_0x56923e['ilo']['length']-0x1,_0x369066=_0x56923e['ilo'][_0x5313ad];if(!_0x369066['taxonomy_level']){const {row:_0x1f31fa,column:_0x309727}=await _0xd8b789['findValue'](_0x369066['statement']);_0x33d4cf['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x4c0cbc+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x1f31fa,'column':_0x309727,'from':this['name']});continue;}if(_0x369066['taxonomy_level']!==_0x56923e['taxonomy_level']){const {row:_0x48d893,column:_0x1d6d41}=await _0xd8b789['findValue'](_0x369066['statement']);_0x33d4cf['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x4c0cbc+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x369066['taxonomy_level']+'\x20!==\x20'+_0x56923e['taxonomy_level']+')','row':_0x48d893,'column':_0x1d6d41,'from':this['name']});}}this['report'](_0x33d4cf,_0x307cc6,_0x46380d);}}
|
|
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'](_0x5cb8b7,_0x425f6b,_0x22b9d3,_0x56438f){const _0x597666=[];if(!_0x56438f){_0x425f6b['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x2f99cc=0x0;_0x2f99cc<_0x56438f['co']['length'];_0x2f99cc++){const _0x46fb6a=_0x56438f['co'][_0x2f99cc];if(!_0x46fb6a['taxonomy_level']){_0x597666['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x2f99cc+0x1),'from':this['name']});continue;}if(!whitelist['includes'](_0x46fb6a['taxonomy_level'])){const {row:_0x4d46f1,column:_0x457e21}=await _0x22b9d3['findValue'](_0x46fb6a['statement']);let _0xaab593={'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x46fb6a['taxonomy_level']['toUpperCase'](),'from':this['name']};(_0x4d46f1!==-1||_0x457e21!==-1)&&(_0xaab593['row']=_0x4d46f1,_0xaab593['column']=_0x457e21),_0x597666['push'](_0xaab593);}}this['report'](_0x597666,_0x5cb8b7,_0x425f6b);return;}}
|
|
51
51
|
|
|
52
52
|
const taxoOrder={'remembering':0x1,'understanding':0x2,'applying':0x3,'analyzing':0x4,'evaluating':0x5,'creating':0x6};
|
|
53
53
|
|
|
54
|
-
class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](
|
|
54
|
+
class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](_0x1de70,_0x2c0e64,_0x25bea7,_0x4f6ebf){const _0x24fb5e=[];if(!_0x4f6ebf){_0x2c0e64['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x2d80d5=0x0;_0x2d80d5<_0x4f6ebf['co']['length'];_0x2d80d5++){const _0x3d16bd=_0x4f6ebf['co'][_0x2d80d5];if(!_0x3d16bd){const {row:_0x394089,column:_0x2f60e0}=await _0x25bea7['findValue'](_0x2d80d5+0x1+'');_0x24fb5e['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x2d80d5+0x1)+'.','row':_0x394089,'column':_0x2f60e0+0x1,'from':this['name']});continue;}if(!_0x3d16bd?.['ilo']){const {row:_0x3492f6,column:_0x3833a0}=await _0x25bea7['findValue'](_0x3d16bd['statement']);_0x24fb5e['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x2d80d5+0x1)+'.','row':_0x3492f6,'column':_0x3833a0,'from':this['name']});continue;}const _0x33e22c=await _0x25bea7['findValue'](_0x3d16bd['ilo'][0x0]['statement']),_0x17efca=_0x3d16bd['ilo']['map'](_0x3a9d73=>taxoOrder[_0x3a9d73['taxonomy_level']]);let _0x191274=_0x17efca[0x0];for(let _0x16fd42=0x1;_0x16fd42<_0x17efca['length'];_0x16fd42++){if(_0x17efca[_0x16fd42]<_0x191274){_0x24fb5e['push']({'error':'Under\x20CO\x20'+(_0x2d80d5+0x1)+',\x20ILO\x20'+(_0x16fd42+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x16fd42+'\x27s.','row':_0x33e22c['row'],'column':_0x33e22c['column']+_0x16fd42,'from':this['name']});continue;}_0x191274=_0x17efca[_0x16fd42];}}this['report'](_0x24fb5e,_0x1de70,_0x2c0e64);}}
|
|
55
55
|
|
|
56
|
-
const minPerfTarget=0x32,minPassScore=0x32;class MinPerfTarget extends DTValidator{constructor(){super('MIN_PERF_TARGET');}async['validate'](
|
|
56
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPerfTarget extends DTValidator{constructor(){super('MIN_PERF_TARGET');}async['validate'](_0x36814b,_0x44724f,_0x1028d4,_0x54b413){const {success:_0x10d07c,data:_0x580b20}=_0x1028d4['getTable'](),_0x4ac25f=[];if(!_0x10d07c){_0x4ac25f['push']({'error':'Failed\x20to\x20access\x20table\x20data.','from':this['name']});return;}const {table:_0x51fb26}=_0x580b20;for(let _0x306ea5=0x0;_0x306ea5<_0x51fb26['length'];_0x306ea5++){const _0x2d671d=_0x51fb26[_0x306ea5],[_0xee7fb9,_0x8059dd]=_0x2d671d[0x4];if(!_0xee7fb9)_0x4ac25f['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x306ea5,'column':0x4,'from':this['name']});else _0xee7fb9<minPerfTarget&&_0x4ac25f['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x306ea5,'column':0x4,'from':this['name']});if(!_0x8059dd)_0x4ac25f['push']({'error':'Pass\x20score\x20is\x20required.','row':_0x306ea5,'column':0x6,'from':this['name']});else _0x8059dd<minPassScore&&_0x4ac25f['push']({'error':'Pass\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x306ea5,'column':0x6,'from':this['name']});}this['report'](_0x4ac25f,_0x36814b,_0x44724f);}}
|
|
57
57
|
|
|
58
|
-
class CoaepDT extends DataTable{
|
|
58
|
+
class CoaepDT extends DataTable{constructor(){super('CoaepDT',['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target']),this['state']={'faculty':null,'course':null,'sy':null,'semester':null},this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](_0x571950,_0x5de8b4){const _0x137bfa=[];let _0x21eb85=null,_0x35193b=null;for(let _0x539a6d=0x0;_0x539a6d<this['table']['length'];_0x539a6d++){const _0x3f3297=[],_0x49c821=this['table'][_0x539a6d],_0x123e51=_0x49c821[0x0]||_0x21eb85,_0x458c97=_0x49c821[0x1]||_0x35193b,_0x5de538=_0x49c821[0x2],_0x4dd4c1=_0x49c821[0x3],_0x5634c6=_0x49c821[0x4];if(!_0x123e51)_0x3f3297['push'](0x0);if(!_0x458c97)_0x3f3297['push'](0x1);if(!_0x5de538)_0x3f3297['push'](0x2);if(!_0x4dd4c1)_0x3f3297['push'](0x3);if(!_0x5634c6)_0x3f3297['push'](0x4);if(_0x35193b!==_0x458c97)this['validateObjectiveGrammar'](_0x458c97,_0x539a6d,0x1,_0x5de8b4);_0x21eb85=_0x123e51,_0x35193b=_0x458c97;for(const _0x4955d1 of _0x3f3297){_0x137bfa['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x4955d1],'row':_0x539a6d,'column':_0x4955d1});}if(_0x5de538)this['validateObjectiveGrammar'](_0x5de538,_0x539a6d,0x2,_0x5de8b4);}if(_0x137bfa['length']>0x0)_0x5de8b4['push'](..._0x137bfa);else _0x571950['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x520688){try{const _0x4a20e3=[],_0x40d415=_0x2308bc['parse'](_0x520688,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x9c45ab,coIdx:_0x4ef564,iloIdx:_0x5d06d8,assessToolIdx:_0x2d19a0,perfTargetIdx:_0x5bf1ce}=getCoaepHeader(_0x40d415);if(_0x9c45ab===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x40d415['forEach'](_0xc8006b=>{const _0x4e3e9b=_0xc8006b['indexOf']('Name\x20of\x20Faculty:'),_0x2e7ef7=_0xc8006b['indexOf']('School\x20Year'),_0x83bd52=_0xc8006b['indexOf']('Course:'),_0x11b376=_0xc8006b['indexOf']('Semester');_0x4e3e9b!==-0x1&&(this['state']['faculty']=_0xc8006b[_0x4e3e9b+0x1]?.['trim']()||this['state']['faculty']);_0x2e7ef7!==-0x1&&(this['state']['sy']=_0xc8006b[_0x2e7ef7+0x1]?.['trim']()||this['state']['sy']);_0x83bd52!==-0x1&&(this['state']['course']=_0xc8006b[_0x83bd52+0x1]?.['trim']()||this['state']['course']);if(_0x11b376!==-0x1){const _0x5d055f=_0xc8006b[_0x11b376+0x1]?.['trim']()||'',_0x3883a4=_0x5d055f['match'](/\d+/)?.[0x0];this['state']['semester']=_0x3883a4?parseInt(_0x3883a4,0xa):this['state']['semester'];}});for(let _0x473238=0x0;_0x473238<=_0x40d415['length'];_0x473238++){const _0x5c250e=_0x40d415[_0x473238];if(!_0x5c250e)break;if(_0x473238<=_0x9c45ab)continue;if(!_0x5c250e[_0x5d06d8])break;let _0x121903=_0x5c250e[_0x4ef564-0x1]?.['trim']()||'',_0x58dbce=_0x5c250e[_0x4ef564]?.['trim']()||'',_0x40b1c9=_0x5c250e[_0x5d06d8]?.['trim']()||'';/^\d+$/['test'](_0x5c250e[_0x4ef564]?.['trim']()||'')&&(_0x121903=_0x5c250e[_0x4ef564]?.['trim']()||'',_0x58dbce=_0x5c250e[_0x4ef564+0x1]?.['trim']()||'');let _0x269fb4=null;if(_0x58dbce){const {cognitive_level:_0x5a3fa0,taxonomy_level:_0x3614dc,verb:_0x3cd423,rest:_0x114bb9}=extractFromObjective(_0x58dbce);_0x269fb4=[_0x5a3fa0,_0x3614dc,_0x3cd423,_0x114bb9];}let _0x58cfa9;{const {cognitive_level:_0x27db6e,taxonomy_level:_0x1f48fd,verb:_0x39dde2,rest:_0x48d1fb}=extractFromObjective(_0x40b1c9);_0x58cfa9=[_0x27db6e,_0x1f48fd,_0x39dde2,_0x48d1fb];}const _0x19778b=_0x5c250e[_0x5bf1ce]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x24f3ca,passing_score:_0x4d9834}=performaceTarget(_0x19778b);_0x4a20e3['push']([_0x121903,_0x269fb4,_0x58cfa9,_0x5c250e[_0x2d19a0]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x24f3ca,_0x4d9834]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x4a20e3};}catch(_0x5c262d){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x5c262d};}}async['toJson'](){const _0x20b252=[],_0x354a6d=[],_0x1265e5='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x46a7b1={'faculty':this['state']['faculty'],'course':this['state']['course'],'sy':this['state']['sy'],'semester':this['state']['semester'],'co':[]};let _0x36e59c=null,_0x205608='',_0x5401a6=[null,null];this['table']['forEach']((_0x4f448c,_0x173398)=>{if(_0x173398===0x0&&!_0x4f448c[0x1])_0x354a6d['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x1265e5});_0x4f448c[0x1]&&(_0x205608='',_0x5401a6=[null,null]);const _0x4a37b8=_0x4f448c[0x1],_0x372f4f=_0x4f448c[0x2],_0x1835b1=_0x4f448c[0x3]||_0x205608,_0x3e6514=_0x4f448c[0x4]||_0x5401a6;if(!_0x372f4f)_0x354a6d['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x1265e5});if(!_0x1835b1)_0x354a6d['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x173398,'column':0x3,'from':_0x1265e5});if(!_0x3e6514)_0x354a6d['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x173398,'column':0x4,'from':_0x1265e5});if(_0x4a37b8){const [_0x3593d6,_0x2ead92,_0x8d69b2,_0x165b0b]=_0x4a37b8,_0x22a445={'statement':_0x165b0b,'ilo':[],'taxonomy_level':_0x2ead92,'cognitive_level':_0x3593d6,'verb':_0x8d69b2};_0x36e59c=_0x22a445,_0x46a7b1['co']['push'](_0x22a445);}const [_0xbbb0ec,_0x109238,_0x154a7e,_0x3547f0]=_0x372f4f,[_0x2d35a9,_0x2ec450]=_0x3e6514,_0x12b82a={'statement':_0x3547f0,'assessment_tool':_0x1835b1,'performance_target':_0x2d35a9,'passing_score':_0x2ec450,'cognitive_level':_0xbbb0ec,'taxonomy_level':_0x109238,'verb':_0x154a7e};_0x36e59c['ilo']['push'](_0x12b82a);});if(_0x354a6d['length'])return _0x354a6d['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x1265e5}),{'success':![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x46a7b1,'validMsgs':_0x20b252,'tableErrors':_0x354a6d}};return _0x20b252['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x46a7b1,'validMsgs':_0x20b252,'tableErrors':_0x354a6d}};}catch(_0x1f28d3){return _0x354a6d['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x1265e5}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x1f28d3,'data':{'jsonObj':null,'tableErrors':_0x354a6d}};}}['validateObjectiveGrammar'](_0xa3c0e3,_0x4f120c,_0x1a5bf0,_0x4f5acd){if(!_0xa3c0e3){_0x4f5acd['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x4f120c,'column':_0x1a5bf0,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x14e519,_0x8fc11,_0x1668a5,_0x526984]=_0xa3c0e3,_0x571d80=[];if(!_0x14e519)_0x571d80['push']('Cognitive\x20Level');if(!_0x8fc11)_0x571d80['push']('Taxonomy\x20Level');if(!_0x1668a5)_0x571d80['push']('Verb');if(!_0x571d80['length'])return;_0x4f5acd['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x571d80['join'](',\x20')+'.','row':_0x4f120c,'column':_0x1a5bf0,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}}
|
|
59
59
|
|
|
60
|
-
class Client{['BASE_URL'];constructor(
|
|
60
|
+
class Client{['BASE_URL'];constructor(_0x2bf849){this['BASE_URL']=_0x2bf849;}['Parser'](){return {'curriculum':async _0x2050e6=>{const _0x56469d=await uploadCurriculum(this['BASE_URL'],_0x2050e6);return _0x56469d;},'courseOffering':async _0x15c631=>{const _0x13d9f5=await uploadCourseOffering(this['BASE_URL'],_0x15c631);return _0x13d9f5;},'coaep':async(_0x5c0fbf,_0x4a25b2)=>{const _0x10207f=await uploadCOAEP(this['BASE_URL'],_0x5c0fbf,_0x4a25b2);return _0x10207f;},'enrolledStudent':async _0x2367bf=>{const _0x3ff4e0=await uploadEnrolledStudent(this['BASE_URL'],_0x2367bf);return _0x3ff4e0;},'classlist':async(_0x34b5fb,_0x2626a2,_0x549203)=>{const _0x4e1a61=await uploadClassList(this['BASE_URL'],_0x34b5fb,_0x2626a2,_0x549203);return _0x4e1a61;},'assessmentData':async _0x14c253=>{const _0x2baabb=await uploadAssessmentData(this['BASE_URL'],_0x14c253);return _0x2baabb;},'deptFaculty':async _0xd5b55c=>{const _0x57b7e1=await uploadDeptFaculty(this['BASE_URL'],_0xd5b55c);return _0x57b7e1;},'poaep':async(_0x190995,_0x4b87d1,_0x19ff42,_0x11ce35)=>{const _0x3aa5d5=await uploadPOAEP(this['BASE_URL'],_0x190995,_0x4b87d1,_0x19ff42,_0x11ce35);return _0x3aa5d5;},'CoaepDT':CoaepDT};}}
|
|
61
61
|
|
|
62
62
|
export { Client as default };
|