@obe-loms/coms-parser 1.6.9 → 1.6.11
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/PoaepDT.d.ts +19 -1
- package/DataTable/types/CoaepDTRow.d.ts +9 -1
- package/DataTable/types/PoaepDTRow.d.ts +18 -3
- package/bundle.js +30 -30
- package/package.json +1 -1
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { POAEP } from "../../types/poaep";
|
|
2
|
+
import DataTableException from "../types/DataTableException";
|
|
3
|
+
import ParserResult from "../types/ParserResult";
|
|
4
|
+
import { DataTable } from "./DataTable";
|
|
5
|
+
import { PoaepRow } from "../types/PoaepDTRow";
|
|
6
|
+
export declare class PoaepDT extends DataTable<POAEP, PoaepRow> {
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the DataTable for POAEP
|
|
9
|
+
* Also sets up custom validators for the DataTable
|
|
10
|
+
*/
|
|
11
|
+
constructor();
|
|
12
|
+
fromCSVString(csvString: string): Promise<ParserResult<PoaepRow[]>>;
|
|
13
|
+
toJson(): Promise<ParserResult<{
|
|
14
|
+
jsonObj: POAEP;
|
|
15
|
+
validMsgs: string[];
|
|
16
|
+
tableErrors: DataTableException[];
|
|
17
|
+
}>>;
|
|
18
|
+
validateFields(validMsgs: string[], tableErrors: DataTableException[]): Promise<void>;
|
|
19
|
+
}
|
|
@@ -24,10 +24,18 @@ export type CoaepDT_ILO = [
|
|
|
24
24
|
* Represents the Assessment Tool column in the internal COAEP DataTable.
|
|
25
25
|
*/
|
|
26
26
|
export type CoaepDT_AT = string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Represents the Performance Target column in the internal COAEP DataTable.
|
|
29
|
+
*/
|
|
30
|
+
export type CoaepDT_Perf = number | null;
|
|
31
|
+
/**
|
|
32
|
+
* Represents the Passing Score column in the internal COAEP DataTable.
|
|
33
|
+
*/
|
|
34
|
+
export type CoaepDT_Pass = number | null;
|
|
27
35
|
/**
|
|
28
36
|
* Represents the Performance Target and Passing Score tuple column in the internal COAEP DataTable.
|
|
29
37
|
* */
|
|
30
|
-
export type CoaepDT_PT = [
|
|
38
|
+
export type CoaepDT_PT = [CoaepDT_Perf, CoaepDT_Pass];
|
|
31
39
|
/**
|
|
32
40
|
* Represents a row in the internal COAEP DataTable.
|
|
33
41
|
* @column 0: CO Number: string | null
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import Taxonomy from "../../types/Taxonomy";
|
|
1
2
|
export type PoaepDT_PO = string | null;
|
|
2
|
-
export type PoaepDT_Taxo =
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
3
|
+
export type PoaepDT_Taxo = Taxonomy | null;
|
|
4
|
+
export type PoaepDT_PI = string | null;
|
|
5
|
+
export type PoaepDT_FC = string | null;
|
|
6
|
+
export type PoaepDT_SC = string | null;
|
|
7
|
+
export type PoaepDT_AT = string | null;
|
|
8
|
+
export type PoaepDT_Perf = number | null;
|
|
9
|
+
export type PoaepDT_Pass = number | null;
|
|
10
|
+
export type PoaepDT_PT = [PoaepDT_Perf, PoaepDT_Pass];
|
|
11
|
+
export type PoaepRow = [
|
|
12
|
+
PoaepDT_PO,
|
|
13
|
+
PoaepDT_Taxo,
|
|
14
|
+
PoaepDT_PI,
|
|
15
|
+
PoaepDT_FC[],
|
|
16
|
+
PoaepDT_SC,
|
|
17
|
+
PoaepDT_AT,
|
|
18
|
+
PoaepDT_PT
|
|
19
|
+
];
|
package/bundle.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x492033 from 'papaparse';
|
|
2
|
+
import * as _0xe3a938 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x12ba08){let _0x5482b3='',_0x5d28e='',_0x4aa519=0x0,_0x2f898e=null;const _0x325447=[];return _0x492033['parse'](_0x12ba08,{'skipEmptyLines':!![],'complete':_0x34ed69=>{_0x34ed69['data']['forEach'](_0x28e06d=>{const _0x2a0e38=_0x28e06d['map'](_0x24bbb9=>(_0x24bbb9??'')['toString']()['trim']()),_0x3a2ce8=_0x2a0e38[0x0]??'';if(_0x3a2ce8['includes']('Rev#')){const _0xf41ec4=_0x3a2ce8['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0xf41ec4&&(_0x5482b3=_0xf41ec4[0x1]?.['trim']()??'',_0x5d28e=_0xf41ec4[0x2]?.['trim']()??'',_0x4aa519=parseInt(_0xf41ec4[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x3a2ce8)){_0x2f898e=0x1;return;}if(/SECOND YEAR/i['test'](_0x3a2ce8)){_0x2f898e=0x2;return;}if(/THIRD YEAR/i['test'](_0x3a2ce8)){_0x2f898e=0x3;return;}if(/FOURTH YEAR/i['test'](_0x3a2ce8)){_0x2f898e=0x4;return;}if(/FIFTH YEAR/i['test'](_0x3a2ce8)){_0x2f898e=0x5;return;}if(/First Semester/i['test'](_0x3a2ce8)||/Second Semester/i['test'](_0x3a2ce8)||/Summer/i['test'](_0x3a2ce8))return;const _0x500c8c=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x500c8c['forEach'](({sem:_0x559f92,offset:_0x1b8478})=>{const _0x335315=_0x2a0e38[_0x1b8478]??'',_0x4858ca=_0x2a0e38[_0x1b8478+0x1]??'',_0x3ba124=_0x2a0e38[_0x1b8478+0x2]??'',_0x11de47=_0x2a0e38[_0x1b8478+0x3]??'',_0x46c06b=_0x2a0e38[_0x1b8478+0x4]??'';_0x335315&&_0x2f898e&&_0x325447['push']({'curr_id':_0x5482b3,'program_name':_0x5d28e,'revision_no':_0x4aa519,'year_level':_0x2f898e,'sem':_0x559f92,'course_id':_0x335315,'course_desc':_0x4858ca,'total_units':_0x3ba124,'lec_unit':_0x11de47,'lab_unit':_0x46c06b});});});}}),_0x325447;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x1c9d06,_0x3d8513){return new Promise((_0x789582,_0x22d776)=>{const _0x1dc6dc=new FileReader();_0x1dc6dc['onload']=_0x50e89f=>{const _0xfb3698=_0x50e89f['target']?.['result'];if(!_0xfb3698){_0x22d776(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x58176b=_0xe3a938['read'](_0xfb3698,{'type':'array'});!_0x3d8513&&(_0x3d8513=_0x58176b['SheetNames'][0x0]);if(!_0x3d8513){_0x22d776(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x100bd1=_0x58176b['Sheets'][_0x3d8513];if(!_0x100bd1){_0x22d776(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x3e4377=_0xe3a938['utils']['sheet_to_csv'](_0x100bd1,{'strip':!![]}),_0x20a1ee=_0x1c9d06['name']['replace'](/\.[^/.]+$/,'.csv'),_0x1c8e0b=new File([_0x3e4377],_0x20a1ee,{'type':'text/csv','lastModified':Date['now']()});_0x789582(_0x1c8e0b);}catch(_0x470cf3){_0x22d776(_0x470cf3);}},_0x1dc6dc['onerror']=()=>{_0x22d776(new Error('File\x20reading\x20failed'));},_0x1dc6dc['readAsArrayBuffer'](_0x1c9d06);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x226f90,_0x42d7d8){try{const _0x20da5c=await convertToCSVFile(_0x42d7d8),_0x12a5af=await _0x20da5c['text'](),_0x20143d=parseCurriculum(_0x12a5af),_0x70180=_0x492033['unparse'](_0x20143d),_0xb44aaa=new File([_0x70180],_0x20da5c['name'],{'type':'text/csv'}),_0x60afd1=new FormData();_0x60afd1['append']('csvFile',_0xb44aaa);const _0x5a199c=await fetch(_0x226f90+'/curr-courses/upload',{'method':'POST','body':_0x60afd1});if(!_0x5a199c['ok']){const _0xbdf009=await _0x5a199c['json']();throw _0xbdf009;}return _0x5a199c['json']();}catch(_0xda9431){throw _0xda9431;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x573199){let _0x3170b8='',_0x52e687='';const _0x38c904=[],_0x1e0560=_0x492033['parse'](_0x573199,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x4fe528=_0x1e0560['data'];for(let _0x31e10e=0x0;_0x31e10e<Math['min'](0x5,_0x4fe528['length']);_0x31e10e++){const _0x2c1499=_0x4fe528[_0x31e10e];if(_0x2c1499&&_0x2c1499['length']>0x0){const _0x29389=_0x2c1499[0x0]?.['toString']()||'',_0x1a698c=_0x29389['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x1a698c){_0x3170b8=_0x1a698c[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x1a698c[0x2]){const _0x1634fd=_0x1a698c[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x1634fd&&_0x1634fd[0x2]&&_0x1634fd[0x4]&&(_0x52e687=_0x1634fd[0x2]+_0x1634fd[0x4]);}}}}let _0x27c2a4=-1;for(let _0x461fc5=0x0;_0x461fc5<_0x4fe528['length'];_0x461fc5++){const _0x57f270=_0x4fe528[_0x461fc5];if(_0x57f270&&_0x57f270['some'](_0x266a26=>_0x266a26?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x27c2a4=_0x461fc5;break;}}if(_0x27c2a4===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x12c1b7={'code':'','description':'','unit':0x0};for(let _0x1b9bf4=_0x27c2a4+0x1;_0x1b9bf4<_0x4fe528['length'];_0x1b9bf4++){const _0xae33b9=_0x4fe528[_0x1b9bf4];if(!_0xae33b9||_0xae33b9['length']<0x8)continue;const _0x421e8b=_0xae33b9[0x1]?.['toString']()['trim']()||'',_0xf41cab=_0xae33b9[0x4]?.['toString']()['trim']()||'',_0x18cbcd=_0xae33b9[0x5]?.['toString']()['trim']()||'',_0x5ce9b4=_0xae33b9[0x6]?.['toString']()['trim']()||'',_0x5228a0=_0xae33b9[0x7]?.['toString']()['trim']()||'',_0x165609=_0xae33b9[0x3]?.['toString']()['trim']()||'';let _0x100e19=_0xae33b9[0x0]?.['toString']()['trim']()||'',_0x40ac35=_0xae33b9[0x2]?.['toString']()['trim']()||'';if(!_0x421e8b)continue;if(!_0x100e19)_0x100e19=_0x12c1b7['code'];if(!_0x40ac35)_0x40ac35=_0x12c1b7['description'];let _0x56c3d2=_0x12c1b7['unit'];if(_0x165609){const _0xdf85f4=_0x165609['match'](/(\d+)/);_0xdf85f4&&_0xdf85f4[0x1]&&(_0x56c3d2=parseInt(_0xdf85f4[0x1],0xa));}const _0x48d537={'sem':_0x3170b8,'school_year':_0x52e687,'code':_0x100e19,'course_no':_0x421e8b,'course_desc':_0x40ac35,'unit':_0x56c3d2,'time':_0xf41cab,'days':_0x18cbcd,'faculty':_0x5ce9b4,'room':_0x5228a0};_0x12c1b7['code']=_0x100e19,_0x12c1b7['description']=_0x40ac35,_0x12c1b7['unit']=_0x56c3d2,_0x38c904['push'](_0x48d537);}return _0x38c904;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x313779,_0x1c407f){try{const _0xfe3fdb=await convertToCSVFile(_0x1c407f),_0x5ac3a9=await _0xfe3fdb['text'](),_0x80473d=parseCourseOffering(_0x5ac3a9),_0x4be88c=_0x492033['unparse'](_0x80473d),_0x11e760=new File([_0x4be88c],_0xfe3fdb['name'],{'type':'text/csv'}),_0x128e61=new FormData();_0x128e61['append']('csvFile',_0x11e760);const _0xac66d6=await fetch(_0x313779+'/course-offerings/upload',{'method':'POST','body':_0x128e61});if(!_0xac66d6['ok']){const _0x137e67=await _0xac66d6['json']();throw _0x137e67;}return _0xac66d6['json']();}catch(_0x3efe86){throw _0x3efe86;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x49dddf){if(!_0x49dddf)return {'performance_target':null,'passing_score':null};const _0x817785=_0x49dddf['match'](/\d+/g);return {'performance_target':_0x817785?.[0x0]?parseInt(_0x817785[0x0],0xa):null,'passing_score':_0x817785?.[0x1]?parseInt(_0x817785[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(_0x1bea83){let _0x2e87aa={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x4ea251=0x0;_0x4ea251<Math['min'](_0x1bea83['length'],0x14);_0x4ea251++){const _0x5772bc=(_0x1bea83[_0x4ea251]??[])['map'](_0x2b5cda=>_0x2b5cda['toLowerCase']()['trim']()),_0x5a66f9=_0x5772bc['findIndex'](_0x4160c6=>HEADERS$1['co']['some'](_0x267042=>_0x4160c6['includes'](_0x267042))),_0x282eaf=_0x5772bc['findIndex'](_0x512cd7=>HEADERS$1['ilo']['some'](_0x282d7e=>_0x512cd7['includes'](_0x282d7e))),_0x45841f=_0x5772bc['findIndex'](_0x1a1cf9=>HEADERS$1['assessTool']['some'](_0x556f67=>_0x1a1cf9['includes'](_0x556f67))),_0x4a6566=_0x5772bc['findIndex'](_0x2c89c5=>HEADERS$1['perfTarget']['some'](_0x3ab253=>_0x2c89c5['includes'](_0x3ab253))),_0x542694=[_0x5a66f9,_0x282eaf,_0x45841f,_0x4a6566]['filter'](_0x360cf0=>_0x360cf0!==-1)['length'];if(_0x542694>=0x3){_0x2e87aa={'headerRowIndex':_0x4ea251,'coIdx':_0x5a66f9,'iloIdx':_0x282eaf,'assessToolIdx':_0x45841f,'perfTargetIdx':_0x4a6566};break;}}return _0x2e87aa;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x29970a){const _0x360863={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x29970a['trim']()},_0x1984d=_0x29970a['match'](/^\((I|E|D)\)/);_0x1984d&&(_0x360863['cognitive_level']=_0x1984d[0x1],_0x360863['rest']=_0x29970a['slice'](_0x1984d[0x0]['length'])['trim']());const _0x13971a=_0x360863['rest']?.['match'](/^(.*?)\:/);_0x13971a&&(_0x360863['taxonomy_level']=_0x13971a[0x1]['trim']()['toLowerCase']()||null,_0x360863['rest']=_0x360863['rest']?.['slice'](_0x13971a[0x0]['length'])['trim']()||null);const _0x49ea5b=_0x360863['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x49ea5b)_0x360863['verb']=_0x49ea5b[0x1]['trim']()['toLowerCase']()||null;else {const _0x254b8c=_0x360863['rest']?.['match'](/^\w+/);if(_0x254b8c)_0x360863['verb']=_0x254b8c[0x0]['trim']()['toLowerCase']()||null;}return _0x360863;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x495e7f){const _0x4d95b4=_0x492033['parse'](_0x495e7f,{'skipEmptyLines':![]})['data'],_0x595a51={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x1e4cd7,coIdx:_0x3d7a8b,iloIdx:_0x1b6ca7,assessToolIdx:_0x325fd3,perfTargetIdx:_0x10b184}=getCoaepHeader(_0x4d95b4);if(_0x1e4cd7===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x4d95b4['forEach'](_0x3b3cb5=>{const _0x36644f=_0x3b3cb5['indexOf']('Name\x20of\x20Faculty:'),_0x2d0721=_0x3b3cb5['indexOf']('School\x20Year'),_0x5859f9=_0x3b3cb5['indexOf']('Course:'),_0x10e330=_0x3b3cb5['indexOf']('Semester');_0x36644f!==-1&&(_0x595a51['COAEP']['faculty']=_0x3b3cb5[_0x36644f+0x1]?.['trim']()||_0x595a51['COAEP']['faculty']);_0x2d0721!==-1&&(_0x595a51['COAEP']['sy']=_0x3b3cb5[_0x2d0721+0x1]?.['trim']()||_0x595a51['COAEP']['sy']);_0x5859f9!==-1&&(_0x595a51['COAEP']['course']=_0x3b3cb5[_0x5859f9+0x1]?.['trim']()||_0x595a51['COAEP']['course']);if(_0x10e330!==-1){const _0xb798c7=_0x3b3cb5[_0x10e330+0x1]?.['trim']()||'',_0x58a94c=_0xb798c7['match'](/\d+/)?.[0x0];_0x595a51['COAEP']['semester']=_0x58a94c?parseInt(_0x58a94c,0xa):_0x595a51['COAEP']['semester'];}});let _0x34c632=null;return _0x4d95b4['forEach']((_0x1bba6c,_0x1fc453)=>{if(_0x1fc453<=_0x1e4cd7)return;let _0x5d4fd7=_0x1bba6c[_0x3d7a8b-0x1]?.['trim']()||'',_0x44734f=_0x1bba6c[_0x3d7a8b]?.['trim']()||'';/^\d+$/['test'](_0x1bba6c[_0x3d7a8b]?.['trim']()||'')&&(_0x5d4fd7=_0x1bba6c[_0x3d7a8b]?.['trim']()||'',_0x44734f=_0x1bba6c[_0x3d7a8b+0x1]?.['trim']()||'');const _0x517f32=_0x1bba6c[_0x1b6ca7]?.['trim']()||'',_0xdf6b72=_0x1bba6c[_0x325fd3]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x9ab253=_0x1bba6c[_0x10b184]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x5d4fd7&&/^\d+$/['test'](_0x5d4fd7)){_0x34c632&&_0x595a51['COAEP']['co']['push'](_0x34c632);const _0x511e1=_0x44734f,{verb:_0x15d700,cognitive_level:_0x263349,taxonomy_level:_0x3b8230}=extractFromObjective(_0x511e1);if(!_0x15d700)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x5d4fd7+'\x20is\x20in\x20the\x20correct\x20format.'};_0x34c632={'statement':_0x511e1,'ilo':[],'verb':_0x15d700,'cognitive_level':_0x263349,'taxonomy_level':_0x3b8230};}if(_0x34c632&&_0x517f32&&_0x9ab253){const _0x264afc=_0x517f32['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x264afc['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x264afc['length']<0xa)return;let _0x595223=_0xdf6b72;if(!_0x595223&&_0x264afc['includes'](':')){const _0x3d4ddd=_0x264afc['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x3d4ddd&&(_0x595223=_0x3d4ddd[0x1]?.['trim']()||'');}const {performance_target:_0x10701c,passing_score:_0x17ea82}=performaceTarget(_0x9ab253),{verb:_0x142a6c,cognitive_level:_0x5d52d5,taxonomy_level:_0x1481ae}=extractFromObjective(_0x264afc);_0x34c632['ilo']['push']({'statement':_0x264afc,'assessment_tool':_0x595223,'performance_target':_0x10701c,'passing_score':_0x17ea82,'verb':_0x142a6c,'cognitive_level':_0x5d52d5,'taxonomy_level':_0x1481ae});}}),_0x34c632&&_0x595a51['COAEP']['co']['push'](_0x34c632),_0x595a51;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x595913,_0x4ec719,_0x10fdc8){try{const _0x30f0bb=await convertToCSVFile(_0x4ec719),_0x4efad8=await _0x30f0bb['text'](),_0x386daa=parseCOAEP(_0x4efad8);console['log'](_0x386daa);const _0x21f592=await fetch(_0x595913+'/coaeps/upload?course_id='+_0x10fdc8,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x386daa)});if(!_0x21f592['ok']){const _0x12bba9=await _0x21f592['json']();throw _0x12bba9;}return _0x21f592['json']();}catch(_0x226e44){throw _0x226e44;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x49a084,_0x2d0020){try{const _0x362a8f=await convertToCSVFile(_0x2d0020),_0xffb858=new FormData();_0xffb858['append']('csvFile',_0x362a8f);const _0x26ab52=await fetch(_0x49a084+'/enrolled-students/upload',{'method':'POST','body':_0xffb858});if(!_0x26ab52['ok']){const _0x65d97=await _0x26ab52['json']();throw _0x65d97;}return _0x26ab52['json']();}catch(_0x24d58f){throw _0x24d58f;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x2b8aa1){const _0xbe2666=_0x492033['parse'](_0x2b8aa1,{'skipEmptyLines':!![]})['data'];let _0x2f97f1='',_0x2cf787='',_0x49bce7='';const _0x305697=[];return _0xbe2666['forEach'](_0x361a33=>{const _0x1fec00=_0x361a33['map'](_0x120e69=>(_0x120e69??'')['toString']()['trim']()),_0x3d3293=_0x1fec00[0x0]??'';if(_0x3d3293['startsWith']('Course\x20No:')){const _0x9c974b=_0x3d3293['replace']('Course\x20No:','')['trim'](),_0x4e64ab=_0x9c974b['split'](/\s+/);_0x49bce7=_0x4e64ab[0x0]??'';const [_0x1a94e8,_0x1022e4]=(_0x4e64ab[0x1]??'')['split']('-');_0x2cf787=_0x1a94e8??'';const _0xfc0409=(_0x1022e4??'')['match'](/[a-z]$/);_0x2f97f1=_0xfc0409?_0xfc0409[0x0]:'';}if(/^\d+$/['test'](_0x3d3293)){const _0x411a32=_0x1fec00[0x2]??'';_0x305697['push']({'subj_code':_0x49bce7,'student_no':_0x411a32,'course_id':_0x2cf787,'section':_0x2f97f1});}}),{'enrolledCourses':_0x305697};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x443d50,_0x47e646,_0x44fe26,_0x5ce35a){try{const _0x21f61b=await convertToCSVFile(_0x47e646),_0x29c141=await _0x21f61b['text'](),_0x386a6d=parseClassList(_0x29c141),_0x5c445a='subj_code='+_0x44fe26+'&period_id='+_0x5ce35a,_0x533571=await fetch(_0x443d50+'/enrolled-courses/upload?'+_0x5c445a,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x386a6d)});if(!_0x533571['ok']){const _0x381240=await _0x533571['json']();throw _0x381240;}return _0x533571['json']();}catch(_0x15f560){throw _0x15f560;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x5054c1){const {data:_0x4d0d5f}=_0x492033['parse'](_0x5054c1,{'skipEmptyLines':!![]}),_0xb3a8ad=_0x4d0d5f['filter'](_0x567c18=>_0x567c18['length']>0x0),_0x5e0fda=_0xb3a8ad['find'](_0x59a825=>_0x59a825['some'](_0x357b68=>_0x357b68?.['includes']('Faculty'))),_0x32d5f9=_0x5e0fda?_0x5e0fda['findIndex'](_0x2cdac8=>_0x2cdac8?.['includes']('Faculty')):-1,_0x3940f8=_0x32d5f9!==-1&&_0x5e0fda?_0x5e0fda[_0x32d5f9+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x2449cd=_0xb3a8ad['find'](_0x4aa803=>_0x4aa803['some'](_0x2910a6=>_0x2910a6?.['includes']('Semester'))),_0x2059ef=_0x2449cd?_0x2449cd['findIndex'](_0x23465f=>_0x23465f?.['includes']('Semester')):-1,_0x1dd073=_0x2059ef!==-1&&_0x2449cd?_0x2449cd[_0x2059ef+0x2]?.['trim']()??'':'',_0x122254=_0x1dd073['includes']('1st')?0x1:_0x1dd073['includes']('2nd')?0x2:0x0,_0x431c16=_0xb3a8ad['find'](_0x22765d=>_0x22765d['some'](_0x300bfe=>_0x300bfe?.['includes']('Course\x20&\x20Sec'))),_0x565d58=_0x431c16?_0x431c16['findIndex'](_0x4f61c7=>_0x4f61c7?.['includes']('Course\x20&\x20Sec')):-1,_0x29499f=_0x565d58!==-1&&_0x431c16?_0x431c16[_0x565d58+0x2]?.['trim']()??'':'';let _0xfcc11e='',_0x1d2803='';if(_0x29499f){const _0x2ca245=_0x29499f['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x2ca245&&(_0xfcc11e=_0x2ca245[0x1]??'',_0x2ca245[0x2]&&(_0x1d2803=_0x2ca245[0x2]['replace'](/^OC/i,'')));}const _0x46d7f6=_0xb3a8ad['find'](_0x46d696=>_0x46d696['some'](_0x486644=>_0x486644?.['includes']('School\x20Year'))),_0x9cf3eb=_0x46d7f6?_0x46d7f6['findIndex'](_0x5a348a=>_0x5a348a?.['includes']('School\x20Year')):-1,_0x1d7e6c=_0x9cf3eb!==-1&&_0x46d7f6?_0x46d7f6[_0x9cf3eb+0x2]?.['trim']()??'':'';let _0x502da1=0x0;if(_0x1d7e6c){const _0x28ebd0=_0x1d7e6c['match'](/(\d{4})-(\d{4})/);if(_0x28ebd0){const _0x12bd48=(_0x28ebd0[0x1]??'')['slice'](0x2),_0x50e658=(_0x28ebd0[0x2]??'')['slice'](0x2);_0x502da1=parseInt(_0x12bd48+_0x50e658,0xa);}}const _0x14a2b0={'faculty':_0x3940f8,'course':_0xfcc11e,'section':_0x1d2803,'semester':_0x122254,'sy':_0x502da1},_0x9efebc=_0xb3a8ad['findIndex'](_0x1d2540=>_0x1d2540['some'](_0x13ef9f=>_0x13ef9f?.['trim']()==='CO\x20#'));if(_0x9efebc===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x2d1762=_0xb3a8ad[_0x9efebc+0x1];if(!_0x2d1762)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x13bbe8={};let _0x41b25a=0x1,_0x1fe7b8=0x1;for(let _0x29f33a=0x3;_0x29f33a<_0x2d1762['length'];_0x29f33a++){const _0x481484=_0x2d1762[_0x29f33a];if(!_0x481484)continue;const _0x5c6f2d='co'+_0x41b25a;if(!_0x13bbe8[_0x5c6f2d])_0x13bbe8[_0x5c6f2d]=[];_0x13bbe8[_0x5c6f2d]['push']('ilo'+_0x1fe7b8),_0x1fe7b8++,_0x1fe7b8>0x3&&(_0x41b25a++,_0x1fe7b8=0x1);}const _0x5304d7=_0xb3a8ad['findIndex'](_0xdd6475=>_0xdd6475['includes']('Name\x20of\x20Students'));if(_0x5304d7===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x4c8aa7=_0xb3a8ad[_0x5304d7];if(!_0x4c8aa7)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x34e86b=_0x4c8aa7['findIndex'](_0x4ccd6d=>_0x4ccd6d?.['includes']('Name\x20of\x20Students'));if(_0x34e86b===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x1e0c4f=_0x34e86b+0x2,_0x5e347f=[];for(let _0x23c667=_0x5304d7+0x1;_0x23c667<_0xb3a8ad['length'];_0x23c667++){const _0x222f71=_0xb3a8ad[_0x23c667];if(!_0x222f71)continue;if(_0x222f71['some'](_0x5ea63f=>_0x5ea63f?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x5ea63f?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x5ea63f?.['toUpperCase']()['includes']('INACTIVE')||_0x5ea63f?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x222f71[_0x34e86b])continue;const _0x2d28e0=_0x222f71[_0x34e86b]['replace'](/"/g,'')['trim'](),_0x2e1d29=_0x222f71['slice'](_0x1e0c4f)['map'](_0x38f33e=>_0x38f33e===null?null:!isNaN(Number(_0x38f33e))?parseFloat(_0x38f33e):0x0);let _0x1ac106=0x0;const _0x57ec4a={};Object['entries'](_0x13bbe8)['forEach'](([_0x5e07bb,_0x4a6b66])=>{const _0x1b8141={};_0x4a6b66['forEach'](_0x2d27f7=>{_0x1b8141[_0x2d27f7]=_0x2e1d29[_0x1ac106]??0x0,_0x1ac106++;}),_0x57ec4a[_0x5e07bb]={'transmuted_score':_0x1b8141};}),_0x5e347f['push']({'student_name':_0x2d28e0,'coaep':_0x57ec4a});}const _0x56be35=_0xb3a8ad['find'](_0x22a33c=>_0x22a33c['some'](_0x5cab6a=>_0x5cab6a?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x2b68ec=_0xb3a8ad['find'](_0x2dd7e0=>_0x2dd7e0['some'](_0x555ef3=>_0x555ef3?.['includes']('AVERAGE'))),_0x25f980=_0x56be35?_0x56be35['slice'](_0x1e0c4f)['map'](_0x49fe57=>_0x49fe57&&!isNaN(Number(_0x49fe57))?parseInt(_0x49fe57):0x0):[],_0x2705ee=_0x2b68ec?_0x2b68ec['slice'](_0x1e0c4f)['map'](_0x1dc51b=>_0x1dc51b&&_0x1dc51b!=='#DIV/0!'&&!isNaN(Number(_0x1dc51b))?parseInt(_0x1dc51b):0x0):[],_0x45fb83={};let _0x5e1695=0x0;return Object['entries'](_0x13bbe8)['forEach'](([_0xcc7002,_0x1338fb])=>{if(!_0x45fb83[_0xcc7002])_0x45fb83[_0xcc7002]={};_0x1338fb['forEach'](_0x40a735=>{_0x45fb83[_0xcc7002][_0x40a735]={'achievedMinimum':_0x25f980[_0x5e1695]??0x0,'average':_0x2705ee[_0x5e1695]??0x0},_0x5e1695++;});}),{'assessmentData':{'classAssignment':_0x14a2b0,'student':_0x5e347f,'total':_0x45fb83}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x38998d,_0x229a79){try{const _0x5dd3a9=await convertToCSVFile(_0x229a79),_0x361e87=await _0x5dd3a9['text'](),_0x456525=parseAssessmentCsv(_0x361e87),_0x1ef881=await fetch(_0x38998d+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x456525)});if(!_0x1ef881['ok']){const _0x28fef9=await _0x1ef881['json']();throw _0x28fef9;}return _0x1ef881['json']();}catch(_0x56d1a0){throw _0x56d1a0;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x4f5ffb,_0x5c1fe1){try{const _0xa92138=await convertToCSVFile(_0x5c1fe1),_0x25878d=new FormData();_0x25878d['append']('csvFile',_0xa92138);const _0x78a2f4=await fetch(_0x4f5ffb+'/dept-faculties/upload',{'method':'POST','body':_0x25878d});if(!_0x78a2f4['ok']){const _0x5bca42=await _0x78a2f4['json']();throw _0x5bca42;}return _0x78a2f4['json']();}catch(_0x3f279f){throw _0x3f279f;}}
|
|
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(_0x14e511){let _0x231c67={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x262fee=0x0;_0x262fee<Math['min'](_0x14e511['length'],0x14);_0x262fee++){const _0x1f309d=(_0x14e511[_0x262fee]??[])['map'](_0x5cf999=>_0x5cf999['toLowerCase']()['trim']()),_0x5d3975=_0x1f309d['findIndex'](_0x4ec43e=>HEADERS['po']['some'](_0xaa1013=>_0x4ec43e['toLowerCase']()['includes'](_0xaa1013))),_0x2566f2=_0x1f309d['findIndex'](_0x27a3fa=>HEADERS['tl']['some'](_0x452e0b=>_0x27a3fa['toLowerCase']()['includes'](_0x452e0b))),_0xfab58f=_0x1f309d['findIndex'](_0x4b0691=>HEADERS['pi']['some'](_0x1ed44b=>_0x4b0691['toLowerCase']()['includes'](_0x1ed44b))),_0x4f1cbc=_0x1f309d['findIndex'](_0x548b1c=>HEADERS['fc']['some'](_0x3446d5=>_0x548b1c['toLowerCase']()['includes'](_0x3446d5))),_0x24f143=_0x1f309d['findIndex'](_0x23ba6f=>HEADERS['sc']['some'](_0x4d9400=>_0x23ba6f['toLowerCase']()['includes'](_0x4d9400))),_0x1d7b89=_0x1f309d['findIndex'](_0x3a4cef=>HEADERS['at']['some'](_0x514a9f=>_0x3a4cef['toLowerCase']()['includes'](_0x514a9f))),_0x44c08d=_0x1f309d['findIndex'](_0x32fed1=>HEADERS['pt']['some'](_0x2becb5=>_0x32fed1['toLowerCase']()['includes'](_0x2becb5))),_0x2bfca4=[_0x5d3975,_0x2566f2,_0xfab58f,_0x4f1cbc,_0x24f143,_0x1d7b89,_0x44c08d]['filter'](_0x25124b=>_0x25124b!==-1)['length'];if(_0x2bfca4>=0x3){_0x231c67={'headerIdx':_0x262fee,'poIdx':_0x5d3975,'tlIdx':_0x2566f2,'piIdx':_0xfab58f,'fcIdx':_0x4f1cbc,'scIdx':_0x24f143,'atIdx':_0x1d7b89,'ptIdx':_0x44c08d};break;}}if(_0x231c67['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x231c67;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x3e994d=>{let _0xc4656b=_0x3e994d['split'](',')['reduce']((_0xcd0063,_0x1548d5)=>{const _0x28e013=_0x1548d5['trim']();if(_0x28e013)_0xcd0063['push'](_0x28e013);return _0xcd0063;},[]);return _0xc4656b;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x3517e2=>{try{const _0x30c5d8=_0x492033['parse'](_0x3517e2,{'skipEmptyLines':![]})['data'],{headerIdx:_0x34a17a,poIdx:_0x2370c3,tlIdx:_0x415af7,piIdx:_0x5199d7,fcIdx:_0x378a6d,scIdx:_0x38a3db,atIdx:_0x41f8ee,ptIdx:_0x24b82d}=getPoaepHeader(_0x30c5d8),_0x493b47=[];let _0x35bfcc={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x325129='',_0x3bce53='',_0x4acdb0='';for(let _0x24c556=_0x34a17a+0x1;_0x24c556<_0x30c5d8['length'];_0x24c556++){const _0x3b5cb3=_0x30c5d8[_0x24c556];if(!_0x3b5cb3)break;const _0x1ab50f=_0x3b5cb3[_0x2370c3]?.['trim']()||'';_0x1ab50f!==''&&(_0x35bfcc={'po_desc':_0x1ab50f,'seq_no':_0x35bfcc['seq_no']+0x1,'PerfIndicators':[]},_0x493b47['push'](_0x35bfcc),_0x325129='',_0x3bce53='',_0x4acdb0='');if(_0x35bfcc['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x24c556+'.');const _0x610ccf=_0x3b5cb3[_0x5199d7]?.['trim']()||'';if(_0x610ccf==='')break;const _0x33e8d8=_0x3b5cb3[_0x378a6d]?.['trim']()||'';if(_0x33e8d8==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x24c556+'.');const _0x2c977a=_0x3b5cb3[_0x38a3db]?.['trim']()||_0x325129;if(_0x2c977a==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x24c556+'.');_0x325129=_0x2c977a;const _0x1d8681=_0x3b5cb3[_0x41f8ee]?.['trim']()||_0x3bce53;if(_0x1d8681==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x24c556+'.');_0x3bce53=_0x1d8681;const _0x53efa6=_0x3b5cb3[_0x24b82d]?.['trim']()||_0x4acdb0;if(_0x53efa6==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x24c556+'.');_0x4acdb0=_0x53efa6;const _0x5f3116=parseFormativeCourses(_0x33e8d8);if(_0x5f3116['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x24c556+'.');const _0x9888d4=performaceTarget(_0x53efa6);if(!_0x9888d4['performance_target']||!_0x9888d4['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x24c556+'.');const _0xa25b8a={'pi_desc':_0x610ccf,'FormativeCourses':_0x5f3116['map'](_0x13ee59=>({'course_id':_0x13ee59,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x2c977a},'AssessmentTool':{'at_desc':_0x1d8681},'PerformanceTargets':{'target_percent':_0x9888d4['performance_target'],'min_score':_0x9888d4['passing_score']}};_0x35bfcc['PerfIndicators']['push'](_0xa25b8a);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x493b47}};}catch(_0x5ec9ab){return {'success':![],'error':_0x5ec9ab instanceof Error?_0x5ec9ab['message']:_0x5ec9ab,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x277101,_0x49b98f,_0x268e2e,_0xb32db3,_0x5a0e7a){try{const _0x2d8e02=await convertToCSVFile(_0x49b98f),_0x399b67=await _0x2d8e02['text'](),_0x4a8fad=parsePOAEP(_0x399b67),_0xbc26a4=await fetch(_0x277101+'/program-outcomes/poaep/upload?curr_id='+_0xb32db3+'&period_id='+_0x5a0e7a,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x268e2e},'credentials':'include','body':JSON['stringify'](_0x4a8fad)});if(!_0xbc26a4['ok']){const _0x553cc0=await _0xbc26a4['json']();throw _0x553cc0;}return _0xbc26a4['json']();}catch(_0x5cdd55){throw _0x5cdd55;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];constructor(_0x11029d='DataTable',_0x435fba){this['name']=_0x11029d,this['headers']=_0x435fba,this['table']=[],this['validators']=[];}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['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']}};}async['setTable'](_0x28662f){await this['assertInitialized'](),this['table']=_0x28662f;}async['initializeTable'](_0x19eb9e,_0x453087){try{let _0x2a1f8a;if(_0x19eb9e instanceof File)_0x2a1f8a=await this['fromXML'](_0x19eb9e,_0x453087);else _0x2a1f8a=await this['fromCSVString'](_0x19eb9e);if(!_0x2a1f8a['success']||!_0x2a1f8a['data'])return _0x2a1f8a;if(_0x2a1f8a['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x2a1f8a['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x529d81){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x529d81};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x250d1b,_0x1077b6){const _0x18b73d=await convertToCSVFile(_0x250d1b,_0x1077b6),_0x559bb3=await _0x18b73d['text']();return this['fromCSVString'](_0x559bb3);}async['findValue'](_0xc4f7cd){let [_0x5531c1,_0x32406c]=[-1,-1];if(!_0xc4f7cd)return {'row':_0x5531c1,'column':_0x32406c};for(let _0x25bc74=0x0;_0x25bc74<this['table']['length'];_0x25bc74++){const _0x2d89da=this['table'][_0x25bc74];for(let _0x30d6b7=0x0;_0x30d6b7<_0x2d89da['length'];_0x30d6b7++){if(typeof _0xc4f7cd==='string'){if(_0x2d89da[_0x30d6b7]===_0xc4f7cd)return {'row':_0x25bc74,'column':_0x30d6b7};}else {if(_0x2d89da[_0x30d6b7]){if(_0x2d89da[_0x30d6b7]===_0xc4f7cd)return {'row':_0x25bc74,'column':_0x30d6b7};}}}}return {'row':_0x5531c1,'column':_0x32406c};}async['validate'](){const _0x361da2=[],_0x2760c8=[];try{await this['assertInitialized']()['then'](()=>{_0x361da2['push']('Table\x20is\x20initialized.');})['catch'](_0x27feb1=>_0x2760c8['push'](_0x27feb1));if(_0x2760c8['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x361da2,_0x2760c8);const {success:_0x19c758,message:_0x4489dd,error:_0x2192ea,data:_0x4992c3}=await this['toJson']();if(!_0x4992c3)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x361da2['push'](..._0x4992c3['validMsgs']),_0x2760c8['push'](..._0x4992c3['tableErrors']);const {jsonObj:_0x19734d}=_0x4992c3;for(const _0x5b0f63 of this['validators']){await _0x5b0f63['validate'](_0x361da2,_0x2760c8,this,_0x19734d);}let _0x4d5d61=this['name']+'\x20ran\x20its\x20validations.';if(_0x361da2['length']>0x0)_0x4d5d61+='\x20'+_0x361da2['length']+'\x20validations\x20were\x20successful.';if(_0x2760c8['length']>0x0)_0x4d5d61+='\x20'+_0x2760c8['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x4d5d61,'data':{'validMsgs':_0x361da2,'tableErrors':_0x2760c8}};}catch(_0x498379){return _0x2760c8['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x498379}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x361da2,'tableErrors':_0x2760c8}};}}['useValidator'](_0x1af669){this['validators']['push'](_0x1af669);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x4accc4){this['name']=_0x4accc4;}['getName'](){return this['name'];}['report'](_0x3f5c01,_0x11f1c4,_0x1a7f12){if(_0x3f5c01['length']>0x0)_0x1a7f12['push'](..._0x3f5c01);else _0x11f1c4['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'](_0x16911f,_0x10690a,_0x437380,_0x13f68b){const _0x4b91f5=[];if(!_0x13f68b){_0x10690a['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x3642b8=0x0;_0x3642b8<_0x13f68b['co']['length'];_0x3642b8++){const _0x4de007=_0x13f68b['co'][_0x3642b8];if(!_0x4de007){const {row:_0x5bed4b,column:_0x4a1f88}=await _0x437380['findValue'](_0x3642b8+0x1+'');_0x4b91f5['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x3642b8+0x1)+'.','row':_0x5bed4b,'column':_0x4a1f88+0x1,'from':this['name']});continue;}if(!_0x4de007?.['ilo']){const {row:_0x2e6c60,column:_0x2d3019}=await _0x437380['findValue'](_0x4de007['statement']);_0x4b91f5['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x3642b8+0x1)+'.','row':_0x2e6c60,'column':_0x2d3019,'from':this['name']});continue;}const _0xf508f=_0x4de007['ilo']['length']-0x1,_0x5d64fc=_0x4de007['ilo'][_0xf508f];if(!_0x5d64fc['taxonomy_level']){const {row:_0x15b52a,column:_0x1d3ff4}=await _0x437380['findValue'](_0x5d64fc['statement']);_0x4b91f5['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x3642b8+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x15b52a,'column':_0x1d3ff4,'from':this['name']});continue;}if(_0x5d64fc['taxonomy_level']!==_0x4de007['taxonomy_level']){const {row:_0x44eb69,column:_0x2c79bb}=await _0x437380['findValue'](_0x5d64fc['statement']);_0x4b91f5['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x3642b8+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x5d64fc['taxonomy_level']+'\x20!==\x20'+_0x4de007['taxonomy_level']+')','row':_0x44eb69,'column':_0x2c79bb,'from':this['name']});}}this['report'](_0x4b91f5,_0x16911f,_0x10690a);}}
|
|
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'](_0x1c09d2,_0x2a79aa,_0x4ff116,_0x3833b9){const _0x1b6862=[];if(!_0x3833b9){_0x2a79aa['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x30cd52=0x0;_0x30cd52<_0x3833b9['co']['length'];_0x30cd52++){const _0x300232=_0x3833b9['co'][_0x30cd52];if(!_0x300232['taxonomy_level']){_0x1b6862['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x30cd52+0x1),'from':this['name']});continue;}if(!whitelist['includes'](_0x300232['taxonomy_level'])){const {row:_0x1b4c80,column:_0x1a326e}=await _0x4ff116['findValue'](_0x300232['statement']);let _0x25f9d5={'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x300232['taxonomy_level']['toUpperCase'](),'from':this['name']};(_0x1b4c80!==-1||_0x1a326e!==-1)&&(_0x25f9d5['row']=_0x1b4c80,_0x25f9d5['column']=_0x1a326e),_0x1b6862['push'](_0x25f9d5);}}this['report'](_0x1b6862,_0x1c09d2,_0x2a79aa);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'](_0x4eaf37,_0x103eec,_0x4c92cd,_0x4b447b){const _0x52f654=[];if(!_0x4b447b){_0x103eec['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x53afb4=0x0;_0x53afb4<_0x4b447b['co']['length'];_0x53afb4++){const _0x34aea1=_0x4b447b['co'][_0x53afb4];if(!_0x34aea1){const {row:_0x3d3fcf,column:_0x424cf9}=await _0x4c92cd['findValue'](_0x53afb4+0x1+'');_0x52f654['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x53afb4+0x1)+'.','row':_0x3d3fcf,'column':_0x424cf9+0x1,'from':this['name']});continue;}if(!_0x34aea1?.['ilo']){const {row:_0x74dfe2,column:_0x2ac3db}=await _0x4c92cd['findValue'](_0x34aea1['statement']);_0x52f654['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x53afb4+0x1)+'.','row':_0x74dfe2,'column':_0x2ac3db,'from':this['name']});continue;}const _0x218049=await _0x4c92cd['findValue'](_0x34aea1['ilo'][0x0]['statement']),_0xa7ffb4=_0x34aea1['ilo']['map'](_0xe20767=>taxoOrder[_0xe20767['taxonomy_level']]);let _0xed2fb2=_0xa7ffb4[0x0];for(let _0x4a1e39=0x1;_0x4a1e39<_0xa7ffb4['length'];_0x4a1e39++){if(_0xa7ffb4[_0x4a1e39]<_0xed2fb2){_0x52f654['push']({'error':'Under\x20CO\x20'+(_0x53afb4+0x1)+',\x20ILO\x20'+(_0x4a1e39+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x4a1e39+'\x27s.','row':_0x218049['row'],'column':_0x218049['column']+_0x4a1e39,'from':this['name']});continue;}_0xed2fb2=_0xa7ffb4[_0x4a1e39];}}this['report'](_0x52f654,_0x4eaf37,_0x103eec);}}
|
|
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'](_0x322091,_0xb7508,_0x1074de,_0x6b1361){const {success:_0x4d7948,data:_0x285117}=_0x1074de['getTable'](),_0x2cd369=[];if(!_0x4d7948){_0x2cd369['push']({'error':'Failed\x20to\x20access\x20table\x20data.','from':this['name']});return;}const {table:_0x22d737}=_0x285117;for(let _0x12055e=0x0;_0x12055e<_0x22d737['length'];_0x12055e++){const _0x1c4744=_0x22d737[_0x12055e],[_0x996d,_0x5af3f5]=_0x1c4744[0x4];if(!_0x996d)_0x2cd369['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x12055e,'column':0x4,'from':this['name']});else _0x996d<minPerfTarget&&_0x2cd369['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x12055e,'column':0x4,'from':this['name']});if(!_0x5af3f5)_0x2cd369['push']({'error':'Pass\x20score\x20is\x20required.','row':_0x12055e,'column':0x6,'from':this['name']});else _0x5af3f5<minPassScore&&_0x2cd369['push']({'error':'Pass\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x12055e,'column':0x6,'from':this['name']});}this['report'](_0x2cd369,_0x322091,_0xb7508);}}
|
|
57
57
|
|
|
58
|
-
class CoaepDT extends DataTable{['faculty']=null;['course']=null;['sy']=null;['semester']=null;constructor(){super('CoaepDT',['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target']),this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](
|
|
58
|
+
class CoaepDT extends DataTable{['faculty']=null;['course']=null;['sy']=null;['semester']=null;constructor(){super('CoaepDT',['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target']),this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](_0xb521c6,_0x94877b){const _0x4fa1c4=[];let _0x267382=null,_0x5d16b7=null;for(let _0x47290b=0x0;_0x47290b<this['table']['length'];_0x47290b++){const _0x132930=[],_0x36a7ef=this['table'][_0x47290b],_0xca0eb5=_0x36a7ef[0x0]||_0x267382,_0x1d2c6a=_0x36a7ef[0x1]||_0x5d16b7,_0x1eee58=_0x36a7ef[0x2],_0x41e999=_0x36a7ef[0x3],_0x2761b6=_0x36a7ef[0x4];if(!_0xca0eb5)_0x132930['push'](0x0);if(!_0x5d16b7)_0x132930['push'](0x1);if(!_0x1eee58)_0x132930['push'](0x2);if(!_0x41e999)_0x132930['push'](0x3);if(!_0x2761b6)_0x132930['push'](0x4);if(_0x5d16b7!==_0x1d2c6a)this['validateObjectiveGrammar'](_0x1d2c6a,_0x47290b,0x1,_0x94877b);_0x267382=_0xca0eb5,_0x5d16b7=_0x1d2c6a;for(const _0x51748b of _0x132930){_0x4fa1c4['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x51748b],'row':_0x47290b,'column':_0x51748b});}if(_0x1eee58)this['validateObjectiveGrammar'](_0x1eee58,_0x47290b,0x2,_0x94877b);}if(_0x4fa1c4['length']>0x0)_0x94877b['push'](..._0x4fa1c4);else _0xb521c6['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x11ee5d){try{const _0x11a80c=[],_0x8d06d2=_0x492033['parse'](_0x11ee5d,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x444d29,coIdx:_0x316b69,iloIdx:_0x353b9c,assessToolIdx:_0x180be4,perfTargetIdx:_0x368cae}=getCoaepHeader(_0x8d06d2);if(_0x444d29===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x8d06d2['forEach'](_0x348a8f=>{const _0x25a33e=_0x348a8f['indexOf']('Name\x20of\x20Faculty:'),_0x309309=_0x348a8f['indexOf']('School\x20Year'),_0x5968a5=_0x348a8f['indexOf']('Course:'),_0xc0e2b9=_0x348a8f['indexOf']('Semester');_0x25a33e!==-0x1&&(this['faculty']=_0x348a8f[_0x25a33e+0x1]?.['trim']()||this['faculty']);_0x309309!==-0x1&&(this['sy']=_0x348a8f[_0x309309+0x1]?.['trim']()||this['sy']);_0x5968a5!==-0x1&&(this['course']=_0x348a8f[_0x5968a5+0x1]?.['trim']()||this['course']);if(_0xc0e2b9!==-0x1){const _0x45ff2d=_0x348a8f[_0xc0e2b9+0x1]?.['trim']()||'',_0x17ab30=_0x45ff2d['match'](/\d+/)?.[0x0];this['semester']=_0x17ab30?parseInt(_0x17ab30,0xa):this['semester'];}});for(let _0x1d32c3=0x0;_0x1d32c3<=_0x8d06d2['length'];_0x1d32c3++){const _0xe2faf2=_0x8d06d2[_0x1d32c3];if(!_0xe2faf2)break;if(_0x1d32c3<=_0x444d29)continue;if(!_0xe2faf2[_0x353b9c])break;let _0x48e79c=_0xe2faf2[_0x316b69-0x1]?.['trim']()||'',_0xe81efb=_0xe2faf2[_0x316b69]?.['trim']()||'',_0x305c17=_0xe2faf2[_0x353b9c]?.['trim']()||'';/^\d+$/['test'](_0xe2faf2[_0x316b69]?.['trim']()||'')&&(_0x48e79c=_0xe2faf2[_0x316b69]?.['trim']()||'',_0xe81efb=_0xe2faf2[_0x316b69+0x1]?.['trim']()||'');let _0x18b9f1=null;if(_0xe81efb){const {cognitive_level:_0x181f34,taxonomy_level:_0x3b2b67,verb:_0x21e7c7,rest:_0x10abc0}=extractFromObjective(_0xe81efb);_0x18b9f1=[_0x181f34,_0x3b2b67,_0x21e7c7,_0x10abc0];}let _0x4de641;{const {cognitive_level:_0x2b3e14,taxonomy_level:_0x1e819a,verb:_0x25d782,rest:_0xb37cd9}=extractFromObjective(_0x305c17);_0x4de641=[_0x2b3e14,_0x1e819a,_0x25d782,_0xb37cd9];}const _0x55ba7f=_0xe2faf2[_0x368cae]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x5ca22d,passing_score:_0x899039}=performaceTarget(_0x55ba7f);_0x11a80c['push']([_0x48e79c,_0x18b9f1,_0x4de641,_0xe2faf2[_0x180be4]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x5ca22d,_0x899039]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x11a80c};}catch(_0x3ecb3a){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x3ecb3a};}}async['toJson'](){const _0x5bf508=[],_0x24819d=[],_0x2d1ae1='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x3dac1f={'faculty':this['faculty'],'course':this['course'],'sy':this['sy'],'semester':this['semester'],'co':[]};let _0x43e3ff=null,_0x15687d='',_0x50cf4a=[null,null];this['table']['forEach']((_0x53b8f9,_0xa5814e)=>{if(_0xa5814e===0x0&&!_0x53b8f9[0x1])_0x24819d['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x2d1ae1});_0x53b8f9[0x1]&&(_0x15687d='',_0x50cf4a=[null,null]);const _0x51eea3=_0x53b8f9[0x1],_0x195b42=_0x53b8f9[0x2],_0x26407e=_0x53b8f9[0x3]||_0x15687d,_0x142a99=_0x53b8f9[0x4]||_0x50cf4a;if(!_0x195b42)_0x24819d['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x2d1ae1});if(!_0x26407e)_0x24819d['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0xa5814e,'column':0x3,'from':_0x2d1ae1});if(!_0x142a99)_0x24819d['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0xa5814e,'column':0x4,'from':_0x2d1ae1});if(_0x51eea3){const [_0x287662,_0x2f14a3,_0x3e0c80,_0x42295e]=_0x51eea3,_0x4d7b43={'statement':_0x42295e,'ilo':[],'taxonomy_level':_0x2f14a3,'cognitive_level':_0x287662,'verb':_0x3e0c80};_0x43e3ff=_0x4d7b43,_0x3dac1f['co']['push'](_0x4d7b43);}const [_0x38a756,_0x4aac6b,_0x4a7a73,_0x13eab0]=_0x195b42,[_0x20d863,_0x10fc10]=_0x142a99,_0x4299ee={'statement':_0x13eab0,'assessment_tool':_0x26407e,'performance_target':_0x20d863,'passing_score':_0x10fc10,'cognitive_level':_0x38a756,'taxonomy_level':_0x4aac6b,'verb':_0x4a7a73};_0x43e3ff['ilo']['push'](_0x4299ee);});if(_0x24819d['length'])return _0x24819d['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x2d1ae1}),{'success':![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x3dac1f,'validMsgs':_0x5bf508,'tableErrors':_0x24819d}};return _0x5bf508['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x3dac1f,'validMsgs':_0x5bf508,'tableErrors':_0x24819d}};}catch(_0x4ec998){return _0x24819d['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x2d1ae1}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x4ec998,'data':{'jsonObj':null,'tableErrors':_0x24819d}};}}['validateObjectiveGrammar'](_0x146ad4,_0x1326cb,_0x3e906b,_0x11f6c1){if(!_0x146ad4){_0x11f6c1['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x1326cb,'column':_0x3e906b,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x5a3cfd,_0x5a5614,_0x30115d,_0x59bd37]=_0x146ad4,_0x2b8be0=[];if(!_0x5a3cfd)_0x2b8be0['push']('Cognitive\x20Level');if(!_0x5a5614)_0x2b8be0['push']('Taxonomy\x20Level');if(!_0x30115d)_0x2b8be0['push']('Verb');if(!_0x2b8be0['length'])return;_0x11f6c1['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x2b8be0['join'](',\x20')+'.','row':_0x1326cb,'column':_0x3e906b,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}}
|
|
59
59
|
|
|
60
|
-
class Client{['BASE_URL'];constructor(
|
|
60
|
+
class Client{['BASE_URL'];constructor(_0x4d0067){this['BASE_URL']=_0x4d0067;}['Parser'](){return {'curriculum':async _0x4f7f16=>{const _0x30f568=await uploadCurriculum(this['BASE_URL'],_0x4f7f16);return _0x30f568;},'courseOffering':async _0x1a2607=>{const _0x12efb9=await uploadCourseOffering(this['BASE_URL'],_0x1a2607);return _0x12efb9;},'coaep':async(_0xc83bbe,_0x494e2b)=>{const _0x19eb52=await uploadCOAEP(this['BASE_URL'],_0xc83bbe,_0x494e2b);return _0x19eb52;},'enrolledStudent':async _0x518904=>{const _0x2d2bd6=await uploadEnrolledStudent(this['BASE_URL'],_0x518904);return _0x2d2bd6;},'classlist':async(_0x1439f4,_0x408338,_0x24ebfc)=>{const _0x5740bc=await uploadClassList(this['BASE_URL'],_0x1439f4,_0x408338,_0x24ebfc);return _0x5740bc;},'assessmentData':async _0x59b156=>{const _0x1d34cd=await uploadAssessmentData(this['BASE_URL'],_0x59b156);return _0x1d34cd;},'deptFaculty':async _0x531e70=>{const _0x3dfcb5=await uploadDeptFaculty(this['BASE_URL'],_0x531e70);return _0x3dfcb5;},'poaep':async(_0x298519,_0x420c95,_0x14d090,_0x3ebebe)=>{const _0x3545e4=await uploadPOAEP(this['BASE_URL'],_0x298519,_0x420c95,_0x14d090,_0x3ebebe);return _0x3545e4;},'CoaepDT':CoaepDT};}}
|
|
61
61
|
|
|
62
62
|
export { Client as default };
|