@obe-loms/coms-parser 1.6.20 → 1.6.21
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.
|
@@ -27,4 +27,7 @@ export declare class CoaepDT extends DataTable<COAEP, CoaepRow> {
|
|
|
27
27
|
* @param {DataTableException[]} tableErrors - The array of error messages to append to.
|
|
28
28
|
*/
|
|
29
29
|
validateObjectiveGrammar(objectiveArr: [string | null, string | null, string | null, string | null] | null, row: number, column: number, tableErrors: DataTableException[]): void;
|
|
30
|
+
searchRow(rowData: CoaepRow, val: any): {
|
|
31
|
+
column: number;
|
|
32
|
+
}[];
|
|
30
33
|
}
|
|
@@ -112,15 +112,25 @@ export declare abstract class DataTable<Obj, RowType> {
|
|
|
112
112
|
*/
|
|
113
113
|
fromXML(xls: File, sheetName?: string): Promise<ParserResult<RowType[]>>;
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* Searches for all instances of a provided value in a row of the DataTable.
|
|
116
116
|
*
|
|
117
|
-
* @param {
|
|
118
|
-
* @
|
|
117
|
+
* @param {RowType} rowData - The row to search in.
|
|
118
|
+
* @param {any} val - The value to lookup.
|
|
119
|
+
* @returns {{column: number}[]} - A list of lookup column indices.
|
|
119
120
|
*/
|
|
120
|
-
|
|
121
|
+
abstract searchRow(rowData: RowType, val: any): {
|
|
122
|
+
column: number;
|
|
123
|
+
}[];
|
|
124
|
+
/**
|
|
125
|
+
* Searches for all instances of a provided value in the DataTable.
|
|
126
|
+
*
|
|
127
|
+
* @param {any} val - The value to lookup.
|
|
128
|
+
* @returns {Promise<{ row: number; column: number }[]>} - A promise resolving to a list of lookup indices. Defaults to [] if not found.
|
|
129
|
+
*/
|
|
130
|
+
searchTable(val: any): Promise<{
|
|
121
131
|
row: number;
|
|
122
132
|
column: number;
|
|
123
|
-
}>;
|
|
133
|
+
}[]>;
|
|
124
134
|
/**
|
|
125
135
|
* Runs all validators on the DataTable.
|
|
126
136
|
* By default runs the validations of the validateFields and toJson methods.
|
|
@@ -18,4 +18,7 @@ export declare class PoaepDT extends DataTable<POAEP, PoaepRow> {
|
|
|
18
18
|
}>>;
|
|
19
19
|
validateFields(validMsgs: string[], tableErrors: DataTableException[]): Promise<void>;
|
|
20
20
|
extractPoDesc(desc: string): string[];
|
|
21
|
+
searchRow(rowData: PoaepRow, val: any): {
|
|
22
|
+
column: number;
|
|
23
|
+
}[];
|
|
21
24
|
}
|
|
@@ -6,7 +6,7 @@ export type CoaepDT_No = string | null;
|
|
|
6
6
|
/**
|
|
7
7
|
* Represents the CO statement column in the internal COAEP DataTable.
|
|
8
8
|
*/
|
|
9
|
-
export type CoaepDT_CO = [
|
|
9
|
+
export type CoaepDT_CO = [CoaepDT_CogLvl, CoaepDT_TaxLvl, CoaepDT_Verb, CoaepDT_Rest] | null;
|
|
10
10
|
export type CoaepDT_CogLvl = "I" | "E" | "D" | null;
|
|
11
11
|
export type CoaepDT_TaxLvl = Taxonomy | null;
|
|
12
12
|
export type CoaepDT_Verb = string | null;
|
package/bundle.js
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x168e71 from 'papaparse';
|
|
2
|
+
import * as _0x2bcb29 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x3f7403){let _0x71e594='',_0x30d536='',_0x1e898e=0x0,_0x320dd7=null;const _0x9e2015=[];return _0x168e71['parse'](_0x3f7403,{'skipEmptyLines':!![],'complete':_0x274f1e=>{_0x274f1e['data']['forEach'](_0x3e72cc=>{const _0x115238=_0x3e72cc['map'](_0x3ad517=>(_0x3ad517??'')['toString']()['trim']()),_0xa8674e=_0x115238[0x0]??'';if(_0xa8674e['includes']('Rev#')){const _0x3e02c0=_0xa8674e['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x3e02c0&&(_0x71e594=_0x3e02c0[0x1]?.['trim']()??'',_0x30d536=_0x3e02c0[0x2]?.['trim']()??'',_0x1e898e=parseInt(_0x3e02c0[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0xa8674e)){_0x320dd7=0x1;return;}if(/SECOND YEAR/i['test'](_0xa8674e)){_0x320dd7=0x2;return;}if(/THIRD YEAR/i['test'](_0xa8674e)){_0x320dd7=0x3;return;}if(/FOURTH YEAR/i['test'](_0xa8674e)){_0x320dd7=0x4;return;}if(/FIFTH YEAR/i['test'](_0xa8674e)){_0x320dd7=0x5;return;}if(/First Semester/i['test'](_0xa8674e)||/Second Semester/i['test'](_0xa8674e)||/Summer/i['test'](_0xa8674e))return;const _0x2a88b0=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x2a88b0['forEach'](({sem:_0x3a1b1b,offset:_0x348a59})=>{const _0x3ac7a2=_0x115238[_0x348a59]??'',_0xfe03a0=_0x115238[_0x348a59+0x1]??'',_0x196ea3=_0x115238[_0x348a59+0x2]??'',_0x533172=_0x115238[_0x348a59+0x3]??'',_0x4da697=_0x115238[_0x348a59+0x4]??'';_0x3ac7a2&&_0x320dd7&&_0x9e2015['push']({'curr_id':_0x71e594,'program_name':_0x30d536,'revision_no':_0x1e898e,'year_level':_0x320dd7,'sem':_0x3a1b1b,'course_id':_0x3ac7a2,'course_desc':_0xfe03a0,'total_units':_0x196ea3,'lec_unit':_0x533172,'lab_unit':_0x4da697});});});}}),_0x9e2015;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x4a32fa,_0x4d8b26){return new Promise((_0x6b6e83,_0x55f892)=>{const _0x44293b=new FileReader();_0x44293b['onload']=_0x154eb4=>{const _0x20952a=_0x154eb4['target']?.['result'];if(!_0x20952a){_0x55f892(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x54dccc=_0x2bcb29['read'](_0x20952a,{'type':'array'});!_0x4d8b26&&(_0x4d8b26=_0x54dccc['SheetNames'][0x0]);if(!_0x4d8b26){_0x55f892(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x37706b=_0x54dccc['Sheets'][_0x4d8b26];if(!_0x37706b){_0x55f892(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x48e511=_0x2bcb29['utils']['sheet_to_csv'](_0x37706b,{'strip':!![]}),_0x379de8=_0x4a32fa['name']['replace'](/\.[^/.]+$/,'.csv'),_0x653eb2=new File([_0x48e511],_0x379de8,{'type':'text/csv','lastModified':Date['now']()});_0x6b6e83(_0x653eb2);}catch(_0x3fa9c3){_0x55f892(_0x3fa9c3);}},_0x44293b['onerror']=()=>{_0x55f892(new Error('File\x20reading\x20failed'));},_0x44293b['readAsArrayBuffer'](_0x4a32fa);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x127e6a,_0xb5c510){try{const _0x209ce4=await convertToCSVFile(_0xb5c510),_0x2faf5e=await _0x209ce4['text'](),_0x284d6e=parseCurriculum(_0x2faf5e),_0x5cfca2=_0x168e71['unparse'](_0x284d6e),_0x1496f9=new File([_0x5cfca2],_0x209ce4['name'],{'type':'text/csv'}),_0x48a5d7=new FormData();_0x48a5d7['append']('csvFile',_0x1496f9);const _0x2c187a=await fetch(_0x127e6a+'/curr-courses/upload',{'method':'POST','body':_0x48a5d7});if(!_0x2c187a['ok']){const _0x34928f=await _0x2c187a['json']();throw _0x34928f;}return _0x2c187a['json']();}catch(_0x30e7ee){throw _0x30e7ee;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x2791ab){let _0x3c3e69='',_0x3e90a0='';const _0x49e281=[],_0x410d91=_0x168e71['parse'](_0x2791ab,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x915239=_0x410d91['data'];for(let _0x39902c=0x0;_0x39902c<Math['min'](0x5,_0x915239['length']);_0x39902c++){const _0x31680b=_0x915239[_0x39902c];if(_0x31680b&&_0x31680b['length']>0x0){const _0x3fc03f=_0x31680b[0x0]?.['toString']()||'',_0x2172b8=_0x3fc03f['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x2172b8){_0x3c3e69=_0x2172b8[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x2172b8[0x2]){const _0xc9c20a=_0x2172b8[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0xc9c20a&&_0xc9c20a[0x2]&&_0xc9c20a[0x4]&&(_0x3e90a0=_0xc9c20a[0x2]+_0xc9c20a[0x4]);}}}}let _0xe3e9e0=-1;for(let _0x2b369f=0x0;_0x2b369f<_0x915239['length'];_0x2b369f++){const _0x52e182=_0x915239[_0x2b369f];if(_0x52e182&&_0x52e182['some'](_0x1910f6=>_0x1910f6?.['toString']()['toUpperCase']()['includes']('CODE'))){_0xe3e9e0=_0x2b369f;break;}}if(_0xe3e9e0===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x161118={'code':'','description':'','unit':0x0};for(let _0x22c261=_0xe3e9e0+0x1;_0x22c261<_0x915239['length'];_0x22c261++){const _0x1140a9=_0x915239[_0x22c261];if(!_0x1140a9||_0x1140a9['length']<0x8)continue;const _0x7929f9=_0x1140a9[0x1]?.['toString']()['trim']()||'',_0x13d3fb=_0x1140a9[0x4]?.['toString']()['trim']()||'',_0x4d53ad=_0x1140a9[0x5]?.['toString']()['trim']()||'',_0x5abc92=_0x1140a9[0x6]?.['toString']()['trim']()||'',_0x1be265=_0x1140a9[0x7]?.['toString']()['trim']()||'',_0x3ed708=_0x1140a9[0x3]?.['toString']()['trim']()||'';let _0x250ef5=_0x1140a9[0x0]?.['toString']()['trim']()||'',_0x10df9c=_0x1140a9[0x2]?.['toString']()['trim']()||'';if(!_0x7929f9)continue;if(!_0x250ef5)_0x250ef5=_0x161118['code'];if(!_0x10df9c)_0x10df9c=_0x161118['description'];let _0x53e2e8=_0x161118['unit'];if(_0x3ed708){const _0x4f1586=_0x3ed708['match'](/(\d+)/);_0x4f1586&&_0x4f1586[0x1]&&(_0x53e2e8=parseInt(_0x4f1586[0x1],0xa));}const _0x5a3389={'sem':_0x3c3e69,'school_year':_0x3e90a0,'code':_0x250ef5,'course_no':_0x7929f9,'course_desc':_0x10df9c,'unit':_0x53e2e8,'time':_0x13d3fb,'days':_0x4d53ad,'faculty':_0x5abc92,'room':_0x1be265};_0x161118['code']=_0x250ef5,_0x161118['description']=_0x10df9c,_0x161118['unit']=_0x53e2e8,_0x49e281['push'](_0x5a3389);}return _0x49e281;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x59e186,_0x4569c7){try{const _0x111d20=await convertToCSVFile(_0x4569c7),_0x264d08=await _0x111d20['text'](),_0x24bb49=parseCourseOffering(_0x264d08),_0x548bed=_0x168e71['unparse'](_0x24bb49),_0x2a3fe8=new File([_0x548bed],_0x111d20['name'],{'type':'text/csv'}),_0x478b0d=new FormData();_0x478b0d['append']('csvFile',_0x2a3fe8);const _0x832d16=await fetch(_0x59e186+'/course-offerings/upload',{'method':'POST','body':_0x478b0d});if(!_0x832d16['ok']){const _0xc6dc34=await _0x832d16['json']();throw _0xc6dc34;}return _0x832d16['json']();}catch(_0xf30400){throw _0xf30400;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x4aa870){if(!_0x4aa870)return {'performance_target':null,'passing_score':null};const _0x180a63=_0x4aa870['match'](/\d+/g);return {'performance_target':_0x180a63?.[0x0]?parseInt(_0x180a63[0x0],0xa):null,'passing_score':_0x180a63?.[0x1]?parseInt(_0x180a63[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(_0x3fc02f){let _0x1f46c6={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x26d4d0=0x0;_0x26d4d0<Math['min'](_0x3fc02f['length'],0x14);_0x26d4d0++){const _0x601a03=(_0x3fc02f[_0x26d4d0]??[])['map'](_0x1dc409=>_0x1dc409['toLowerCase']()['trim']()),_0x4af0b5=_0x601a03['findIndex'](_0x53b19b=>HEADERS$1['co']['some'](_0x366755=>_0x53b19b['includes'](_0x366755))),_0x30d1c3=_0x601a03['findIndex'](_0x134be4=>HEADERS$1['ilo']['some'](_0x35f139=>_0x134be4['includes'](_0x35f139))),_0x22b44c=_0x601a03['findIndex'](_0x366c5c=>HEADERS$1['assessTool']['some'](_0x48ad7a=>_0x366c5c['includes'](_0x48ad7a))),_0x2b4ccf=_0x601a03['findIndex'](_0x55609a=>HEADERS$1['perfTarget']['some'](_0x2d7043=>_0x55609a['includes'](_0x2d7043))),_0x17bbeb=[_0x4af0b5,_0x30d1c3,_0x22b44c,_0x2b4ccf]['filter'](_0x5a2925=>_0x5a2925!==-1)['length'];if(_0x17bbeb>=0x3){_0x1f46c6={'headerRowIndex':_0x26d4d0,'coIdx':_0x4af0b5,'iloIdx':_0x30d1c3,'assessToolIdx':_0x22b44c,'perfTargetIdx':_0x2b4ccf};break;}}return _0x1f46c6;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x2a2a18){const _0x49a997={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x2a2a18['trim']()},_0x343bbd=_0x2a2a18['match'](/^\((I|E|D)\)/);_0x343bbd&&(_0x49a997['cognitive_level']=_0x343bbd[0x1],_0x49a997['rest']=_0x2a2a18['slice'](_0x343bbd[0x0]['length'])['trim']());const _0x5101c7=_0x49a997['rest']?.['match'](/^(.*?)\:/);_0x5101c7&&(_0x49a997['taxonomy_level']=_0x5101c7[0x1]['trim']()['toLowerCase']()||null,_0x49a997['rest']=_0x49a997['rest']?.['slice'](_0x5101c7[0x0]['length'])['trim']()||null);const _0x1cf925=_0x49a997['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x1cf925)_0x49a997['verb']=_0x1cf925[0x1]['trim']()['toLowerCase']()||null;else {const _0x270710=_0x49a997['rest']?.['match'](/^\w+/);if(_0x270710)_0x49a997['verb']=_0x270710[0x0]['trim']()['toLowerCase']()||null;}return _0x49a997;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x485e8e){const _0x3e3c00=_0x168e71['parse'](_0x485e8e,{'skipEmptyLines':![]})['data'],_0x15195e={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0xcab5e6,coIdx:_0x17ad3f,iloIdx:_0x27ad53,assessToolIdx:_0x53f043,perfTargetIdx:_0x283df3}=getCoaepHeader(_0x3e3c00);if(_0xcab5e6===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x3e3c00['forEach'](_0xda6554=>{const _0x32549d=_0xda6554['indexOf']('Name\x20of\x20Faculty:'),_0x10366f=_0xda6554['indexOf']('School\x20Year'),_0x314aaa=_0xda6554['indexOf']('Course:'),_0x2c066d=_0xda6554['indexOf']('Semester');_0x32549d!==-1&&(_0x15195e['COAEP']['faculty']=_0xda6554[_0x32549d+0x1]?.['trim']()||_0x15195e['COAEP']['faculty']);_0x10366f!==-1&&(_0x15195e['COAEP']['sy']=_0xda6554[_0x10366f+0x1]?.['trim']()||_0x15195e['COAEP']['sy']);_0x314aaa!==-1&&(_0x15195e['COAEP']['course']=_0xda6554[_0x314aaa+0x1]?.['trim']()||_0x15195e['COAEP']['course']);if(_0x2c066d!==-1){const _0x5f3cef=_0xda6554[_0x2c066d+0x1]?.['trim']()||'',_0x38037b=_0x5f3cef['match'](/\d+/)?.[0x0];_0x15195e['COAEP']['semester']=_0x38037b?parseInt(_0x38037b,0xa):_0x15195e['COAEP']['semester'];}});let _0x4f62ab=null;return _0x3e3c00['forEach']((_0x12ec4d,_0x3049eb)=>{if(_0x3049eb<=_0xcab5e6)return;let _0x22cf00=_0x12ec4d[_0x17ad3f-0x1]?.['trim']()||'',_0x15f43b=_0x12ec4d[_0x17ad3f]?.['trim']()||'';/^\d+$/['test'](_0x12ec4d[_0x17ad3f]?.['trim']()||'')&&(_0x22cf00=_0x12ec4d[_0x17ad3f]?.['trim']()||'',_0x15f43b=_0x12ec4d[_0x17ad3f+0x1]?.['trim']()||'');const _0xd2323c=_0x12ec4d[_0x27ad53]?.['trim']()||'',_0x51a514=_0x12ec4d[_0x53f043]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x24b1f8=_0x12ec4d[_0x283df3]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x22cf00&&/^\d+$/['test'](_0x22cf00)){_0x4f62ab&&_0x15195e['COAEP']['co']['push'](_0x4f62ab);const _0x37ec29=_0x15f43b,{verb:_0x4c2917,cognitive_level:_0x5dbb04,taxonomy_level:_0x57cd2c}=extractFromObjective(_0x37ec29);if(!_0x4c2917)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x22cf00+'\x20is\x20in\x20the\x20correct\x20format.'};_0x4f62ab={'statement':_0x37ec29,'ilo':[],'verb':_0x4c2917,'cognitive_level':_0x5dbb04,'taxonomy_level':_0x57cd2c};}if(_0x4f62ab&&_0xd2323c&&_0x24b1f8){const _0x1e4389=_0xd2323c['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x1e4389['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x1e4389['length']<0xa)return;let _0x37d444=_0x51a514;if(!_0x37d444&&_0x1e4389['includes'](':')){const _0x7413ab=_0x1e4389['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x7413ab&&(_0x37d444=_0x7413ab[0x1]?.['trim']()||'');}const {performance_target:_0xfd8f85,passing_score:_0x5dfeaa}=performaceTarget(_0x24b1f8),{verb:_0x5c388f,cognitive_level:_0x45cd53,taxonomy_level:_0x44dc86}=extractFromObjective(_0x1e4389);_0x4f62ab['ilo']['push']({'statement':_0x1e4389,'assessment_tool':_0x37d444,'performance_target':_0xfd8f85,'passing_score':_0x5dfeaa,'verb':_0x5c388f,'cognitive_level':_0x45cd53,'taxonomy_level':_0x44dc86});}}),_0x4f62ab&&_0x15195e['COAEP']['co']['push'](_0x4f62ab),_0x15195e;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x28a5e4,_0x175cf9,_0x56093b){try{const _0xdd958c=await convertToCSVFile(_0x175cf9),_0x5bbe97=await _0xdd958c['text'](),_0x43eb59=parseCOAEP(_0x5bbe97);console['log'](_0x43eb59);const _0x46998=await fetch(_0x28a5e4+'/coaeps/upload?course_id='+_0x56093b,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x43eb59)});if(!_0x46998['ok']){const _0x379c54=await _0x46998['json']();throw _0x379c54;}return _0x46998['json']();}catch(_0x285100){throw _0x285100;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x1b1f02,_0x2866f9){try{const _0x2782f5=await convertToCSVFile(_0x2866f9),_0x232880=new FormData();_0x232880['append']('csvFile',_0x2782f5);const _0x208191=await fetch(_0x1b1f02+'/enrolled-students/upload',{'method':'POST','body':_0x232880});if(!_0x208191['ok']){const _0x5bf6b9=await _0x208191['json']();throw _0x5bf6b9;}return _0x208191['json']();}catch(_0x4ab668){throw _0x4ab668;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x2ae5f8){const _0x4a8f4e=_0x168e71['parse'](_0x2ae5f8,{'skipEmptyLines':!![]})['data'];let _0x3f0f73='',_0x2c9af3='',_0x4cc51f='';const _0x3f10b0=[];return _0x4a8f4e['forEach'](_0x56d6f8=>{const _0x47c64f=_0x56d6f8['map'](_0x1b9015=>(_0x1b9015??'')['toString']()['trim']()),_0x403670=_0x47c64f[0x0]??'';if(_0x403670['startsWith']('Course\x20No:')){const _0x2b8d84=_0x403670['replace']('Course\x20No:','')['trim'](),_0x3ca203=_0x2b8d84['split'](/\s+/);_0x4cc51f=_0x3ca203[0x0]??'';const [_0x20ae62,_0xb61b0e]=(_0x3ca203[0x1]??'')['split']('-');_0x2c9af3=_0x20ae62??'';const _0x31eb48=(_0xb61b0e??'')['match'](/[a-z]$/);_0x3f0f73=_0x31eb48?_0x31eb48[0x0]:'';}if(/^\d+$/['test'](_0x403670)){const _0x210df4=_0x47c64f[0x2]??'';_0x3f10b0['push']({'subj_code':_0x4cc51f,'student_no':_0x210df4,'course_id':_0x2c9af3,'section':_0x3f0f73});}}),{'enrolledCourses':_0x3f10b0};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x4fc55e,_0x4be2bc,_0x5631fd,_0x2ced69){try{const _0x569746=await convertToCSVFile(_0x4be2bc),_0x44dafd=await _0x569746['text'](),_0x3deca6=parseClassList(_0x44dafd),_0x2318f8='subj_code='+_0x5631fd+'&period_id='+_0x2ced69,_0x62e69f=await fetch(_0x4fc55e+'/enrolled-courses/upload?'+_0x2318f8,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x3deca6)});if(!_0x62e69f['ok']){const _0x151c6f=await _0x62e69f['json']();throw _0x151c6f;}return _0x62e69f['json']();}catch(_0x2e3a02){throw _0x2e3a02;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x180965){const {data:_0x330b3f}=_0x168e71['parse'](_0x180965,{'skipEmptyLines':!![]}),_0x3878a3=_0x330b3f['filter'](_0x50fa55=>_0x50fa55['length']>0x0),_0x5ca75c=_0x3878a3['find'](_0x32fc17=>_0x32fc17['some'](_0x242588=>_0x242588?.['includes']('Faculty'))),_0x305a93=_0x5ca75c?_0x5ca75c['findIndex'](_0x3733fd=>_0x3733fd?.['includes']('Faculty')):-1,_0x110efc=_0x305a93!==-1&&_0x5ca75c?_0x5ca75c[_0x305a93+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x38e6ea=_0x3878a3['find'](_0x7b3ba4=>_0x7b3ba4['some'](_0x26c652=>_0x26c652?.['includes']('Semester'))),_0x2d19c7=_0x38e6ea?_0x38e6ea['findIndex'](_0xfa1f2e=>_0xfa1f2e?.['includes']('Semester')):-1,_0x14efaa=_0x2d19c7!==-1&&_0x38e6ea?_0x38e6ea[_0x2d19c7+0x2]?.['trim']()??'':'',_0x3e8812=_0x14efaa['includes']('1st')?0x1:_0x14efaa['includes']('2nd')?0x2:0x0,_0x2ca7d1=_0x3878a3['find'](_0x1b5ad7=>_0x1b5ad7['some'](_0xeed0f5=>_0xeed0f5?.['includes']('Course\x20&\x20Sec'))),_0x4c3478=_0x2ca7d1?_0x2ca7d1['findIndex'](_0x28907b=>_0x28907b?.['includes']('Course\x20&\x20Sec')):-1,_0x4f6f7=_0x4c3478!==-1&&_0x2ca7d1?_0x2ca7d1[_0x4c3478+0x2]?.['trim']()??'':'';let _0x5784ab='',_0x15c073='';if(_0x4f6f7){const _0x3c28a8=_0x4f6f7['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x3c28a8&&(_0x5784ab=_0x3c28a8[0x1]??'',_0x3c28a8[0x2]&&(_0x15c073=_0x3c28a8[0x2]['replace'](/^OC/i,'')));}const _0x34115=_0x3878a3['find'](_0x4342a9=>_0x4342a9['some'](_0x4ff168=>_0x4ff168?.['includes']('School\x20Year'))),_0x5d424f=_0x34115?_0x34115['findIndex'](_0x3d7fdc=>_0x3d7fdc?.['includes']('School\x20Year')):-1,_0x5f4244=_0x5d424f!==-1&&_0x34115?_0x34115[_0x5d424f+0x2]?.['trim']()??'':'';let _0x222034=0x0;if(_0x5f4244){const _0x5dd0b5=_0x5f4244['match'](/(\d{4})-(\d{4})/);if(_0x5dd0b5){const _0x53ceca=(_0x5dd0b5[0x1]??'')['slice'](0x2),_0x27ac52=(_0x5dd0b5[0x2]??'')['slice'](0x2);_0x222034=parseInt(_0x53ceca+_0x27ac52,0xa);}}const _0x315d3b={'faculty':_0x110efc,'course':_0x5784ab,'section':_0x15c073,'semester':_0x3e8812,'sy':_0x222034},_0x1a4aa1=_0x3878a3['findIndex'](_0x5967f2=>_0x5967f2['some'](_0x262883=>_0x262883?.['trim']()==='CO\x20#'));if(_0x1a4aa1===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x58113a=_0x3878a3[_0x1a4aa1+0x1];if(!_0x58113a)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x28a92b={};let _0x35d262=0x1,_0x13ac8f=0x1;for(let _0x236800=0x3;_0x236800<_0x58113a['length'];_0x236800++){const _0x3ae5b3=_0x58113a[_0x236800];if(!_0x3ae5b3)continue;const _0x241d38='co'+_0x35d262;if(!_0x28a92b[_0x241d38])_0x28a92b[_0x241d38]=[];_0x28a92b[_0x241d38]['push']('ilo'+_0x13ac8f),_0x13ac8f++,_0x13ac8f>0x3&&(_0x35d262++,_0x13ac8f=0x1);}const _0x330076=_0x3878a3['findIndex'](_0x1ab818=>_0x1ab818['includes']('Name\x20of\x20Students'));if(_0x330076===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x415362=_0x3878a3[_0x330076];if(!_0x415362)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x1942d7=_0x415362['findIndex'](_0x2129b8=>_0x2129b8?.['includes']('Name\x20of\x20Students'));if(_0x1942d7===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x6553b1=_0x1942d7+0x2,_0x3a7b2e=[];for(let _0x18ec50=_0x330076+0x1;_0x18ec50<_0x3878a3['length'];_0x18ec50++){const _0x484503=_0x3878a3[_0x18ec50];if(!_0x484503)continue;if(_0x484503['some'](_0x392512=>_0x392512?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x392512?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x392512?.['toUpperCase']()['includes']('INACTIVE')||_0x392512?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x484503[_0x1942d7])continue;const _0x8216e1=_0x484503[_0x1942d7]['replace'](/"/g,'')['trim'](),_0xaa2af3=_0x484503['slice'](_0x6553b1)['map'](_0x38b5ea=>_0x38b5ea===null?null:!isNaN(Number(_0x38b5ea))?parseFloat(_0x38b5ea):0x0);let _0x1a23de=0x0;const _0x2376a1={};Object['entries'](_0x28a92b)['forEach'](([_0x522a0e,_0x18158f])=>{const _0x325bda={};_0x18158f['forEach'](_0x29482b=>{_0x325bda[_0x29482b]=_0xaa2af3[_0x1a23de]??0x0,_0x1a23de++;}),_0x2376a1[_0x522a0e]={'transmuted_score':_0x325bda};}),_0x3a7b2e['push']({'student_name':_0x8216e1,'coaep':_0x2376a1});}const _0x252657=_0x3878a3['find'](_0x3a883e=>_0x3a883e['some'](_0x440586=>_0x440586?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x54054a=_0x3878a3['find'](_0x2b46a7=>_0x2b46a7['some'](_0x4eb75a=>_0x4eb75a?.['includes']('AVERAGE'))),_0x4608e5=_0x252657?_0x252657['slice'](_0x6553b1)['map'](_0x302266=>_0x302266&&!isNaN(Number(_0x302266))?parseInt(_0x302266):0x0):[],_0x4d7093=_0x54054a?_0x54054a['slice'](_0x6553b1)['map'](_0x2a3443=>_0x2a3443&&_0x2a3443!=='#DIV/0!'&&!isNaN(Number(_0x2a3443))?parseInt(_0x2a3443):0x0):[],_0xa9e6f={};let _0x55ffcf=0x0;return Object['entries'](_0x28a92b)['forEach'](([_0x285699,_0xca4d12])=>{if(!_0xa9e6f[_0x285699])_0xa9e6f[_0x285699]={};_0xca4d12['forEach'](_0x44abf7=>{_0xa9e6f[_0x285699][_0x44abf7]={'achievedMinimum':_0x4608e5[_0x55ffcf]??0x0,'average':_0x4d7093[_0x55ffcf]??0x0},_0x55ffcf++;});}),{'assessmentData':{'classAssignment':_0x315d3b,'student':_0x3a7b2e,'total':_0xa9e6f}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x1bf056,_0x1eed48){try{const _0x308882=await convertToCSVFile(_0x1eed48),_0x5611d5=await _0x308882['text'](),_0x50102c=parseAssessmentCsv(_0x5611d5),_0x2a40ab=await fetch(_0x1bf056+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x50102c)});if(!_0x2a40ab['ok']){const _0x4f7257=await _0x2a40ab['json']();throw _0x4f7257;}return _0x2a40ab['json']();}catch(_0x35d67c){throw _0x35d67c;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0xa8d22a,_0x31e37f){try{const _0x98a97b=await convertToCSVFile(_0x31e37f),_0x3ca4ef=new FormData();_0x3ca4ef['append']('csvFile',_0x98a97b);const _0x218400=await fetch(_0xa8d22a+'/dept-faculties/upload',{'method':'POST','body':_0x3ca4ef});if(!_0x218400['ok']){const _0x3336e2=await _0x218400['json']();throw _0x3336e2;}return _0x218400['json']();}catch(_0x36058b){throw _0x36058b;}}
|
|
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(_0x4724bb){let _0x515b0e={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x5c29cf=0x0;_0x5c29cf<Math['min'](_0x4724bb['length'],0x14);_0x5c29cf++){const _0x1ee213=(_0x4724bb[_0x5c29cf]??[])['map'](_0xae5a7c=>_0xae5a7c['toLowerCase']()['trim']()),_0x5e8b5b=_0x1ee213['findIndex'](_0x1f4f73=>HEADERS['po']['some'](_0xbff4ef=>_0x1f4f73['toLowerCase']()['includes'](_0xbff4ef))),_0x2dd221=_0x1ee213['findIndex'](_0x5debab=>HEADERS['tl']['some'](_0x31e13f=>_0x5debab['toLowerCase']()['includes'](_0x31e13f))),_0x319f60=_0x1ee213['findIndex'](_0x5c80b2=>HEADERS['pi']['some'](_0x4b7878=>_0x5c80b2['toLowerCase']()['includes'](_0x4b7878))),_0x20fce7=_0x1ee213['findIndex'](_0x426ac4=>HEADERS['fc']['some'](_0x52a8b6=>_0x426ac4['toLowerCase']()['includes'](_0x52a8b6))),_0xeb0b6=_0x1ee213['findIndex'](_0xe9e4c8=>HEADERS['sc']['some'](_0xb4c595=>_0xe9e4c8['toLowerCase']()['includes'](_0xb4c595))),_0x30ec0a=_0x1ee213['findIndex'](_0x3f1ef7=>HEADERS['at']['some'](_0xd67659=>_0x3f1ef7['toLowerCase']()['includes'](_0xd67659))),_0x5bc1db=_0x1ee213['findIndex'](_0x436e3f=>HEADERS['pt']['some'](_0xc5b5d9=>_0x436e3f['toLowerCase']()['includes'](_0xc5b5d9))),_0xe9ad1b=[_0x5e8b5b,_0x2dd221,_0x319f60,_0x20fce7,_0xeb0b6,_0x30ec0a,_0x5bc1db]['filter'](_0x9a9f80=>_0x9a9f80!==-1)['length'];if(_0xe9ad1b>=0x3){_0x515b0e={'headerIdx':_0x5c29cf,'poIdx':_0x5e8b5b,'tlIdx':_0x2dd221,'piIdx':_0x319f60,'fcIdx':_0x20fce7,'scIdx':_0xeb0b6,'atIdx':_0x30ec0a,'ptIdx':_0x5bc1db};break;}}if(_0x515b0e['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x515b0e;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x327896=>{let _0x267bba=_0x327896['split'](',')['reduce']((_0x3b699f,_0x2f6cd1)=>{const _0x51a63a=_0x2f6cd1['trim']();if(_0x51a63a)_0x3b699f['push'](_0x51a63a);return _0x3b699f;},[]);return _0x267bba;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x12cce9=>{try{const _0x3f1e13=_0x168e71['parse'](_0x12cce9,{'skipEmptyLines':![]})['data'],{headerIdx:_0x534ae7,poIdx:_0x1bd98a,tlIdx:_0x47d0aa,piIdx:_0x4147d1,fcIdx:_0x2b58af,scIdx:_0x52d50e,atIdx:_0x427c57,ptIdx:_0x359010}=getPoaepHeader(_0x3f1e13),_0x387974=[];let _0x185f0e={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x476c1f='',_0x17e093='',_0x3be30a='';for(let _0x290f15=_0x534ae7+0x1;_0x290f15<_0x3f1e13['length'];_0x290f15++){const _0x21408e=_0x3f1e13[_0x290f15];if(!_0x21408e)break;const _0x294e3a=_0x21408e[_0x1bd98a]?.['trim']()||'';_0x294e3a!==''&&(_0x185f0e={'po_desc':_0x294e3a,'seq_no':_0x185f0e['seq_no']+0x1,'PerfIndicators':[]},_0x387974['push'](_0x185f0e),_0x476c1f='',_0x17e093='',_0x3be30a='');if(_0x185f0e['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x290f15+'.');const _0x2906c1=_0x21408e[_0x4147d1]?.['trim']()||'';if(_0x2906c1==='')break;const _0x390aa1=_0x21408e[_0x2b58af]?.['trim']()||'';if(_0x390aa1==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x290f15+'.');const _0xcb44ae=_0x21408e[_0x52d50e]?.['trim']()||_0x476c1f;if(_0xcb44ae==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x290f15+'.');_0x476c1f=_0xcb44ae;const _0x3463cc=_0x21408e[_0x427c57]?.['trim']()||_0x17e093;if(_0x3463cc==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x290f15+'.');_0x17e093=_0x3463cc;const _0x381a62=_0x21408e[_0x359010]?.['trim']()||_0x3be30a;if(_0x381a62==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x290f15+'.');_0x3be30a=_0x381a62;const _0x5a7051=parseFormativeCourses(_0x390aa1);if(_0x5a7051['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x290f15+'.');const _0x300f2b=performaceTarget(_0x381a62);if(!_0x300f2b['performance_target']||!_0x300f2b['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x290f15+'.');const _0x13816e={'pi_desc':_0x2906c1,'FormativeCourses':_0x5a7051['map'](_0x58e80c=>({'course_id':_0x58e80c,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0xcb44ae},'TaxonomyLevel':null,'AssessmentTool':{'at_desc':_0x3463cc},'PerformanceTargets':{'target_percent':_0x300f2b['performance_target'],'min_score':_0x300f2b['passing_score']}};_0x185f0e['PerfIndicators']['push'](_0x13816e);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x387974}};}catch(_0x4c0d13){return {'success':![],'error':_0x4c0d13 instanceof Error?_0x4c0d13['message']:_0x4c0d13,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x1b7d12,_0x4216b9,_0x2acbfb,_0x2dbf0e,_0x2ad1f3){try{const _0x3b590b=await convertToCSVFile(_0x4216b9),_0x493f4e=await _0x3b590b['text'](),_0xafff3=parsePOAEP(_0x493f4e),_0x360282=await fetch(_0x1b7d12+'/program-outcomes/poaep/upload?curr_id='+_0x2dbf0e+'&period_id='+_0x2ad1f3,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x2acbfb},'credentials':'include','body':JSON['stringify'](_0xafff3)});if(!_0x360282['ok']){const _0x3317c3=await _0x360282['json']();throw _0x3317c3;}return _0x360282['json']();}catch(_0x395338){throw _0x395338;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(_0x145fb6='DataTable',_0x265ff4){this['name']=_0x145fb6,this['headers']=_0x265ff4,this['table']=[],this['validators']=[],this['state']={};}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getState'](){return this['state'];}['setState']=async _0x2402a9=>{await this['assertInitialized'](),this['state']=_0x2402a9;};['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'](_0x2e76b2){await this['assertInitialized'](),this['table']=_0x2e76b2;}async['initializeTable'](_0x4f4543,_0x575434){try{let _0x5eece0;if(_0x4f4543 instanceof File)_0x5eece0=await this['fromXML'](_0x4f4543,_0x575434);else _0x5eece0=await this['fromCSVString'](_0x4f4543);if(!_0x5eece0['success']||!_0x5eece0['data'])return _0x5eece0;if(_0x5eece0['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x5eece0['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x3f9a3c){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x3f9a3c};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x1f8ed0,_0x2270a6){const _0x2bef16=await convertToCSVFile(_0x1f8ed0,_0x2270a6),_0x52fbe6=await _0x2bef16['text']();return this['fromCSVString'](_0x52fbe6);}async['searchTable'](_0x2fd442){await this['assertInitialized']()['catch'](()=>{return [];});if(!_0x2fd442)return [];const _0x2037d0=[];for(let _0x5d0993=0x0;_0x5d0993<this['table']['length'];_0x5d0993++){const _0x2c78ac=this['table'][_0x5d0993],_0x1ffe99=this['searchRow'](_0x2c78ac,_0x2fd442);for(const _0x2d72ab of _0x1ffe99){_0x2037d0['push']({'row':_0x5d0993,'column':_0x2d72ab['column']});}}return _0x2037d0;}async['validate'](){const _0x4c8f85=[],_0x17de66=[];try{await this['assertInitialized']()['then'](()=>{_0x4c8f85['push']('Table\x20is\x20initialized.');})['catch'](_0x91f7d1=>_0x17de66['push'](_0x91f7d1));if(_0x17de66['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x4c8f85,_0x17de66);const {success:_0x4e2c4a,message:_0x41b0b0,error:_0x22b4d4,data:_0x4fb51e}=await this['toJson']();if(!_0x4fb51e)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x4c8f85['push'](..._0x4fb51e['validMsgs']),_0x17de66['push'](..._0x4fb51e['tableErrors']);const {jsonObj:_0x252b7e}=_0x4fb51e;for(const _0x1479a3 of this['validators']){await _0x1479a3['validate'](_0x4c8f85,_0x17de66,this,_0x252b7e);}let _0x35d41c=this['name']+'\x20ran\x20its\x20validations.';if(_0x4c8f85['length']>0x0)_0x35d41c+='\x20'+_0x4c8f85['length']+'\x20validations\x20were\x20successful.';if(_0x17de66['length']>0x0)_0x35d41c+='\x20'+_0x17de66['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x35d41c,'data':{'validMsgs':_0x4c8f85,'tableErrors':_0x17de66}};}catch(_0x54cd53){return _0x17de66['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x54cd53}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x4c8f85,'tableErrors':_0x17de66}};}}['useValidator'](_0x176a60){this['validators']['push'](_0x176a60);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x192c70){this['name']=_0x192c70;}['getName'](){return this['name'];}['report'](_0x103024,_0x4f9f64,_0x33091d){if(_0x103024['length']>0x0)_0x33091d['push'](..._0x103024);else _0x4f9f64['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'](_0x45a9a6,_0x206a88,_0x141bb6,_0x54e6c9){const _0x426112=[];if(!_0x54e6c9){_0x206a88['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x4297d8=0x0;_0x4297d8<_0x54e6c9['co']['length'];_0x4297d8++){const _0x564e67=_0x54e6c9['co'][_0x4297d8];if(!_0x564e67){(await _0x141bb6['searchTable'](_0x4297d8+0x1+''))['map'](({row:_0x4ffb04,column:_0x1caf21})=>{_0x426112['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x4297d8+0x1)+'.','row':_0x4ffb04,'column':_0x1caf21,'from':this['name']});});continue;}if(!_0x564e67?.['ilo']){(await _0x141bb6['searchTable'](_0x564e67['statement']))['map'](({row:_0x7edd6c,column:_0x59586c})=>{_0x426112['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x4297d8+0x1)+'.','row':_0x7edd6c,'column':_0x59586c,'from':this['name']});});continue;}const _0x142053=_0x564e67['ilo']['length']-0x1,_0x10e865=_0x564e67['ilo'][_0x142053];if(!_0x10e865['taxonomy_level']){(await _0x141bb6['searchTable'](_0x10e865['statement']))['map'](({row:_0x4f4107,column:_0x27b960})=>{_0x426112['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x4297d8+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x4f4107,'column':_0x27b960,'from':this['name']});});continue;}if(_0x10e865['taxonomy_level']!==_0x564e67['taxonomy_level']){(await _0x141bb6['searchTable'](_0x10e865['statement']))['map'](({row:_0x3671e3,column:_0xffddba})=>{_0x426112['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x4297d8+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x10e865['taxonomy_level']?.['toUpperCase']()+'\x20!=\x20'+_0x564e67['taxonomy_level']?.['toUpperCase']()+')','row':_0x3671e3,'column':_0xffddba,'from':this['name']});});continue;}}this['report'](_0x426112,_0x45a9a6,_0x206a88);}}
|
|
49
49
|
|
|
50
|
-
const whitelist$1=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](
|
|
50
|
+
const whitelist$1=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](_0x41c63c,_0x3e71b7,_0x3e2874,_0x4f5025){const _0x173e2b=[];if(!_0x4f5025){_0x3e71b7['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x1da3de=0x0;_0x1da3de<_0x4f5025['co']['length'];_0x1da3de++){const _0x174f25=_0x4f5025['co'][_0x1da3de];if(!_0x174f25['taxonomy_level']){_0x173e2b['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x1da3de+0x1),'from':this['name']});continue;}if(!whitelist$1['includes'](_0x174f25['taxonomy_level'])){const {row:_0x43c075,column:_0xf5c87e}=(await _0x3e2874['searchTable'](_0x174f25['statement']))[0x0];_0x43c075&&_0x173e2b['push']({'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20APPLYING:\x20'+_0x174f25['taxonomy_level']['toUpperCase'](),'row':_0x43c075,'column':_0xf5c87e,'from':this['name']});}}this['report'](_0x173e2b,_0x41c63c,_0x3e71b7);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'](_0x1a3284,_0x128eef,_0x3c632d,_0x5443b5){const _0x4253ac=[];if(!_0x5443b5){_0x128eef['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x3c74e2=0x0;_0x3c74e2<_0x5443b5['co']['length'];_0x3c74e2++){const _0x45bb9c=_0x5443b5['co'][_0x3c74e2];if(!_0x45bb9c){(await _0x3c632d['searchTable'](_0x3c74e2+0x1+''))['map'](({row:_0x1b14f2,column:_0x49bf02})=>{_0x4253ac['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x3c74e2+0x1)+'.','row':_0x1b14f2,'column':_0x49bf02,'from':this['name']});});continue;}if(!_0x45bb9c?.['ilo']){(await _0x3c632d['searchTable'](_0x45bb9c['statement']))['map'](({row:_0x29190b,column:_0x4a81af})=>{_0x4253ac['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x3c74e2+0x1)+'.','row':_0x29190b,'column':_0x4a81af,'from':this['name']});});continue;}const _0x318deb=(await _0x3c632d['searchTable'](_0x45bb9c['statement']))[0x0]??{'row':-1,'column':-1},_0x40a028=_0x45bb9c['ilo']['map'](_0x2e33a0=>taxoOrder[_0x2e33a0['taxonomy_level']]);let _0x44fd99=_0x40a028[0x0];for(let _0x28dc3b=0x1;_0x28dc3b<_0x40a028['length'];_0x28dc3b++){if(_0x40a028[_0x28dc3b]<_0x44fd99){_0x4253ac['push']({'error':'Under\x20CO\x20'+(_0x3c74e2+0x1)+',\x20ILO\x20'+(_0x28dc3b+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x28dc3b+'\x27s.','row':_0x318deb['row'],'column':_0x318deb['column']+_0x28dc3b,'from':this['name']});continue;}_0x44fd99=_0x40a028[_0x28dc3b];}}this['report'](_0x4253ac,_0x1a3284,_0x128eef);}}
|
|
55
55
|
|
|
56
|
-
const minPerfTarget$1=0x32,minPassScore$1=0x32;class MinILOPerfTarget extends DTValidator{constructor(){super('MIN_ILO_PERF_TARGET');}async['validate'](
|
|
56
|
+
const minPerfTarget$1=0x32,minPassScore$1=0x32;class MinILOPerfTarget extends DTValidator{constructor(){super('MIN_ILO_PERF_TARGET');}async['validate'](_0x30f74a,_0x2a482a,_0x3cc869,_0x34d4b4){const {success:_0x5003bc,data:_0x4549d3}=_0x3cc869['getTable'](),_0x201d2f=[];if(!_0x5003bc){_0x201d2f['push']({'error':'Unable\x20to\x20access\x20COAEP\x20table.','from':this['name']});return;}const {table:_0x186279}=_0x4549d3;for(let _0x4497d1=0x0;_0x4497d1<_0x186279['length'];_0x4497d1++){const _0x417528=_0x186279[_0x4497d1],[_0x32efd5,_0x152fc6]=_0x417528[0x4];if(!_0x32efd5)_0x201d2f['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x4497d1,'column':0x4,'from':this['name']});else _0x32efd5<minPerfTarget$1&&_0x201d2f['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget$1+'.','row':_0x4497d1,'column':0x4,'from':this['name']});if(!_0x152fc6)_0x201d2f['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x4497d1,'column':0x4,'from':this['name']});else _0x152fc6<minPassScore$1&&_0x201d2f['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore$1+'.','row':_0x4497d1,'column':0x4,'from':this['name']});}this['report'](_0x201d2f,_0x30f74a,_0x2a482a);}}
|
|
57
57
|
|
|
58
|
-
const
|
|
58
|
+
const DEFAULT_CO_COG_LEVEL='D';
|
|
59
59
|
|
|
60
|
-
const
|
|
60
|
+
const coaepHeaders=['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target'];class CoaepDT extends DataTable{constructor(){super('CoaepDT',coaepHeaders),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 MinILOPerfTarget());}async['validateFields'](_0x575020,_0x178cb6){await this['assertInitialized']()['catch'](_0x29882a=>{_0x178cb6['push'](_0x29882a);return;});const _0x21f7f8=[];let _0x471606=null,_0x37b8c5=null;for(let _0x1a9a35=0x0;_0x1a9a35<this['table']['length'];_0x1a9a35++){const _0xdba6d7=[],_0x187a41=this['table'][_0x1a9a35],_0x3584b8=_0x187a41[0x0]||_0x471606,_0x22b644=_0x187a41[0x1]||_0x37b8c5,_0x598ad7=_0x187a41[0x2],_0x5952fe=_0x187a41[0x3],_0x20463d=_0x187a41[0x4];if(!_0x3584b8)_0xdba6d7['push'](0x0);if(!_0x22b644)_0xdba6d7['push'](0x1);if(!_0x598ad7)_0xdba6d7['push'](0x2);if(!_0x5952fe)_0xdba6d7['push'](0x3);if(!_0x20463d)_0xdba6d7['push'](0x4);if(_0x37b8c5!==_0x22b644)this['validateObjectiveGrammar'](_0x22b644,_0x1a9a35,0x1,_0x178cb6);_0x471606=_0x3584b8,_0x37b8c5=_0x22b644;for(const _0x287c90 of _0xdba6d7){_0x21f7f8['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x287c90],'row':_0x1a9a35,'column':_0x287c90});}if(_0x598ad7)this['validateObjectiveGrammar'](_0x598ad7,_0x1a9a35,0x2,_0x178cb6);}if(_0x21f7f8['length']>0x0)_0x178cb6['push'](..._0x21f7f8);else _0x575020['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x247695){try{const _0x23a274=[],_0x5c9b0e=_0x168e71['parse'](_0x247695,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x447830,coIdx:_0x271e5a,iloIdx:_0x2d3e05,assessToolIdx:_0x518eb2,perfTargetIdx:_0x4fc900}=getCoaepHeader(_0x5c9b0e);if(_0x447830===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x5c9b0e['forEach'](_0x5dd75c=>{const _0x449331=_0x5dd75c['indexOf']('Name\x20of\x20Faculty:'),_0x26876f=_0x5dd75c['indexOf']('School\x20Year'),_0x312cf1=_0x5dd75c['indexOf']('Course:'),_0x20e5f2=_0x5dd75c['indexOf']('Semester');_0x449331!==-0x1&&(this['state']['faculty']=_0x5dd75c[_0x449331+0x1]?.['trim']()||this['state']['faculty']);_0x26876f!==-0x1&&(this['state']['sy']=_0x5dd75c[_0x26876f+0x1]?.['trim']()||this['state']['sy']);_0x312cf1!==-0x1&&(this['state']['course']=_0x5dd75c[_0x312cf1+0x1]?.['trim']()||this['state']['course']);if(_0x20e5f2!==-0x1){const _0x561ae9=_0x5dd75c[_0x20e5f2+0x1]?.['trim']()||'',_0x5bf007=_0x561ae9['match'](/\d+/)?.[0x0];this['state']['semester']=_0x5bf007?parseInt(_0x5bf007,0xa):this['state']['semester'];}});for(let _0x205ec7=0x0;_0x205ec7<=_0x5c9b0e['length'];_0x205ec7++){const _0x408ec2=_0x5c9b0e[_0x205ec7];if(!_0x408ec2)break;if(_0x205ec7<=_0x447830)continue;if(!_0x408ec2[_0x2d3e05])break;let _0x2474fc=_0x408ec2[_0x271e5a-0x1]?.['trim']()||'',_0x39d875=_0x408ec2[_0x271e5a]?.['trim']()||'',_0x47adc9=_0x408ec2[_0x2d3e05]?.['trim']()||'';/^\d+$/['test'](_0x408ec2[_0x271e5a]?.['trim']()||'')&&(_0x2474fc=_0x408ec2[_0x271e5a]?.['trim']()||'',_0x39d875=_0x408ec2[_0x271e5a+0x1]?.['trim']()||'');let _0x13bcce=null;if(_0x39d875){const {cognitive_level:_0xdf2c57,taxonomy_level:_0x430481,verb:_0x2d7628,rest:_0x1b71b2}=extractFromObjective(_0x39d875);_0x13bcce=[_0xdf2c57??DEFAULT_CO_COG_LEVEL,_0x430481,_0x2d7628,_0x1b71b2];}let _0x4c3210;{const {cognitive_level:_0x1738b1,taxonomy_level:_0x27b4c4,verb:_0x5f0be6,rest:_0x554a9b}=extractFromObjective(_0x47adc9);_0x4c3210=[_0x1738b1,_0x27b4c4,_0x5f0be6,_0x554a9b];}const _0x3184e7=_0x408ec2[_0x4fc900]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x527ddb,passing_score:_0x12e32d}=performaceTarget(_0x3184e7);_0x23a274['push']([_0x2474fc,_0x13bcce,_0x4c3210,_0x408ec2[_0x518eb2]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x527ddb,_0x12e32d]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x23a274};}catch(_0x1f6e96){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x1f6e96};}}async['toJson'](){const _0x33f40d=[],_0x1aec21=[],_0x36769f='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x24d499={'faculty':this['state']['faculty'],'course':this['state']['course'],'sy':this['state']['sy'],'semester':this['state']['semester'],'co':[]};let _0x4fa1ef=null,_0xf187e4='',_0x135c77=[null,null];this['table']['forEach']((_0x51f568,_0x342422)=>{if(_0x342422===0x0&&!_0x51f568[0x1])_0x1aec21['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x36769f});_0x51f568[0x1]&&(_0xf187e4='',_0x135c77=[null,null]);const _0x236457=_0x51f568[0x1],_0x111605=_0x51f568[0x2],_0x3b4654=_0x51f568[0x3]||_0xf187e4,_0x29f430=_0x51f568[0x4]||_0x135c77;if(!_0x111605)_0x1aec21['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x36769f});if(!_0x3b4654)_0x1aec21['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x342422,'column':0x3,'from':_0x36769f});if(!_0x29f430)_0x1aec21['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x342422,'column':0x4,'from':_0x36769f});if(_0x236457){const [_0x13b6da,_0x327369,_0x31ef42,_0x51f302]=_0x236457,_0x336cb4={'statement':_0x51f302,'ilo':[],'taxonomy_level':_0x327369,'cognitive_level':_0x13b6da,'verb':_0x31ef42};_0x4fa1ef=_0x336cb4,_0x24d499['co']['push'](_0x336cb4);}const [_0x3b27b4,_0xab5454,_0x26c36d,_0x23010b]=_0x111605,[_0x2866a4,_0x2fd3c3]=_0x29f430,_0x3ca2e9={'statement':_0x23010b,'assessment_tool':_0x3b4654,'performance_target':_0x2866a4,'passing_score':_0x2fd3c3,'cognitive_level':_0x3b27b4,'taxonomy_level':_0xab5454,'verb':_0x26c36d};_0x4fa1ef['ilo']['push'](_0x3ca2e9);});if(_0x1aec21['length'])return _0x1aec21['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x36769f}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x24d499,'validMsgs':_0x33f40d,'tableErrors':_0x1aec21}};return _0x33f40d['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x24d499,'validMsgs':_0x33f40d,'tableErrors':_0x1aec21}};}catch(_0x4e77da){return _0x1aec21['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x36769f}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x4e77da,'data':{'jsonObj':null,'tableErrors':_0x1aec21}};}}['validateObjectiveGrammar'](_0x53ea32,_0x4e9b54,_0x7e4a0c,_0x1a55da){if(!_0x53ea32){_0x1a55da['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x4e9b54,'column':_0x7e4a0c,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x522657,_0x45bb6b,_0x5bef9d,_0x549b13]=_0x53ea32,_0x150584=[];if(!_0x522657)_0x150584['push']('Cognitive\x20Level');if(!_0x45bb6b)_0x150584['push']('Taxonomy\x20Level');if(!_0x5bef9d)_0x150584['push']('Verb');if(!_0x150584['length'])return;_0x1a55da['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x150584['join'](',\x20')+'.','row':_0x4e9b54,'column':_0x7e4a0c,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}['searchRow'](_0x325d6c,_0x42c00a){const _0x2a19b1=[],[_0x5ee365,_0x5d7e6a,_0x40b7e4,_0xbc1d87,_0x5513f4]=_0x325d6c;if(_0x5ee365===_0x42c00a)_0x2a19b1['push']({'column':0x0});if(_0x5d7e6a&&(_0x5d7e6a[0x0]===_0x42c00a||_0x5d7e6a[0x1]===_0x42c00a||_0x5d7e6a[0x2]===_0x42c00a||_0x5d7e6a[0x3]===_0x42c00a))_0x2a19b1['push']({'column':0x1});if(_0x40b7e4&&(_0x40b7e4[0x0]===_0x42c00a||_0x40b7e4[0x1]===_0x42c00a||_0x40b7e4[0x2]===_0x42c00a||_0x40b7e4[0x3]===_0x42c00a))_0x2a19b1['push']({'column':0x2});if(_0xbc1d87===_0x42c00a)_0x2a19b1['push']({'column':0x3});if(_0x5513f4&&(_0x5513f4[0x0]===_0x42c00a||_0x5513f4[0x1]===_0x42c00a))_0x2a19b1['push']({'column':0x4});return _0x2a19b1;}}
|
|
61
61
|
|
|
62
|
-
const
|
|
62
|
+
const whitelist=['applying','analyzing','evaluating','creating'];class MinPItaxo extends DTValidator{constructor(){super('MIN_PI_TAXO');}async['validate'](_0x3b2224,_0x6f82b8,_0x201223,_0x6cf3c3){const _0x141784=[],{success:_0x1c1d41,data:_0x1bcd4b}=_0x201223['getTable']();if(!_0x1c1d41){_0x6f82b8['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0xecf254}=_0x1bcd4b;for(let _0x587b18=0x0;_0x587b18<_0xecf254['length'];_0x587b18++){const _0x54e05b=_0xecf254[_0x587b18],_0x4c3375=_0x54e05b[0x1]?.['toLowerCase']();if(!_0x4c3375)continue;!whitelist['includes'](_0x4c3375)&&_0x141784['push']({'error':'Cannot\x20have\x20PO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x4c3375['toUpperCase'](),'row':_0x587b18,'column':0x1,'from':this['name']});}this['report'](_0x141784,_0x3b2224,_0x6f82b8);return;}}
|
|
63
63
|
|
|
64
|
-
const
|
|
64
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPIPerfTarget extends DTValidator{constructor(){super('MIN_PI_PERF_TARGET');}async['validate'](_0xd82abc,_0x41c462,_0x2c4677,_0x51d041){const _0x49a153=[],{success:_0xe9d67e,data:_0xc9ad1e}=_0x2c4677['getTable']();if(!_0xe9d67e){_0x41c462['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x27bb15}=_0xc9ad1e;for(let _0x485cfc=0x0;_0x485cfc<_0x27bb15['length'];_0x485cfc++){const _0x24d274=_0x27bb15[_0x485cfc],[_0x49054e,_0x1d93b9]=_0x24d274[0x6];if(!_0x49054e)_0x49a153['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x485cfc,'column':0x6,'from':this['name']});else _0x49054e<minPerfTarget&&_0x49a153['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x485cfc,'column':0x6,'from':this['name']});if(!_0x1d93b9)_0x49a153['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x485cfc,'column':0x6,'from':this['name']});else _0x1d93b9<minPassScore&&_0x49a153['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x485cfc,'column':0x6,'from':this['name']});}this['report'](_0x49a153,_0xd82abc,_0x41c462);return;}}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
const poaepHeaders=['Program\x20Outcome','Taxonomy\x20Level','Performance\x20Indicator','Formative\x20Course','Summative\x20Course','Assessment\x20Tool','Performance\x20Target'];class PoaepDT extends DataTable{constructor(){super('PoaepDT',poaepHeaders),this['state']={'program':null},this['useValidator'](new MinPItaxo()),this['useValidator'](new MinPIPerfTarget());}async['fromCSVString'](_0x3b2fb9){try{const _0x4a7f7e=[],_0x55c54e=_0x168e71['parse'](_0x3b2fb9,{'skipEmptyLines':![]})['data'];_0x55c54e['forEach'](_0x42bdcd=>{_0x42bdcd['forEach'](_0x5c8694=>{_0x5c8694['includes']('PROGRAM:')&&(this['state']['program']=_0x5c8694['replace']('PROGRAM:','')['trim']()['toUpperCase']());});});const {headerIdx:_0x148712,poIdx:_0x3cd4c7,tlIdx:_0x4e9061,piIdx:_0x619bd4,fcIdx:_0x46a427,scIdx:_0x5cb8b6,atIdx:_0x3e1480,ptIdx:_0x3df8ea}=getPoaepHeader(_0x55c54e);if(_0x148712===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20check\x20the\x20CSV.');let _0x29f3e8='',_0x33bd1d='',_0x2c73b5='';for(let _0x3f3121=_0x148712+0x1;_0x3f3121<_0x55c54e['length'];_0x3f3121++){const _0xc03d79=_0x55c54e[_0x3f3121];if(!_0xc03d79)break;if(_0x3f3121<=_0x148712)continue;let _0x5d6eb1=_0xc03d79[_0x3cd4c7]?.['trim']()||'';if(_0x5d6eb1){_0x29f3e8='',_0x33bd1d='',_0x2c73b5='';const [_0x340638,_0x11949b]=this['extractPoDesc'](_0x5d6eb1);if(_0x11949b)_0x5d6eb1=_0x11949b;}const _0x1ecba1=_0xc03d79[_0x4e9061]?.['trim']()['toLowerCase']()||null,_0x4b9eee=_0xc03d79[_0x619bd4]?.['trim']()||'',_0x18bef5=_0xc03d79[_0x46a427]?.['trim']()||'',_0x5a61ff=_0xc03d79[_0x5cb8b6]?.['trim']()||_0x29f3e8,_0x2f62af=_0xc03d79[_0x3e1480]?.['trim']()||_0x33bd1d,_0x402a28=_0xc03d79[_0x3df8ea]?.['trim']()||_0x2c73b5,{performance_target:_0xeef4bd,passing_score:_0x5bff0b}=performaceTarget(_0x402a28);if(!_0x18bef5)break;const _0x3b34c1=_0x18bef5['split'](',')['map'](_0x17a748=>_0x17a748['trim']());_0x4a7f7e['push']([_0x5d6eb1,_0x1ecba1,_0x4b9eee,_0x3b34c1,_0x5a61ff,_0x2f62af,[_0xeef4bd,_0x5bff0b]]),_0x29f3e8=_0x5a61ff,_0x33bd1d=_0x2f62af,_0x2c73b5=_0x402a28;}if(_0x4a7f7e['length']===0x0)throw new Error('No\x20data\x20parsed.\x20Please\x20check\x20the\x20CSV.');return {'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':_0x4a7f7e};}catch(_0x25242b){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x25242b};}}async['toJson'](){const _0x5432c8=[],_0x5b5284=[],_0x348345='POAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x168dbc={'po':[]};let _0x4a2b69={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x552083=null,_0x5f39bc=null,_0x5b455c=null;for(let _0x42a037=0x0;_0x42a037<this['table']['length'];_0x42a037++){const _0x94fdca=this['table'][_0x42a037],_0x386a07=[],_0x2f1c23=_0x94fdca[0x0]?.['trim']()||null;_0x2f1c23&&_0x2f1c23!==_0x4a2b69['po_desc']&&(_0x4a2b69={'po_desc':_0x2f1c23,'seq_no':_0x4a2b69['seq_no']+0x1,'PerfIndicators':[]},_0x168dbc['po']['push'](_0x4a2b69),_0x552083=null,_0x5f39bc=null,_0x5b455c=null);if(_0x4a2b69['po_desc']==='')_0x5b5284['push']({'error':'Cannot\x20start\x20with\x20empty\x20Program\x20Outcome.','row':_0x42a037,'column':0x0,'from':_0x348345});const _0x3b474e=_0x94fdca[0x1]||null,_0x190fab=_0x94fdca[0x2]||null,_0x3b2095=_0x94fdca[0x3]||null,_0x3fbba4=_0x94fdca[0x4]||_0x552083,_0x5f0f17=_0x94fdca[0x5]||_0x5f39bc,_0x6412b5=_0x94fdca[0x6]||_0x5b455c;(!_0x3b2095||_0x3b2095['length']===0x0)&&_0x5b5284['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x42a037,'column':0x3,'from':_0x348345});!_0x6412b5&&_0x5b5284['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x42a037,'column':0x6,'from':_0x348345});if(_0x386a07['length']>0x0){_0x5b5284['push'](..._0x386a07);continue;}const _0x4f0d34={'pi_desc':_0x190fab,'FormativeCourses':_0x3b2095['map'](_0x51eaec=>({'course_id':_0x51eaec,'cognitive_level':null})),'SummativeCourse':{'course_id':_0x3fbba4},'TaxonomyLevel':_0x3b474e?{'label':_0x3b474e}:null,'AssessmentTool':{'at_desc':_0x5f0f17},'PerformanceTargets':{'target_percent':_0x6412b5[0x0],'min_score':_0x6412b5[0x1]}};_0x4a2b69['PerfIndicators']['push'](_0x4f0d34);}if(_0x5b5284['length']>0x0)return _0x5b5284['push']({'error':'Converted\x20POAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x348345}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x168dbc,'validMsgs':_0x5432c8,'tableErrors':_0x5b5284}};return _0x5432c8['push']('Successfully\x20converted\x20POAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':{'jsonObj':_0x168dbc,'validMsgs':_0x5432c8,'tableErrors':_0x5b5284}};}catch(_0x2c7770){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x2c7770};}}async['validateFields'](_0x169a90,_0x19e53d){await this['assertInitialized']()['catch'](_0x508fe7=>{_0x19e53d['push'](_0x508fe7);return;});const _0x4da476=[];let _0x2da91a=null,_0x51367e=null,_0x3a72c0=null,_0x50006e=null;for(let _0x3cb950=0x0;_0x3cb950<this['table']['length'];_0x3cb950++){const _0x306780=[],_0x2f6d7d=this['table'][_0x3cb950];_0x2f6d7d[0x0]&&_0x2f6d7d[0x0]!==_0x2da91a&&(_0x51367e=null,_0x3a72c0=null,_0x50006e=null);const _0x2da455=_0x2f6d7d[0x0]||_0x2da91a,_0x1def4b=_0x2f6d7d[0x1]||null,_0x4a171d=_0x2f6d7d[0x2]||null,_0xe58008=_0x2f6d7d[0x3]||null,_0xd2bcfb=_0x2f6d7d[0x4]||_0x51367e,_0x3940db=_0x2f6d7d[0x5]||_0x3a72c0,_0x55e475=_0x2f6d7d[0x6]||_0x50006e;if(!_0x2da455)_0x306780['push'](0x0);if(!_0x1def4b)_0x306780['push'](0x1);if(!_0x4a171d)_0x306780['push'](0x2);if(!_0xe58008)_0x306780['push'](0x3);if(!_0xd2bcfb)_0x306780['push'](0x4);if(!_0x3940db)_0x306780['push'](0x5);if(!_0x55e475)_0x306780['push'](0x6);_0x306780['length']>0x0&&_0x306780['forEach'](_0x4eb54b=>{_0x4da476['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x4eb54b]+'.','row':_0x3cb950,'column':_0x4eb54b,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'});}),_0xe58008?.['length']===0x0&&_0x4da476['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x3cb950,'column':0x3,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'}),_0x2da91a=_0x2da455,_0x51367e=_0xd2bcfb,_0x3a72c0=_0x3940db,_0x50006e=_0x55e475;}if(_0x4da476['length']>0x0)_0x19e53d['push'](..._0x4da476);else _0x169a90['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}['extractPoDesc'](_0xdbf307){const _0x4ffe90=/^.*(PO\d+):(.*)$/,_0xa4848=_0x4ffe90['exec'](_0xdbf307['trim']());return _0xa4848?_0xa4848['slice'](0x1):['',_0xdbf307['trim']()];}['searchRow'](_0x46360f,_0x59baae){const _0x165966=[],[_0x3a8639,_0x5ef8bf,_0x418f2c,_0x22cdea,_0x8428a1,_0x26c0c8,_0x30cc82]=_0x46360f;if(_0x3a8639===_0x59baae)_0x165966['push']({'column':0x0});if(_0x5ef8bf===_0x59baae)_0x165966['push']({'column':0x1});if(_0x418f2c===_0x59baae)_0x165966['push']({'column':0x2});if(_0x22cdea&&_0x22cdea['includes'](_0x59baae))_0x165966['push']({'column':0x3});if(_0x8428a1===_0x59baae)_0x165966['push']({'column':0x4});if(_0x26c0c8===_0x59baae)_0x165966['push']({'column':0x5});if(_0x30cc82&&(_0x30cc82[0x0]===_0x59baae||_0x30cc82[0x1]===_0x59baae))_0x165966['push']({'column':0x6});return _0x165966;}}
|
|
67
|
+
|
|
68
|
+
class Client{['BASE_URL'];constructor(_0x28633e){this['BASE_URL']=_0x28633e;}['Parser'](){return {'curriculum':async _0x3c36f5=>{const _0x4b1292=await uploadCurriculum(this['BASE_URL'],_0x3c36f5);return _0x4b1292;},'courseOffering':async _0x1d0d4e=>{const _0x2dce5c=await uploadCourseOffering(this['BASE_URL'],_0x1d0d4e);return _0x2dce5c;},'coaep':async(_0x10821d,_0x2b3cb3)=>{const _0x5ef105=await uploadCOAEP(this['BASE_URL'],_0x10821d,_0x2b3cb3);return _0x5ef105;},'enrolledStudent':async _0x1a6c55=>{const _0x2540b7=await uploadEnrolledStudent(this['BASE_URL'],_0x1a6c55);return _0x2540b7;},'classlist':async(_0x5e741f,_0xd1ad7e,_0x27f07a)=>{const _0x696eaf=await uploadClassList(this['BASE_URL'],_0x5e741f,_0xd1ad7e,_0x27f07a);return _0x696eaf;},'assessmentData':async _0x21aae0=>{const _0x874d99=await uploadAssessmentData(this['BASE_URL'],_0x21aae0);return _0x874d99;},'deptFaculty':async _0x2e4cbf=>{const _0x410a2d=await uploadDeptFaculty(this['BASE_URL'],_0x2e4cbf);return _0x410a2d;},'poaep':async(_0x574ba4,_0x4101e6,_0x83dc69,_0x411f76)=>{const _0x3976d6=await uploadPOAEP(this['BASE_URL'],_0x574ba4,_0x4101e6,_0x83dc69,_0x411f76);return _0x3976d6;},'CoaepDT':CoaepDT,'PoaepDT':PoaepDT};}}
|
|
67
69
|
|
|
68
70
|
export { Client as default };
|