@obe-loms/coms-parser 1.6.26 → 1.6.27
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 +1 -2
- package/DataTable/types/PoaepDTRow.d.ts +2 -27
- package/bundle.js +33 -33
- package/package.json +1 -1
- package/payloads/parseAssessmentDataToJson.d.ts +10 -0
- package/payloads/parseClassListToJson.d.ts +10 -0
- package/payloads/parseCourseOfferingToJson.d.ts +10 -0
- package/payloads/parseCurriculumToJson.d.ts +10 -0
- package/payloads/parseDeptFacultyToJson.d.ts +9 -0
- package/payloads/parseEnrolledStudentToJson.d.ts +9 -0
- package/types/poaep.d.ts +0 -4
|
@@ -2,7 +2,7 @@ import { POAEP } from "../../types/poaep";
|
|
|
2
2
|
import DataTableException from "../types/DataTableException";
|
|
3
3
|
import ParserResult from "../types/ParserResult";
|
|
4
4
|
import { DataTable } from "./DataTable";
|
|
5
|
-
import {
|
|
5
|
+
import { PoaepRow } from "../types/PoaepDTRow";
|
|
6
6
|
export declare const poaepHeaders: string[];
|
|
7
7
|
export declare class PoaepDT extends DataTable<POAEP, PoaepRow> {
|
|
8
8
|
/**
|
|
@@ -21,5 +21,4 @@ export declare class PoaepDT extends DataTable<POAEP, PoaepRow> {
|
|
|
21
21
|
searchRow(rowData: PoaepRow, val: any): {
|
|
22
22
|
column: number;
|
|
23
23
|
}[];
|
|
24
|
-
validateObjectiveGrammar(piArr: PoaepDT_PI, row: number, column: number, tableErrors: DataTableException[]): void;
|
|
25
24
|
}
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
import Taxonomy from "../../types/Taxonomy";
|
|
2
|
-
/**
|
|
3
|
-
* Represents the Program Outcome column in the internal POAEP DataTable.
|
|
4
|
-
*/
|
|
5
2
|
export type PoaepDT_PO = string | null;
|
|
6
|
-
/**
|
|
7
|
-
* Represents the Performance Indicator column in the internal POAEP DataTable.
|
|
8
|
-
*/
|
|
9
|
-
export type PoaepDT_PI = [PoaepDT_Taxo, PoaepDT_Verb, PoaepDT_Rest] | null;
|
|
10
3
|
export type PoaepDT_Taxo = Taxonomy | null;
|
|
11
|
-
export type
|
|
12
|
-
export type PoaepDT_Rest = string | null;
|
|
13
|
-
/**
|
|
14
|
-
* Represents the Formative Course column in the internal POAEP DataTable.
|
|
15
|
-
*/
|
|
4
|
+
export type PoaepDT_PI = string | null;
|
|
16
5
|
export type PoaepDT_FC = string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Represents the Summative Course column in the internal POAEP DataTable.
|
|
19
|
-
*/
|
|
20
6
|
export type PoaepDT_SC = string | null;
|
|
21
|
-
/**
|
|
22
|
-
* Represents the Assessment Tool column in the internal POAEP DataTable.
|
|
23
|
-
*/
|
|
24
7
|
export type PoaepDT_AT = string | null;
|
|
25
|
-
/**
|
|
26
|
-
* Represents the Performance Target column in the internal POAEP DataTable.
|
|
27
|
-
*/
|
|
28
8
|
export type PoaepDT_Perf = number | null;
|
|
29
|
-
/**
|
|
30
|
-
* Represents the Passing Score column in the internal POAEP DataTable.
|
|
31
|
-
*/
|
|
32
9
|
export type PoaepDT_Pass = number | null;
|
|
33
|
-
/**
|
|
34
|
-
* Represents the Performance Target and Passing Score tuple column in the internal POAEP DataTable.
|
|
35
|
-
*/
|
|
36
10
|
export type PoaepDT_PT = [PoaepDT_Perf, PoaepDT_Pass];
|
|
37
11
|
export type PoaepRow = [
|
|
38
12
|
PoaepDT_PO,
|
|
13
|
+
PoaepDT_Taxo,
|
|
39
14
|
PoaepDT_PI,
|
|
40
15
|
PoaepDT_FC[],
|
|
41
16
|
PoaepDT_SC,
|
package/bundle.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x45663f from 'papaparse';
|
|
2
|
+
import * as _0x2fd596 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x490b38){let _0x51ef71='',_0x8af86f='',_0x3f97b7=0x0,_0x3c0662=null;const _0x47df03=[];return _0x45663f['parse'](_0x490b38,{'skipEmptyLines':!![],'complete':_0x493f7d=>{_0x493f7d['data']['forEach'](_0x189bb0=>{const _0x392cd0=_0x189bb0['map'](_0x4a2c89=>(_0x4a2c89??'')['toString']()['trim']()),_0x7871c4=_0x392cd0[0x0]??'';if(_0x7871c4['includes']('Rev#')){const _0x8d8eb5=_0x7871c4['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x8d8eb5&&(_0x51ef71=_0x8d8eb5[0x1]?.['trim']()??'',_0x8af86f=_0x8d8eb5[0x2]?.['trim']()??'',_0x3f97b7=parseInt(_0x8d8eb5[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x7871c4)){_0x3c0662=0x1;return;}if(/SECOND YEAR/i['test'](_0x7871c4)){_0x3c0662=0x2;return;}if(/THIRD YEAR/i['test'](_0x7871c4)){_0x3c0662=0x3;return;}if(/FOURTH YEAR/i['test'](_0x7871c4)){_0x3c0662=0x4;return;}if(/FIFTH YEAR/i['test'](_0x7871c4)){_0x3c0662=0x5;return;}if(/First Semester/i['test'](_0x7871c4)||/Second Semester/i['test'](_0x7871c4)||/Summer/i['test'](_0x7871c4))return;const _0x3e5e42=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x3e5e42['forEach'](({sem:_0x318acb,offset:_0x43d15c})=>{const _0x1670ec=_0x392cd0[_0x43d15c]??'',_0x4f3457=_0x392cd0[_0x43d15c+0x1]??'',_0x27b56f=_0x392cd0[_0x43d15c+0x2]??'',_0x9c082b=_0x392cd0[_0x43d15c+0x3]??'',_0x59d070=_0x392cd0[_0x43d15c+0x4]??'';_0x1670ec&&_0x3c0662&&_0x47df03['push']({'curr_id':_0x51ef71,'program_name':_0x8af86f,'revision_no':_0x3f97b7,'year_level':_0x3c0662,'sem':_0x318acb,'course_id':_0x1670ec,'course_desc':_0x4f3457,'total_units':_0x27b56f,'lec_unit':_0x9c082b,'lab_unit':_0x59d070});});});}}),_0x47df03;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x19b93f,_0x52a9ea){return new Promise((_0x86239b,_0x341792)=>{const _0x343bad=new FileReader();_0x343bad['onload']=_0x1a34fc=>{const _0x5f3c10=_0x1a34fc['target']?.['result'];if(!_0x5f3c10){_0x341792(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x3710ea=_0x2fd596['read'](_0x5f3c10,{'type':'array'});!_0x52a9ea&&(_0x52a9ea=_0x3710ea['SheetNames'][0x0]);if(!_0x52a9ea){_0x341792(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x77a9c1=_0x3710ea['Sheets'][_0x52a9ea];if(!_0x77a9c1){_0x341792(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x31fd81=_0x2fd596['utils']['sheet_to_csv'](_0x77a9c1,{'strip':!![]}),_0x29106c=_0x19b93f['name']['replace'](/\.[^/.]+$/,'.csv'),_0x521fe3=new File([_0x31fd81],_0x29106c,{'type':'text/csv','lastModified':Date['now']()});_0x86239b(_0x521fe3);}catch(_0x59ee97){_0x341792(_0x59ee97);}},_0x343bad['onerror']=()=>{_0x341792(new Error('File\x20reading\x20failed'));},_0x343bad['readAsArrayBuffer'](_0x19b93f);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x481bf4,_0x12a869){try{const _0x2050b4=await convertToCSVFile(_0x12a869),_0x4625b9=await _0x2050b4['text'](),_0x5420b3=parseCurriculum(_0x4625b9),_0x4adeb7=_0x45663f['unparse'](_0x5420b3),_0x25d6ad=new File([_0x4adeb7],_0x2050b4['name'],{'type':'text/csv'}),_0x315449=new FormData();_0x315449['append']('csvFile',_0x25d6ad);const _0x162321=await fetch(_0x481bf4+'/curr-courses/upload',{'method':'POST','body':_0x315449});if(!_0x162321['ok']){const _0x4a76f2=await _0x162321['json']();throw _0x4a76f2;}return _0x162321['json']();}catch(_0x5f4261){throw _0x5f4261;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x11f86d){let _0x16d8a6='',_0x4e012d='';const _0x14f89f=[],_0x540d9e=_0x45663f['parse'](_0x11f86d,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x44f071=_0x540d9e['data'];for(let _0x482dfd=0x0;_0x482dfd<Math['min'](0x5,_0x44f071['length']);_0x482dfd++){const _0x312e8e=_0x44f071[_0x482dfd];if(_0x312e8e&&_0x312e8e['length']>0x0){const _0x40ff49=_0x312e8e[0x0]?.['toString']()||'',_0x2e4c0a=_0x40ff49['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x2e4c0a){_0x16d8a6=_0x2e4c0a[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x2e4c0a[0x2]){const _0x4b3202=_0x2e4c0a[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x4b3202&&_0x4b3202[0x2]&&_0x4b3202[0x4]&&(_0x4e012d=_0x4b3202[0x2]+_0x4b3202[0x4]);}}}}let _0xd386bb=-1;for(let _0x2334e6=0x0;_0x2334e6<_0x44f071['length'];_0x2334e6++){const _0x48be15=_0x44f071[_0x2334e6];if(_0x48be15&&_0x48be15['some'](_0x1c5bd2=>_0x1c5bd2?.['toString']()['toUpperCase']()['includes']('CODE'))){_0xd386bb=_0x2334e6;break;}}if(_0xd386bb===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x5c6165={'code':'','description':'','unit':0x0};for(let _0x4ce50a=_0xd386bb+0x1;_0x4ce50a<_0x44f071['length'];_0x4ce50a++){const _0x1aef7b=_0x44f071[_0x4ce50a];if(!_0x1aef7b||_0x1aef7b['length']<0x8)continue;const _0x9afc4=_0x1aef7b[0x1]?.['toString']()['trim']()||'',_0x47cb8b=_0x1aef7b[0x4]?.['toString']()['trim']()||'',_0x3b3926=_0x1aef7b[0x5]?.['toString']()['trim']()||'',_0x260f5f=_0x1aef7b[0x6]?.['toString']()['trim']()||'',_0x5b22f7=_0x1aef7b[0x7]?.['toString']()['trim']()||'',_0x6b47be=_0x1aef7b[0x3]?.['toString']()['trim']()||'';let _0x4851e9=_0x1aef7b[0x0]?.['toString']()['trim']()||'',_0x31d543=_0x1aef7b[0x2]?.['toString']()['trim']()||'';if(!_0x9afc4)continue;if(!_0x4851e9)_0x4851e9=_0x5c6165['code'];if(!_0x31d543)_0x31d543=_0x5c6165['description'];let _0x1e3314=_0x5c6165['unit'];if(_0x6b47be){const _0x467416=_0x6b47be['match'](/(\d+)/);_0x467416&&_0x467416[0x1]&&(_0x1e3314=parseInt(_0x467416[0x1],0xa));}const _0x523d9f={'sem':_0x16d8a6,'school_year':_0x4e012d,'code':_0x4851e9,'course_no':_0x9afc4,'course_desc':_0x31d543,'unit':_0x1e3314,'time':_0x47cb8b,'days':_0x3b3926,'faculty':_0x260f5f,'room':_0x5b22f7};_0x5c6165['code']=_0x4851e9,_0x5c6165['description']=_0x31d543,_0x5c6165['unit']=_0x1e3314,_0x14f89f['push'](_0x523d9f);}return _0x14f89f;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x4d7bd5,_0xba4481){try{const _0x40b11e=await convertToCSVFile(_0xba4481),_0x551e43=await _0x40b11e['text'](),_0x42bcf2=parseCourseOffering(_0x551e43),_0x249787=_0x45663f['unparse'](_0x42bcf2),_0x6e81bd=new File([_0x249787],_0x40b11e['name'],{'type':'text/csv'}),_0x2e40f4=new FormData();_0x2e40f4['append']('csvFile',_0x6e81bd);const _0x46979f=await fetch(_0x4d7bd5+'/course-offerings/upload',{'method':'POST','body':_0x2e40f4});if(!_0x46979f['ok']){const _0x258d7b=await _0x46979f['json']();throw _0x258d7b;}return _0x46979f['json']();}catch(_0x2fe2f0){throw _0x2fe2f0;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x2aa8f8){if(!_0x2aa8f8)return {'performance_target':null,'passing_score':null};const _0x4ab77b=_0x2aa8f8['match'](/\d+/g);return {'performance_target':_0x4ab77b?.[0x0]?parseInt(_0x4ab77b[0x0],0xa):null,'passing_score':_0x4ab77b?.[0x1]?parseInt(_0x4ab77b[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(_0x3a013e){let _0x1f530f={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x3893a6=0x0;_0x3893a6<Math['min'](_0x3a013e['length'],0x14);_0x3893a6++){const _0x87f2e6=(_0x3a013e[_0x3893a6]??[])['map'](_0x11e913=>_0x11e913['toLowerCase']()['trim']()),_0x50c550=_0x87f2e6['findIndex'](_0xf857ca=>HEADERS$1['co']['some'](_0x1b2d08=>_0xf857ca['includes'](_0x1b2d08))),_0x474d01=_0x87f2e6['findIndex'](_0x7baab0=>HEADERS$1['ilo']['some'](_0x4964b7=>_0x7baab0['includes'](_0x4964b7))),_0x5520d1=_0x87f2e6['findIndex'](_0x6cabf9=>HEADERS$1['assessTool']['some'](_0x452081=>_0x6cabf9['includes'](_0x452081))),_0x2674a2=_0x87f2e6['findIndex'](_0x1013a7=>HEADERS$1['perfTarget']['some'](_0xfc3514=>_0x1013a7['includes'](_0xfc3514))),_0x59949f=[_0x50c550,_0x474d01,_0x5520d1,_0x2674a2]['filter'](_0x2f10e5=>_0x2f10e5!==-1)['length'];if(_0x59949f>=0x3){_0x1f530f={'headerRowIndex':_0x3893a6,'coIdx':_0x50c550,'iloIdx':_0x474d01,'assessToolIdx':_0x5520d1,'perfTargetIdx':_0x2674a2};break;}}return _0x1f530f;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x239ee5){const _0x1ceccb={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x239ee5['trim']()},_0x4be421=_0x239ee5['match'](/^\((I|E|D)\)/);_0x4be421&&(_0x1ceccb['cognitive_level']=_0x4be421[0x1],_0x1ceccb['rest']=_0x239ee5['slice'](_0x4be421[0x0]['length'])['trim']());const _0x2aafa4=_0x1ceccb['rest']?.['match'](/^(.*?)\:/);_0x2aafa4&&(_0x1ceccb['taxonomy_level']=_0x2aafa4[0x1]['trim']()['toLowerCase']()||null,_0x1ceccb['rest']=_0x1ceccb['rest']?.['slice'](_0x2aafa4[0x0]['length'])['trim']()||null);const _0x374016=_0x1ceccb['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x374016)_0x1ceccb['verb']=_0x374016[0x1]['trim']()['toLowerCase']()||null;else {const _0x51d9d2=_0x1ceccb['rest']?.['match'](/^\w+/);if(_0x51d9d2)_0x1ceccb['verb']=_0x51d9d2[0x0]['trim']()['toLowerCase']()||null;}return _0x1ceccb;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x2b5480){const _0x242ff5=_0x45663f['parse'](_0x2b5480,{'skipEmptyLines':![]})['data'],_0x437ea0={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x5a7bd1,coIdx:_0x4f8951,iloIdx:_0x1bbb8d,assessToolIdx:_0x5b84d5,perfTargetIdx:_0x2ad426}=getCoaepHeader(_0x242ff5);if(_0x5a7bd1===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x242ff5['forEach'](_0x4d3aaf=>{const _0x4ebb95=_0x4d3aaf['indexOf']('Name\x20of\x20Faculty:'),_0x7ca2ee=_0x4d3aaf['indexOf']('School\x20Year'),_0x51912a=_0x4d3aaf['indexOf']('Course:'),_0x41d9ea=_0x4d3aaf['indexOf']('Semester');_0x4ebb95!==-1&&(_0x437ea0['COAEP']['faculty']=_0x4d3aaf[_0x4ebb95+0x1]?.['trim']()||_0x437ea0['COAEP']['faculty']);_0x7ca2ee!==-1&&(_0x437ea0['COAEP']['sy']=_0x4d3aaf[_0x7ca2ee+0x1]?.['trim']()||_0x437ea0['COAEP']['sy']);_0x51912a!==-1&&(_0x437ea0['COAEP']['course']=_0x4d3aaf[_0x51912a+0x1]?.['trim']()||_0x437ea0['COAEP']['course']);if(_0x41d9ea!==-1){const _0x373871=_0x4d3aaf[_0x41d9ea+0x1]?.['trim']()||'',_0x4b29c2=_0x373871['match'](/\d+/)?.[0x0];_0x437ea0['COAEP']['semester']=_0x4b29c2?parseInt(_0x4b29c2,0xa):_0x437ea0['COAEP']['semester'];}});let _0x473a1e=null;return _0x242ff5['forEach']((_0x561535,_0x40c2da)=>{if(_0x40c2da<=_0x5a7bd1)return;let _0x2e9147=_0x561535[_0x4f8951-0x1]?.['trim']()||'',_0x288d72=_0x561535[_0x4f8951]?.['trim']()||'';/^\d+$/['test'](_0x561535[_0x4f8951]?.['trim']()||'')&&(_0x2e9147=_0x561535[_0x4f8951]?.['trim']()||'',_0x288d72=_0x561535[_0x4f8951+0x1]?.['trim']()||'');const _0xf6f017=_0x561535[_0x1bbb8d]?.['trim']()||'',_0x464ad6=_0x561535[_0x5b84d5]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x3b8b84=_0x561535[_0x2ad426]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x2e9147&&/^\d+$/['test'](_0x2e9147)){_0x473a1e&&_0x437ea0['COAEP']['co']['push'](_0x473a1e);const _0x277c6c=_0x288d72,{verb:_0x5a7ddb,cognitive_level:_0x1e004d,taxonomy_level:_0x90c20b}=extractFromObjective(_0x277c6c);if(!_0x5a7ddb)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x2e9147+'\x20is\x20in\x20the\x20correct\x20format.'};_0x473a1e={'statement':_0x277c6c,'ilo':[],'verb':_0x5a7ddb,'cognitive_level':_0x1e004d,'taxonomy_level':_0x90c20b};}if(_0x473a1e&&_0xf6f017&&_0x3b8b84){const _0x2ec637=_0xf6f017['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x2ec637['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x2ec637['length']<0xa)return;let _0x5004b9=_0x464ad6;if(!_0x5004b9&&_0x2ec637['includes'](':')){const _0x4d745e=_0x2ec637['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x4d745e&&(_0x5004b9=_0x4d745e[0x1]?.['trim']()||'');}const {performance_target:_0x43859e,passing_score:_0x256b93}=performaceTarget(_0x3b8b84),{verb:_0x40343d,cognitive_level:_0x1bd079,taxonomy_level:_0x562264}=extractFromObjective(_0x2ec637);_0x473a1e['ilo']['push']({'statement':_0x2ec637,'assessment_tool':_0x5004b9,'performance_target':_0x43859e,'passing_score':_0x256b93,'verb':_0x40343d,'cognitive_level':_0x1bd079,'taxonomy_level':_0x562264});}}),_0x473a1e&&_0x437ea0['COAEP']['co']['push'](_0x473a1e),_0x437ea0;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x3fe0b6,_0x3ed2d5,_0x204df4){try{const _0x362ac7=await convertToCSVFile(_0x3ed2d5),_0x23ed1b=await _0x362ac7['text'](),_0x32cabb=parseCOAEP(_0x23ed1b);console['log'](_0x32cabb);const _0x158c68=await fetch(_0x3fe0b6+'/coaeps/upload?course_id='+_0x204df4,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x32cabb)});if(!_0x158c68['ok']){const _0x2ca8fe=await _0x158c68['json']();throw _0x2ca8fe;}return _0x158c68['json']();}catch(_0x70b1c7){throw _0x70b1c7;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x200b59,_0x431187){try{const _0x33ef99=await convertToCSVFile(_0x431187),_0x22b5d1=new FormData();_0x22b5d1['append']('csvFile',_0x33ef99);const _0x58f6e8=await fetch(_0x200b59+'/enrolled-students/upload',{'method':'POST','body':_0x22b5d1});if(!_0x58f6e8['ok']){const _0x25758d=await _0x58f6e8['json']();throw _0x25758d;}return _0x58f6e8['json']();}catch(_0x434a9b){throw _0x434a9b;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x50c6c6){const _0x32b442=_0x45663f['parse'](_0x50c6c6,{'skipEmptyLines':!![]})['data'];let _0x5ec6d8='',_0x48995a='',_0x4a52a0='';const _0x2c076f=[];return _0x32b442['forEach'](_0xab72f1=>{const _0x12b0eb=_0xab72f1['map'](_0x535772=>(_0x535772??'')['toString']()['trim']()),_0x47f155=_0x12b0eb[0x0]??'';if(_0x47f155['startsWith']('Course\x20No:')){const _0x1bbac7=_0x47f155['replace']('Course\x20No:','')['trim'](),_0x4edfde=_0x1bbac7['split'](/\s+/);_0x4a52a0=_0x4edfde[0x0]??'';const [_0x59c640,_0x12fac6]=(_0x4edfde[0x1]??'')['split']('-');_0x48995a=_0x59c640??'';const _0x28fb7e=(_0x12fac6??'')['match'](/[a-z]$/);_0x5ec6d8=_0x28fb7e?_0x28fb7e[0x0]:'';}if(/^\d+$/['test'](_0x47f155)){const _0x4a673f=_0x12b0eb[0x2]??'';_0x2c076f['push']({'subj_code':_0x4a52a0,'student_no':_0x4a673f,'course_id':_0x48995a,'section':_0x5ec6d8});}}),{'enrolledCourses':_0x2c076f};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x273115,_0x2aaee8,_0x4087a1,_0x7f0325){try{const _0x4fdb4a=await convertToCSVFile(_0x2aaee8),_0x3babfc=await _0x4fdb4a['text'](),_0x254643=parseClassList(_0x3babfc),_0x1d9965='subj_code='+_0x4087a1+'&period_id='+_0x7f0325,_0x1b63c4=await fetch(_0x273115+'/enrolled-courses/upload?'+_0x1d9965,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x254643)});if(!_0x1b63c4['ok']){const _0x3cd580=await _0x1b63c4['json']();throw _0x3cd580;}return _0x1b63c4['json']();}catch(_0x5e0064){throw _0x5e0064;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x3a3b11){const {data:_0x5e509d}=_0x45663f['parse'](_0x3a3b11,{'skipEmptyLines':!![]}),_0x908299=_0x5e509d['filter'](_0x25073c=>_0x25073c['length']>0x0),_0x4cade8=_0x908299['find'](_0x46537b=>_0x46537b['some'](_0x33a8e8=>_0x33a8e8?.['includes']('Faculty'))),_0x38ae7d=_0x4cade8?_0x4cade8['findIndex'](_0x5adc2b=>_0x5adc2b?.['includes']('Faculty')):-1,_0x24c970=_0x38ae7d!==-1&&_0x4cade8?_0x4cade8[_0x38ae7d+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x525bc3=_0x908299['find'](_0x1a3997=>_0x1a3997['some'](_0x6f55f=>_0x6f55f?.['includes']('Semester'))),_0x17fe6f=_0x525bc3?_0x525bc3['findIndex'](_0x29da08=>_0x29da08?.['includes']('Semester')):-1,_0x5233b3=_0x17fe6f!==-1&&_0x525bc3?_0x525bc3[_0x17fe6f+0x2]?.['trim']()??'':'',_0x222a23=_0x5233b3['includes']('1st')?0x1:_0x5233b3['includes']('2nd')?0x2:0x0,_0x59c410=_0x908299['find'](_0x976b1f=>_0x976b1f['some'](_0x34fc26=>_0x34fc26?.['includes']('Course\x20&\x20Sec'))),_0x31f366=_0x59c410?_0x59c410['findIndex'](_0x425df7=>_0x425df7?.['includes']('Course\x20&\x20Sec')):-1,_0x52f64b=_0x31f366!==-1&&_0x59c410?_0x59c410[_0x31f366+0x2]?.['trim']()??'':'';let _0x309722='',_0x4d51eb='';if(_0x52f64b){const _0x36e652=_0x52f64b['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x36e652&&(_0x309722=_0x36e652[0x1]??'',_0x36e652[0x2]&&(_0x4d51eb=_0x36e652[0x2]['replace'](/^OC/i,'')));}const _0x36e7ac=_0x908299['find'](_0x4f794f=>_0x4f794f['some'](_0x172206=>_0x172206?.['includes']('School\x20Year'))),_0x59474e=_0x36e7ac?_0x36e7ac['findIndex'](_0x2fa4ff=>_0x2fa4ff?.['includes']('School\x20Year')):-1,_0x362a77=_0x59474e!==-1&&_0x36e7ac?_0x36e7ac[_0x59474e+0x2]?.['trim']()??'':'';let _0x220873=0x0;if(_0x362a77){const _0x417d7b=_0x362a77['match'](/(\d{4})-(\d{4})/);if(_0x417d7b){const _0x3b8dfa=(_0x417d7b[0x1]??'')['slice'](0x2),_0x2eba74=(_0x417d7b[0x2]??'')['slice'](0x2);_0x220873=parseInt(_0x3b8dfa+_0x2eba74,0xa);}}const _0x473216={'faculty':_0x24c970,'course':_0x309722,'section':_0x4d51eb,'semester':_0x222a23,'sy':_0x220873},_0x199667=_0x908299['findIndex'](_0x2b9ef2=>_0x2b9ef2['some'](_0x3ccf8f=>_0x3ccf8f?.['trim']()==='CO\x20#'));if(_0x199667===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x907bcd=_0x908299[_0x199667+0x1];if(!_0x907bcd)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x3fb015={};let _0x3fa57a=0x1,_0x57d437=0x1;for(let _0x194ddf=0x3;_0x194ddf<_0x907bcd['length'];_0x194ddf++){const _0xdc95b2=_0x907bcd[_0x194ddf];if(!_0xdc95b2)continue;const _0xa58c3c='co'+_0x3fa57a;if(!_0x3fb015[_0xa58c3c])_0x3fb015[_0xa58c3c]=[];_0x3fb015[_0xa58c3c]['push']('ilo'+_0x57d437),_0x57d437++,_0x57d437>0x3&&(_0x3fa57a++,_0x57d437=0x1);}const _0x1c199e=_0x908299['findIndex'](_0x273a4a=>_0x273a4a['includes']('Name\x20of\x20Students'));if(_0x1c199e===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x2833fa=_0x908299[_0x1c199e];if(!_0x2833fa)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x3c90fa=_0x2833fa['findIndex'](_0x5c6862=>_0x5c6862?.['includes']('Name\x20of\x20Students'));if(_0x3c90fa===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x5c394c=_0x3c90fa+0x2,_0x5ecdf0=[];for(let _0x40dc89=_0x1c199e+0x1;_0x40dc89<_0x908299['length'];_0x40dc89++){const _0x2c8e6d=_0x908299[_0x40dc89];if(!_0x2c8e6d)continue;if(_0x2c8e6d['some'](_0x11a8db=>_0x11a8db?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x11a8db?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x11a8db?.['toUpperCase']()['includes']('INACTIVE')||_0x11a8db?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x2c8e6d[_0x3c90fa])continue;const _0x3fe115=_0x2c8e6d[_0x3c90fa]['replace'](/"/g,'')['trim'](),_0x481895=_0x2c8e6d['slice'](_0x5c394c)['map'](_0xb20626=>_0xb20626===null?null:!isNaN(Number(_0xb20626))?parseFloat(_0xb20626):0x0);let _0x1d2a6b=0x0;const _0x105eb1={};Object['entries'](_0x3fb015)['forEach'](([_0x2d4479,_0x5cd39b])=>{const _0x4e24ed={};_0x5cd39b['forEach'](_0xe54f85=>{_0x4e24ed[_0xe54f85]=_0x481895[_0x1d2a6b]??0x0,_0x1d2a6b++;}),_0x105eb1[_0x2d4479]={'transmuted_score':_0x4e24ed};}),_0x5ecdf0['push']({'student_name':_0x3fe115,'coaep':_0x105eb1});}const _0x2765bd=_0x908299['find'](_0x2fca2f=>_0x2fca2f['some'](_0xe27569=>_0xe27569?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x2c1651=_0x908299['find'](_0x259447=>_0x259447['some'](_0x15700f=>_0x15700f?.['includes']('AVERAGE'))),_0x227714=_0x2765bd?_0x2765bd['slice'](_0x5c394c)['map'](_0x336de2=>_0x336de2&&!isNaN(Number(_0x336de2))?parseInt(_0x336de2):0x0):[],_0x3fe157=_0x2c1651?_0x2c1651['slice'](_0x5c394c)['map'](_0x172dd4=>_0x172dd4&&_0x172dd4!=='#DIV/0!'&&!isNaN(Number(_0x172dd4))?parseInt(_0x172dd4):0x0):[],_0x282deb={};let _0x1bedee=0x0;return Object['entries'](_0x3fb015)['forEach'](([_0x5d4b02,_0x54798f])=>{if(!_0x282deb[_0x5d4b02])_0x282deb[_0x5d4b02]={};_0x54798f['forEach'](_0x3a6dd9=>{_0x282deb[_0x5d4b02][_0x3a6dd9]={'achievedMinimum':_0x227714[_0x1bedee]??0x0,'average':_0x3fe157[_0x1bedee]??0x0},_0x1bedee++;});}),{'assessmentData':{'classAssignment':_0x473216,'student':_0x5ecdf0,'total':_0x282deb}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x210dd9,_0x23844f){try{const _0x5160e1=await convertToCSVFile(_0x23844f),_0x439b7c=await _0x5160e1['text'](),_0x4ed1ab=parseAssessmentCsv(_0x439b7c),_0x3706ee=await fetch(_0x210dd9+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x4ed1ab)});if(!_0x3706ee['ok']){const _0x524b88=await _0x3706ee['json']();throw _0x524b88;}return _0x3706ee['json']();}catch(_0x57597b){throw _0x57597b;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x4bde2b,_0x186c0a){try{const _0xbb4afa=await convertToCSVFile(_0x186c0a),_0x4f060d=new FormData();_0x4f060d['append']('csvFile',_0xbb4afa);const _0x2502e6=await fetch(_0x4bde2b+'/dept-faculties/upload',{'method':'POST','body':_0x4f060d});if(!_0x2502e6['ok']){const _0x3a0a58=await _0x2502e6['json']();throw _0x3a0a58;}return _0x2502e6['json']();}catch(_0x4ed48a){throw _0x4ed48a;}}
|
|
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(_0xbcd7ec){let _0x7efa6={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x240f06=0x0;_0x240f06<Math['min'](_0xbcd7ec['length'],0x14);_0x240f06++){const _0x5ed8da=(_0xbcd7ec[_0x240f06]??[])['map'](_0x130760=>_0x130760['toLowerCase']()['trim']()),_0x11eb30=_0x5ed8da['findIndex'](_0x3296a4=>HEADERS['po']['some'](_0x23d418=>_0x3296a4['toLowerCase']()['includes'](_0x23d418))),_0x31cb0a=_0x5ed8da['findIndex'](_0x433f61=>HEADERS['tl']['some'](_0x17c4fb=>_0x433f61['toLowerCase']()['includes'](_0x17c4fb))),_0x1e61e5=_0x5ed8da['findIndex'](_0x336017=>HEADERS['pi']['some'](_0x1fe32a=>_0x336017['toLowerCase']()['includes'](_0x1fe32a))),_0x40e977=_0x5ed8da['findIndex'](_0x5b409c=>HEADERS['fc']['some'](_0x29ba4a=>_0x5b409c['toLowerCase']()['includes'](_0x29ba4a))),_0x136195=_0x5ed8da['findIndex'](_0x526eec=>HEADERS['sc']['some'](_0x31e2dc=>_0x526eec['toLowerCase']()['includes'](_0x31e2dc))),_0x45dea5=_0x5ed8da['findIndex'](_0x327e15=>HEADERS['at']['some'](_0x1ac684=>_0x327e15['toLowerCase']()['includes'](_0x1ac684))),_0x2f7e68=_0x5ed8da['findIndex'](_0x2f6563=>HEADERS['pt']['some'](_0x41a7a2=>_0x2f6563['toLowerCase']()['includes'](_0x41a7a2))),_0x3d1f93=[_0x11eb30,_0x31cb0a,_0x1e61e5,_0x40e977,_0x136195,_0x45dea5,_0x2f7e68]['filter'](_0x28919f=>_0x28919f!==-1)['length'];if(_0x3d1f93>=0x3){_0x7efa6={'headerIdx':_0x240f06,'poIdx':_0x11eb30,'tlIdx':_0x31cb0a,'piIdx':_0x1e61e5,'fcIdx':_0x40e977,'scIdx':_0x136195,'atIdx':_0x45dea5,'ptIdx':_0x2f7e68};break;}}if(_0x7efa6['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x7efa6;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x428f88=>{let _0xdf98bd=_0x428f88['split'](',')['reduce']((_0x5b8950,_0x2d166c)=>{const _0x503a45=_0x2d166c['trim']();if(_0x503a45)_0x5b8950['push'](_0x503a45);return _0x5b8950;},[]);return _0xdf98bd;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x577a2e=>{try{const _0x151de8=_0x45663f['parse'](_0x577a2e,{'skipEmptyLines':![]})['data'],{headerIdx:_0x26fa67,poIdx:_0xb138af,tlIdx:_0x40c2ee,piIdx:_0x3b46cf,fcIdx:_0x19aa32,scIdx:_0x2eed04,atIdx:_0xb3dc86,ptIdx:_0x182e2a}=getPoaepHeader(_0x151de8),_0x1edd3d=[];let _0x3eeb9f={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x3c1359='',_0x2b6dd1='',_0x3c63f1='';for(let _0x48166c=_0x26fa67+0x1;_0x48166c<_0x151de8['length'];_0x48166c++){const _0x4efc7f=_0x151de8[_0x48166c];if(!_0x4efc7f)break;const _0x1f851a=_0x4efc7f[_0xb138af]?.['trim']()||'';_0x1f851a!==''&&(_0x3eeb9f={'po_desc':_0x1f851a,'seq_no':_0x3eeb9f['seq_no']+0x1,'PerfIndicators':[]},_0x1edd3d['push'](_0x3eeb9f),_0x3c1359='',_0x2b6dd1='',_0x3c63f1='');if(_0x3eeb9f['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x48166c+'.');const _0x51f608=_0x4efc7f[_0x3b46cf]?.['trim']()||'';if(_0x51f608==='')break;const _0x28805f=_0x4efc7f[_0x19aa32]?.['trim']()||'';if(_0x28805f==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x48166c+'.');const _0x12abaf=_0x4efc7f[_0x2eed04]?.['trim']()||_0x3c1359;if(_0x12abaf==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x48166c+'.');_0x3c1359=_0x12abaf;const _0x5e900d=_0x4efc7f[_0xb3dc86]?.['trim']()||_0x2b6dd1;if(_0x5e900d==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x48166c+'.');_0x2b6dd1=_0x5e900d;const _0x3baada=_0x4efc7f[_0x182e2a]?.['trim']()||_0x3c63f1;if(_0x3baada==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x48166c+'.');_0x3c63f1=_0x3baada;const _0x4e15fc=parseFormativeCourses(_0x28805f);if(_0x4e15fc['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x48166c+'.');const _0xd76e5c=performaceTarget(_0x3baada);if(!_0xd76e5c['performance_target']||!_0xd76e5c['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x48166c+'.');const _0x319161={'pi_desc':_0x51f608,'FormativeCourses':_0x4e15fc['map'](_0x3fa468=>({'course_id':_0x3fa468,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x12abaf},'TaxonomyLevel':null,'AssessmentTool':{'at_desc':_0x5e900d},'PerformanceTargets':{'target_percent':_0xd76e5c['performance_target'],'min_score':_0xd76e5c['passing_score']}};_0x3eeb9f['PerfIndicators']['push'](_0x319161);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x1edd3d}};}catch(_0x4db402){return {'success':![],'error':_0x4db402 instanceof Error?_0x4db402['message']:_0x4db402,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x5275dc,_0x548e49,_0x52d4af,_0x2769c1,_0x3dd77a){try{const _0x262f53=await convertToCSVFile(_0x548e49),_0x16a63a=await _0x262f53['text'](),_0x367b56=parsePOAEP(_0x16a63a),_0x7e7a71=await fetch(_0x5275dc+'/program-outcomes/poaep/upload?curr_id='+_0x2769c1+'&period_id='+_0x3dd77a,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x52d4af},'credentials':'include','body':JSON['stringify'](_0x367b56)});if(!_0x7e7a71['ok']){const _0xf51905=await _0x7e7a71['json']();throw _0xf51905;}return _0x7e7a71['json']();}catch(_0x136fb9){throw _0x136fb9;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(_0x33344e='DataTable',_0x37a2fe){this['name']=_0x33344e,this['headers']=_0x37a2fe,this['table']=[],this['validators']=[],this['state']={};}['setDataTable'](_0x409753){this['name']=_0x409753['name'],this['headers']=_0x409753['headers'],this['table']=_0x409753['table'],this['state']=_0x409753['state'];}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getState'](){return this['state'];}['setState']=async _0x584ea4=>{await this['assertInitialized'](),this['state']=_0x584ea4;};['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'](_0x4e9f0f){await this['assertInitialized'](),this['table']=_0x4e9f0f;}async['initializeTable'](_0x283858,_0x23df5b){try{let _0x54032b;if(_0x283858 instanceof File)_0x54032b=await this['fromXML'](_0x283858,_0x23df5b);else _0x54032b=await this['fromCSVString'](_0x283858);if(!_0x54032b['success']||!_0x54032b['data'])return _0x54032b;if(_0x54032b['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x54032b['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x1ae050){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x1ae050};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x345746,_0x5c60b2){const _0x312b0b=await convertToCSVFile(_0x345746,_0x5c60b2),_0x1f45d3=await _0x312b0b['text']();return this['fromCSVString'](_0x1f45d3);}async['searchTable'](_0x197100){await this['assertInitialized']()['catch'](()=>{return [];});if(!_0x197100)return [];const _0x36c16b=[];for(let _0x2a2872=0x0;_0x2a2872<this['table']['length'];_0x2a2872++){const _0x1f645f=this['table'][_0x2a2872],_0x203ee5=this['searchRow'](_0x1f645f,_0x197100);for(const _0x8d3dde of _0x203ee5){_0x36c16b['push']({'row':_0x2a2872,'column':_0x8d3dde['column']});}}return _0x36c16b;}async['validate'](){const _0x46c626=[],_0x3ed7b6=[];try{await this['assertInitialized']()['then'](()=>{_0x46c626['push']('Table\x20is\x20initialized.');})['catch'](_0x5d7819=>_0x3ed7b6['push'](_0x5d7819));if(_0x3ed7b6['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x46c626,_0x3ed7b6);const {success:_0x584c21,message:_0x22108b,error:_0x3a3a24,data:_0x2732a7}=await this['toJson']();if(!_0x2732a7)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x46c626['push'](..._0x2732a7['validMsgs']),_0x3ed7b6['push'](..._0x2732a7['tableErrors']);const {jsonObj:_0x4ae901}=_0x2732a7;for(const _0x2b3cb8 of this['validators']){await _0x2b3cb8['validate'](_0x46c626,_0x3ed7b6,this,_0x4ae901);}let _0x51fa5b=this['name']+'\x20ran\x20its\x20validations.';if(_0x46c626['length']>0x0)_0x51fa5b+='\x20'+_0x46c626['length']+'\x20validations\x20were\x20successful.';if(_0x3ed7b6['length']>0x0)_0x51fa5b+='\x20'+_0x3ed7b6['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x51fa5b,'data':{'validMsgs':_0x46c626,'tableErrors':_0x3ed7b6}};}catch(_0x59a648){return _0x3ed7b6['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x59a648}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x46c626,'tableErrors':_0x3ed7b6}};}}['useValidator'](_0x1143e9){this['validators']['push'](_0x1143e9);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x371c7a){this['name']=_0x371c7a;}['getName'](){return this['name'];}['report'](_0x1401d5,_0x3b7e3a,_0x46c916){if(_0x1401d5['length']>0x0)_0x46c916['push'](..._0x1401d5);else _0x3b7e3a['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'](_0x20bb8e,_0x1a5e62,_0x18c467,_0x5e1ed3){const _0x24b3ad=[];if(!_0x5e1ed3){_0x1a5e62['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x494a93=0x0;_0x494a93<_0x5e1ed3['co']['length'];_0x494a93++){const _0x2335c4=_0x5e1ed3['co'][_0x494a93];if(!_0x2335c4){(await _0x18c467['searchTable'](_0x494a93+0x1+''))['map'](({row:_0x4ab038,column:_0x33d2a9})=>{_0x24b3ad['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x494a93+0x1)+'.','row':_0x4ab038,'column':_0x33d2a9,'from':this['name']});});continue;}if(!_0x2335c4?.['ilo']){(await _0x18c467['searchTable'](_0x2335c4['statement']))['map'](({row:_0x552ef0,column:_0x480fe6})=>{_0x24b3ad['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x494a93+0x1)+'.','row':_0x552ef0,'column':_0x480fe6,'from':this['name']});});continue;}const _0xafb828=_0x2335c4['ilo']['length']-0x1,_0x599ced=_0x2335c4['ilo'][_0xafb828];if(!_0x599ced['taxonomy_level']){(await _0x18c467['searchTable'](_0x599ced['statement']))['map'](({row:_0x273abf,column:_0x1f994f})=>{_0x24b3ad['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x494a93+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x273abf,'column':_0x1f994f,'from':this['name']});});continue;}if(_0x599ced['taxonomy_level']['trim']()['toLowerCase']()!==_0x2335c4['taxonomy_level']['trim']()['toLowerCase']()){(await _0x18c467['searchTable'](_0x599ced['statement']))['map'](({row:_0x19c397,column:_0x3b16a7})=>{_0x24b3ad['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x494a93+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x599ced['taxonomy_level']?.['toUpperCase']()+'\x20!=\x20'+_0x2335c4['taxonomy_level']?.['toUpperCase']()+')','row':_0x19c397,'column':_0x3b16a7,'from':this['name']});});continue;}}this['report'](_0x24b3ad,_0x20bb8e,_0x1a5e62);}}
|
|
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'](_0x483bd4,_0x323a9d,_0x33ba36,_0xa19bf3){const _0x47d859=[];if(!_0xa19bf3){_0x323a9d['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x1ee0c3=0x0;_0x1ee0c3<_0xa19bf3['co']['length'];_0x1ee0c3++){const _0x418b8e=_0xa19bf3['co'][_0x1ee0c3];if(!_0x418b8e['taxonomy_level']){_0x47d859['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x1ee0c3+0x1),'from':this['name']});continue;}if(!whitelist$1['includes'](_0x418b8e['taxonomy_level']['toLowerCase']())){const {row:_0x76a2e6,column:_0x46ccaa}=(await _0x33ba36['searchTable'](_0x418b8e['statement']))[0x0];_0x76a2e6&&_0x47d859['push']({'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20APPLYING:\x20'+_0x418b8e['taxonomy_level']['toUpperCase'](),'row':_0x76a2e6,'column':_0x46ccaa,'from':this['name']});}}this['report'](_0x47d859,_0x483bd4,_0x323a9d);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'](_0x202389,_0x33b67b,_0x67a42e,_0x45553d){const _0xac3f99=[];if(!_0x45553d){_0x33b67b['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x4b2550=0x0;_0x4b2550<_0x45553d['co']['length'];_0x4b2550++){const _0x4fa653=_0x45553d['co'][_0x4b2550];if(!_0x4fa653){(await _0x67a42e['searchTable'](_0x4b2550+0x1+''))['map'](({row:_0x4b3388,column:_0x2c6dfd})=>{_0xac3f99['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x4b2550+0x1)+'.','row':_0x4b3388,'column':_0x2c6dfd,'from':this['name']});});continue;}if(!_0x4fa653?.['ilo']){(await _0x67a42e['searchTable'](_0x4fa653['statement']))['map'](({row:_0x39b327,column:_0x1d3f7a})=>{_0xac3f99['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x4b2550+0x1)+'.','row':_0x39b327,'column':_0x1d3f7a,'from':this['name']});});continue;}const _0xba8369=(await _0x67a42e['searchTable'](_0x4fa653['statement']))[0x0]??{'row':-1,'column':-1},_0x2c459d=_0x4fa653['ilo']['map'](_0x46edce=>taxoOrder[_0x46edce['taxonomy_level']]);let _0x30e87e=_0x2c459d[0x0];for(let _0x9b9942=0x1;_0x9b9942<_0x2c459d['length'];_0x9b9942++){if(_0x2c459d[_0x9b9942]<_0x30e87e){_0xac3f99['push']({'error':'Under\x20CO\x20'+(_0x4b2550+0x1)+',\x20ILO\x20'+(_0x9b9942+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x9b9942+'\x27s.','row':_0xba8369['row'],'column':_0xba8369['column']+_0x9b9942,'from':this['name']});continue;}_0x30e87e=_0x2c459d[_0x9b9942];}}this['report'](_0xac3f99,_0x202389,_0x33b67b);}}
|
|
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'](_0x22179a,_0x4bbe78,_0x64f011,_0x540882){const {success:_0x17517b,data:_0x2113f1}=_0x64f011['getTable'](),_0x4adc5d=[];if(!_0x17517b){_0x4adc5d['push']({'error':'Unable\x20to\x20access\x20COAEP\x20table.','from':this['name']});return;}const {table:_0x2fb124}=_0x2113f1;for(let _0x361705=0x0;_0x361705<_0x2fb124['length'];_0x361705++){const _0x1cc34c=_0x2fb124[_0x361705],[_0x4283a8,_0x246e06]=_0x1cc34c[0x4];if(!_0x4283a8)_0x4adc5d['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x361705,'column':0x4,'from':this['name']});else _0x4283a8<minPerfTarget$1&&_0x4adc5d['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget$1+'.','row':_0x361705,'column':0x4,'from':this['name']});if(!_0x246e06)_0x4adc5d['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x361705,'column':0x4,'from':this['name']});else _0x246e06<minPassScore$1&&_0x4adc5d['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore$1+'.','row':_0x361705,'column':0x4,'from':this['name']});}this['report'](_0x4adc5d,_0x22179a,_0x4bbe78);}}
|
|
57
57
|
|
|
58
58
|
const DEFAULT_CO_COG_LEVEL='D';
|
|
59
59
|
|
|
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'](
|
|
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'](_0x8aafeb,_0x42ca7e){await this['assertInitialized']()['catch'](_0x51320c=>{_0x42ca7e['push'](_0x51320c);return;});const _0x2a8ade=[];let _0x289bd9=null,_0x54c8a7=null;for(let _0x4e2045=0x0;_0x4e2045<this['table']['length'];_0x4e2045++){const _0x3f280d=[],_0x523647=this['table'][_0x4e2045],_0x2a90a2=_0x523647[0x0]||_0x289bd9,_0x4e41e2=_0x523647[0x1]||_0x54c8a7,_0x34f6f8=_0x523647[0x2],_0x21df01=_0x523647[0x3],_0x3a0aa3=_0x523647[0x4];if(!_0x2a90a2)_0x3f280d['push'](0x0);if(!_0x4e41e2)_0x3f280d['push'](0x1);if(!_0x34f6f8)_0x3f280d['push'](0x2);if(!_0x21df01)_0x3f280d['push'](0x3);if(!_0x3a0aa3)_0x3f280d['push'](0x4);if(_0x54c8a7!==_0x4e41e2)this['validateObjectiveGrammar'](_0x4e41e2,_0x4e2045,0x1,_0x42ca7e);_0x289bd9=_0x2a90a2,_0x54c8a7=_0x4e41e2;for(const _0x56291a of _0x3f280d){_0x2a8ade['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x56291a],'row':_0x4e2045,'column':_0x56291a});}if(_0x34f6f8)this['validateObjectiveGrammar'](_0x34f6f8,_0x4e2045,0x2,_0x42ca7e);}if(_0x2a8ade['length']>0x0)_0x42ca7e['push'](..._0x2a8ade);else _0x8aafeb['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x85b23e){try{const _0x25ebdd=[],_0x2d930b=_0x45663f['parse'](_0x85b23e,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x2f68f2,coIdx:_0x5118a0,iloIdx:_0x5f0c50,assessToolIdx:_0x521a35,perfTargetIdx:_0x17257d}=getCoaepHeader(_0x2d930b);if(_0x2f68f2===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x2d930b['forEach'](_0x331d8c=>{const _0x3d390c=_0x331d8c['indexOf']('Name\x20of\x20Faculty:'),_0xad70f6=_0x331d8c['indexOf']('School\x20Year'),_0x3ac1a4=_0x331d8c['indexOf']('Course:'),_0x4cf68a=_0x331d8c['indexOf']('Semester');_0x3d390c!==-0x1&&(this['state']['faculty']=_0x331d8c[_0x3d390c+0x1]?.['trim']()||this['state']['faculty']);_0xad70f6!==-0x1&&(this['state']['sy']=_0x331d8c[_0xad70f6+0x1]?.['trim']()||this['state']['sy']);if(_0x3ac1a4!==-0x1){const _0xd5014d=_0x331d8c[_0x3ac1a4+0x1]?.['trim']()['split']('\x20')[0x0]||'';this['state']['course']=_0xd5014d||this['state']['course'];}if(_0x4cf68a!==-0x1){const _0x3074b4=_0x331d8c[_0x4cf68a+0x1]?.['trim']()||'',_0x170849=_0x3074b4['match'](/\d+/)?.[0x0];this['state']['semester']=_0x170849?parseInt(_0x170849,0xa):this['state']['semester'];}});for(let _0x4f6391=0x0;_0x4f6391<=_0x2d930b['length'];_0x4f6391++){const _0xbe6089=_0x2d930b[_0x4f6391];if(!_0xbe6089)break;if(_0x4f6391<=_0x2f68f2)continue;if(!_0xbe6089[_0x5f0c50])break;let _0x5cbca7=_0xbe6089[_0x5118a0-0x1]?.['trim']()||'',_0x90d4c6=_0xbe6089[_0x5118a0]?.['trim']()||'',_0x35c9bb=_0xbe6089[_0x5f0c50]?.['trim']()||'';/^\d+$/['test'](_0xbe6089[_0x5118a0]?.['trim']()||'')&&(_0x5cbca7=_0xbe6089[_0x5118a0]?.['trim']()||'',_0x90d4c6=_0xbe6089[_0x5118a0+0x1]?.['trim']()||'');let _0x450405=null;if(_0x90d4c6){const {cognitive_level:_0xed9378,taxonomy_level:_0x28cd3f,verb:_0x4f1d9e,rest:_0x4962a5}=extractFromObjective(_0x90d4c6);_0x450405=[_0xed9378??DEFAULT_CO_COG_LEVEL,_0x28cd3f,_0x4f1d9e,_0x4962a5];}let _0x3aa83e;{const {cognitive_level:_0x1e7682,taxonomy_level:_0x31e2fd,verb:_0x3abf1c,rest:_0x40ce43}=extractFromObjective(_0x35c9bb);_0x3aa83e=[_0x1e7682,_0x31e2fd,_0x3abf1c,_0x40ce43];}const _0x2eb034=_0xbe6089[_0x17257d]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x5175c3,passing_score:_0x44f3e1}=performaceTarget(_0x2eb034);_0x25ebdd['push']([_0x5cbca7,_0x450405,_0x3aa83e,_0xbe6089[_0x521a35]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x5175c3,_0x44f3e1]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x25ebdd};}catch(_0x4f2473){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x4f2473};}}async['toJson'](){const _0x2ca808=[],_0x337fcc=[],_0x2a9bfe='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x4250d3={'faculty':this['state']['faculty'],'course':this['state']['course'],'sy':this['state']['sy'],'semester':this['state']['semester'],'co':[]};let _0x5292d1=null,_0x57ff26='',_0x16d1fc=[null,null];this['table']['forEach']((_0x551f9a,_0x3b0749)=>{if(_0x3b0749===0x0&&!_0x551f9a[0x1])_0x337fcc['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x2a9bfe});_0x551f9a[0x1]&&(_0x57ff26='',_0x16d1fc=[null,null]);const _0x4a80c7=_0x551f9a[0x1],_0x437a9=_0x551f9a[0x2],_0x414341=_0x551f9a[0x3]||_0x57ff26,_0x5feae5=_0x551f9a[0x4]||_0x16d1fc;if(!_0x437a9)_0x337fcc['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x2a9bfe});if(!_0x414341)_0x337fcc['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x3b0749,'column':0x3,'from':_0x2a9bfe});if(!_0x5feae5)_0x337fcc['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x3b0749,'column':0x4,'from':_0x2a9bfe});if(_0x4a80c7){const [_0xa15ffc,_0x43b045,_0x3a9ff1,_0x225f07]=_0x4a80c7,_0x25b701={'statement':_0x225f07,'ilo':[],'taxonomy_level':_0x43b045,'cognitive_level':_0xa15ffc,'verb':_0x3a9ff1};_0x5292d1=_0x25b701,_0x4250d3['co']['push'](_0x25b701);}const [_0x3e2172,_0x2e88cf,_0xa887bb,_0x310914]=_0x437a9,[_0x53144e,_0x2cb456]=_0x5feae5,_0x2f5ba2={'statement':_0x310914,'assessment_tool':_0x414341,'performance_target':_0x53144e,'passing_score':_0x2cb456,'cognitive_level':_0x3e2172,'taxonomy_level':_0x2e88cf,'verb':_0xa887bb};_0x5292d1['ilo']['push'](_0x2f5ba2);});if(_0x337fcc['length'])return _0x337fcc['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x2a9bfe}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x4250d3,'validMsgs':_0x2ca808,'tableErrors':_0x337fcc}};return _0x2ca808['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x4250d3,'validMsgs':_0x2ca808,'tableErrors':_0x337fcc}};}catch(_0x15c4df){return _0x337fcc['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x2a9bfe}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x15c4df,'data':{'jsonObj':null,'tableErrors':_0x337fcc}};}}['validateObjectiveGrammar'](_0x32110f,_0x376a59,_0x2ad53e,_0x163839){if(!_0x32110f){_0x163839['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x376a59,'column':_0x2ad53e,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x44fea9,_0x5ba117,_0x48e950,_0x32c223]=_0x32110f,_0x1cb8ee=[];if(!_0x44fea9)_0x1cb8ee['push']('Cognitive\x20Level');if(!_0x5ba117)_0x1cb8ee['push']('Taxonomy\x20Level');if(!_0x48e950)_0x1cb8ee['push']('Verb');if(!_0x1cb8ee['length'])return;_0x163839['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x1cb8ee['join'](',\x20')+'.','row':_0x376a59,'column':_0x2ad53e,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}['searchRow'](_0x2076a5,_0x4cac5b){const _0x286703=[],[_0x572870,_0x51ce04,_0x4ffcbc,_0x358649,_0xe10a6]=_0x2076a5;if(_0x572870===_0x4cac5b)_0x286703['push']({'column':0x0});if(_0x51ce04&&(_0x51ce04[0x0]===_0x4cac5b||_0x51ce04[0x1]===_0x4cac5b||_0x51ce04[0x2]===_0x4cac5b||_0x51ce04[0x3]===_0x4cac5b))_0x286703['push']({'column':0x1});if(_0x4ffcbc&&(_0x4ffcbc[0x0]===_0x4cac5b||_0x4ffcbc[0x1]===_0x4cac5b||_0x4ffcbc[0x2]===_0x4cac5b||_0x4ffcbc[0x3]===_0x4cac5b))_0x286703['push']({'column':0x2});if(_0x358649===_0x4cac5b)_0x286703['push']({'column':0x3});if(_0xe10a6&&(_0xe10a6[0x0]===_0x4cac5b||_0xe10a6[0x1]===_0x4cac5b))_0x286703['push']({'column':0x4});return _0x286703;}}
|
|
61
61
|
|
|
62
|
-
const whitelist=['applying','analyzing','evaluating','creating'];class MinPItaxo extends DTValidator{constructor(){super('MIN_PI_TAXO');}async['validate'](
|
|
62
|
+
const whitelist=['applying','analyzing','evaluating','creating'];class MinPItaxo extends DTValidator{constructor(){super('MIN_PI_TAXO');}async['validate'](_0x2bd4b8,_0x3368c7,_0x3b1b40,_0x9468da){const _0x2a2edc=[],{success:_0x3d75ab,data:_0x31bfa5}=_0x3b1b40['getTable']();if(!_0x3d75ab){_0x3368c7['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x571ba2}=_0x31bfa5;for(let _0x1d3d31=0x0;_0x1d3d31<_0x571ba2['length'];_0x1d3d31++){const _0x2cdf4b=_0x571ba2[_0x1d3d31],_0x25190a=_0x2cdf4b[0x1]?.['toLowerCase']();if(!_0x25190a)continue;!whitelist['includes'](_0x25190a)&&_0x2a2edc['push']({'error':'Cannot\x20have\x20PO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x25190a['toUpperCase'](),'row':_0x1d3d31,'column':0x1,'from':this['name']});}this['report'](_0x2a2edc,_0x2bd4b8,_0x3368c7);return;}}
|
|
63
63
|
|
|
64
|
-
const minPerfTarget=0x32,minPassScore=0x32;class MinPIPerfTarget extends DTValidator{constructor(){super('MIN_PI_PERF_TARGET');}async['validate'](
|
|
64
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPIPerfTarget extends DTValidator{constructor(){super('MIN_PI_PERF_TARGET');}async['validate'](_0x5bec37,_0x5e6001,_0x704242,_0x2211b5){const _0x564b5f=[],{success:_0x4103ff,data:_0x5ce36d}=_0x704242['getTable']();if(!_0x4103ff){_0x5e6001['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x28f310}=_0x5ce36d;for(let _0x36c561=0x0;_0x36c561<_0x28f310['length'];_0x36c561++){const _0x65b1d9=_0x28f310[_0x36c561],[_0x1dcf9a,_0xa9c56a]=_0x65b1d9[0x6];if(!_0x1dcf9a)_0x564b5f['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x36c561,'column':0x6,'from':this['name']});else _0x1dcf9a<minPerfTarget&&_0x564b5f['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x36c561,'column':0x6,'from':this['name']});if(!_0xa9c56a)_0x564b5f['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x36c561,'column':0x6,'from':this['name']});else _0xa9c56a<minPassScore&&_0x564b5f['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x36c561,'column':0x6,'from':this['name']});}this['report'](_0x564b5f,_0x5bec37,_0x5e6001);return;}}
|
|
65
65
|
|
|
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'](
|
|
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'](_0x4eab06){try{const _0x5e9ae2=[],_0x2562e6=_0x45663f['parse'](_0x4eab06,{'skipEmptyLines':![]})['data'];_0x2562e6['forEach'](_0x31f94a=>{_0x31f94a['forEach'](_0x5bed96=>{_0x5bed96['includes']('PROGRAM:')&&(this['state']['program']=_0x5bed96['replace']('PROGRAM:','')['trim']()['toUpperCase']());});});const {headerIdx:_0x553b95,poIdx:_0x3e2c26,tlIdx:_0x4e657d,piIdx:_0x537ab8,fcIdx:_0x44006e,scIdx:_0x15da72,atIdx:_0x2b465c,ptIdx:_0x2c10bb}=getPoaepHeader(_0x2562e6);if(_0x553b95===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20check\x20the\x20CSV.');let _0x4acf38='',_0x1353fa='',_0x47d9e7='';for(let _0x4c4887=_0x553b95+0x1;_0x4c4887<_0x2562e6['length'];_0x4c4887++){const _0x12a8f7=_0x2562e6[_0x4c4887];if(!_0x12a8f7)break;if(_0x4c4887<=_0x553b95)continue;let _0x24ce01=_0x12a8f7[_0x3e2c26]?.['trim']()||'';if(_0x24ce01){_0x4acf38='',_0x1353fa='',_0x47d9e7='';const [_0x1d8abd,_0x31fd3c]=this['extractPoDesc'](_0x24ce01);if(_0x31fd3c)_0x24ce01=_0x31fd3c;}const _0x58057c=_0x12a8f7[_0x4e657d]?.['trim']()['toLowerCase']()||null,_0x3388d9=_0x12a8f7[_0x537ab8]?.['trim']()||'',_0x584175=_0x12a8f7[_0x44006e]?.['trim']()||'',_0x590cd4=_0x12a8f7[_0x15da72]?.['trim']()||_0x4acf38,_0x427fb2=_0x12a8f7[_0x2b465c]?.['trim']()||_0x1353fa,_0x57c2a3=_0x12a8f7[_0x2c10bb]?.['trim']()||_0x47d9e7,{performance_target:_0x13366c,passing_score:_0x222b28}=performaceTarget(_0x57c2a3);if(!_0x584175)break;const _0x7f31c7=_0x584175['split'](',')['map'](_0x80eb8b=>_0x80eb8b['trim']());_0x5e9ae2['push']([_0x24ce01,_0x58057c,_0x3388d9,_0x7f31c7,_0x590cd4,_0x427fb2,[_0x13366c,_0x222b28]]),_0x4acf38=_0x590cd4,_0x1353fa=_0x427fb2,_0x47d9e7=_0x57c2a3;}if(_0x5e9ae2['length']===0x0)throw new Error('No\x20data\x20parsed.\x20Please\x20check\x20the\x20CSV.');return {'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':_0x5e9ae2};}catch(_0x2ca52c){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x2ca52c};}}async['toJson'](){const _0x2ac6bf=[],_0x56d640=[],_0x4333fb='POAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x4e8005={'po':[]};let _0x5c658a={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x1b5a8f=null,_0x63a31f=null,_0x315557=null;for(let _0x3402e2=0x0;_0x3402e2<this['table']['length'];_0x3402e2++){const _0x5cabe5=this['table'][_0x3402e2],_0x296a32=[],_0x2696dc=_0x5cabe5[0x0]?.['trim']()||null;_0x2696dc&&_0x2696dc!==_0x5c658a['po_desc']&&(_0x5c658a={'po_desc':_0x2696dc,'seq_no':_0x5c658a['seq_no']+0x1,'PerfIndicators':[]},_0x4e8005['po']['push'](_0x5c658a),_0x1b5a8f=null,_0x63a31f=null,_0x315557=null);if(_0x5c658a['po_desc']==='')_0x56d640['push']({'error':'Cannot\x20start\x20with\x20empty\x20Program\x20Outcome.','row':_0x3402e2,'column':0x0,'from':_0x4333fb});const _0x221705=_0x5cabe5[0x1]||null,_0x448395=_0x5cabe5[0x2]||null,_0x47313a=_0x5cabe5[0x3]||null,_0x1ae871=_0x5cabe5[0x4]||_0x1b5a8f,_0x7047f9=_0x5cabe5[0x5]||_0x63a31f,_0x3dd260=_0x5cabe5[0x6]||_0x315557;(!_0x47313a||_0x47313a['length']===0x0)&&_0x56d640['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x3402e2,'column':0x3,'from':_0x4333fb});!_0x3dd260&&_0x56d640['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x3402e2,'column':0x6,'from':_0x4333fb});if(_0x296a32['length']>0x0){_0x56d640['push'](..._0x296a32);continue;}const _0x361d29={'pi_desc':_0x448395,'FormativeCourses':_0x47313a['map'](_0x5bd8af=>({'course_id':_0x5bd8af,'cognitive_level':null})),'SummativeCourse':{'course_id':_0x1ae871},'TaxonomyLevel':_0x221705?{'label':_0x221705}:null,'AssessmentTool':{'at_desc':_0x7047f9},'PerformanceTargets':{'target_percent':_0x3dd260[0x0],'min_score':_0x3dd260[0x1]}};_0x5c658a['PerfIndicators']['push'](_0x361d29);}if(_0x56d640['length']>0x0)return _0x56d640['push']({'error':'Converted\x20POAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x4333fb}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x4e8005,'validMsgs':_0x2ac6bf,'tableErrors':_0x56d640}};return _0x2ac6bf['push']('Successfully\x20converted\x20POAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':{'jsonObj':_0x4e8005,'validMsgs':_0x2ac6bf,'tableErrors':_0x56d640}};}catch(_0x45d647){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x45d647};}}async['validateFields'](_0x5bcc01,_0x394154){await this['assertInitialized']()['catch'](_0x5b5ceb=>{_0x394154['push'](_0x5b5ceb);return;});const _0x2f43b2=[];let _0x46a527=null,_0x3cf017=null,_0x4677b4=null,_0x1e22fe=null;for(let _0x4184e6=0x0;_0x4184e6<this['table']['length'];_0x4184e6++){const _0x27d96e=[],_0x2f81a3=this['table'][_0x4184e6];_0x2f81a3[0x0]&&_0x2f81a3[0x0]!==_0x46a527&&(_0x3cf017=null,_0x4677b4=null,_0x1e22fe=null);const _0x1bcc9c=_0x2f81a3[0x0]||_0x46a527,_0x1afea8=_0x2f81a3[0x1]||null,_0x23d7c4=_0x2f81a3[0x2]||null,_0x27c38a=_0x2f81a3[0x3]||null,_0x4bfc27=_0x2f81a3[0x4]||_0x3cf017,_0x3226ba=_0x2f81a3[0x5]||_0x4677b4,_0x5acef4=_0x2f81a3[0x6]||_0x1e22fe;if(!_0x1bcc9c)_0x27d96e['push'](0x0);if(!_0x1afea8)_0x27d96e['push'](0x1);if(!_0x23d7c4)_0x27d96e['push'](0x2);if(!_0x27c38a)_0x27d96e['push'](0x3);if(!_0x4bfc27)_0x27d96e['push'](0x4);if(!_0x3226ba)_0x27d96e['push'](0x5);if(!_0x5acef4)_0x27d96e['push'](0x6);_0x27d96e['length']>0x0&&_0x27d96e['forEach'](_0x3e60f6=>{_0x2f43b2['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x3e60f6]+'.','row':_0x4184e6,'column':_0x3e60f6,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'});}),_0x27c38a?.['length']===0x0&&_0x2f43b2['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x4184e6,'column':0x3,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'}),_0x46a527=_0x1bcc9c,_0x3cf017=_0x4bfc27,_0x4677b4=_0x3226ba,_0x1e22fe=_0x5acef4;}if(_0x2f43b2['length']>0x0)_0x394154['push'](..._0x2f43b2);else _0x5bcc01['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}['extractPoDesc'](_0x5f0fcc){const _0x1ce20a=/^.*(PO\d+):(.*)$/,_0x14c115=_0x1ce20a['exec'](_0x5f0fcc['trim']());return _0x14c115?_0x14c115['slice'](0x1):['',_0x5f0fcc['trim']()];}['searchRow'](_0x1ad018,_0x4fc533){const _0x1cca1a=[],[_0x3757da,_0x5986a9,_0x202740,_0x4a8373,_0x221bf1,_0x15fd20,_0xb69d99]=_0x1ad018;if(_0x3757da===_0x4fc533)_0x1cca1a['push']({'column':0x0});if(_0x5986a9===_0x4fc533)_0x1cca1a['push']({'column':0x1});if(_0x202740===_0x4fc533)_0x1cca1a['push']({'column':0x2});if(_0x4a8373&&_0x4a8373['includes'](_0x4fc533))_0x1cca1a['push']({'column':0x3});if(_0x221bf1===_0x4fc533)_0x1cca1a['push']({'column':0x4});if(_0x15fd20===_0x4fc533)_0x1cca1a['push']({'column':0x5});if(_0xb69d99&&(_0xb69d99[0x0]===_0x4fc533||_0xb69d99[0x1]===_0x4fc533))_0x1cca1a['push']({'column':0x6});return _0x1cca1a;}}
|
|
67
67
|
|
|
68
|
-
class Client{['BASE_URL'];constructor(
|
|
68
|
+
class Client{['BASE_URL'];constructor(_0x5095b3){this['BASE_URL']=_0x5095b3;}['Parser'](){return {'curriculum':async _0x5d2330=>{const _0x538fd2=await uploadCurriculum(this['BASE_URL'],_0x5d2330);return _0x538fd2;},'courseOffering':async _0x423686=>{const _0x241baf=await uploadCourseOffering(this['BASE_URL'],_0x423686);return _0x241baf;},'coaep':async(_0x12b70c,_0x310aad)=>{const _0x5bf899=await uploadCOAEP(this['BASE_URL'],_0x12b70c,_0x310aad);return _0x5bf899;},'enrolledStudent':async _0x3498a5=>{const _0x569711=await uploadEnrolledStudent(this['BASE_URL'],_0x3498a5);return _0x569711;},'classlist':async(_0x392f3e,_0x2881c5,_0x21afc3)=>{const _0x1fd8e9=await uploadClassList(this['BASE_URL'],_0x392f3e,_0x2881c5,_0x21afc3);return _0x1fd8e9;},'assessmentData':async _0x6767f=>{const _0x442fdd=await uploadAssessmentData(this['BASE_URL'],_0x6767f);return _0x442fdd;},'deptFaculty':async _0x409a7e=>{const _0x2a5cb0=await uploadDeptFaculty(this['BASE_URL'],_0x409a7e);return _0x2a5cb0;},'poaep':async(_0x4e4850,_0x30f6d2,_0x2d988f,_0x2649a5)=>{const _0x215930=await uploadPOAEP(this['BASE_URL'],_0x4e4850,_0x30f6d2,_0x2d988f,_0x2649a5);return _0x215930;},'CoaepDT':CoaepDT,'PoaepDT':PoaepDT};}}
|
|
69
69
|
|
|
70
70
|
export { Client as default };
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AssessmentData } from "../types/assessmentdata";
|
|
2
|
+
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
3
|
+
/**
|
|
4
|
+
* Parses the assessment data from an Excel file and returns an AssessmentData object wrapped in a ParserResult.
|
|
5
|
+
* @param xls - The AssessmentData Template Excel file to parse
|
|
6
|
+
* @returns ParserResult<{ assessmentData: AssessmentData }>
|
|
7
|
+
*/
|
|
8
|
+
export declare const parseAssessmentDataToJson: (xls: File) => Promise<ParserResult<{
|
|
9
|
+
assessmentData: AssessmentData;
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { classList } from "../types/classList";
|
|
2
|
+
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
3
|
+
/**
|
|
4
|
+
* Parses the class list from an Excel file and returns a classList object wrapped in a ParserResult.
|
|
5
|
+
* @param xls - The Classlist Template Excel file to parse
|
|
6
|
+
* @returns ParserResult<{ enrolledCourses: classList[] }>
|
|
7
|
+
*/
|
|
8
|
+
export declare const parseClassListToJson: (xls: File) => Promise<ParserResult<{
|
|
9
|
+
enrolledCourses: classList[];
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
2
|
+
import { CourseOffering } from "../types/courseOffering";
|
|
3
|
+
/**
|
|
4
|
+
* Parses the course offering from an Excel file and returns a CourseOffering object wrapped in a ParserResult.
|
|
5
|
+
* @param xls - The CourseOffering Template Excel file to parse
|
|
6
|
+
* @returns ParserResult<{ courseOfferings: CourseOffering[] }>
|
|
7
|
+
*/
|
|
8
|
+
export declare const parseCourseOfferingToJson: (xls: File) => Promise<ParserResult<{
|
|
9
|
+
courseOfferings: CourseOffering[];
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
2
|
+
import { CurriculumCourses } from "../types/curriculum";
|
|
3
|
+
/**
|
|
4
|
+
* Parses the curriculum from an Excel file and returns a CurriculumCourses object wrapped in a ParserResult.
|
|
5
|
+
* @param xls - The Curriculum Template Excel file to parse
|
|
6
|
+
* @returns ParserResult<{ curriculums: CurriculumCourses[] }>
|
|
7
|
+
*/
|
|
8
|
+
export declare const parseCurriculumToJson: (xls: File) => Promise<ParserResult<{
|
|
9
|
+
curriculums: CurriculumCourses[];
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
2
|
+
/**
|
|
3
|
+
* Parses the department faculty from an Excel file and returns a FormData object of the excel file wrapped in a ParserResult.
|
|
4
|
+
* @param xls - The Department Faculty Template Excel file to parse
|
|
5
|
+
* @returns ParserResult<{ body: FormData }>
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseDeptFacultyToJson: (xls: File) => Promise<ParserResult<{
|
|
8
|
+
body: FormData;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
2
|
+
/**
|
|
3
|
+
* Parses the enrolled students from an Excel file and returns a FormData object of the excel file wrapped in a ParserResult.
|
|
4
|
+
* @param xls - The Enrolled Students Template Excel file to parse
|
|
5
|
+
* @returns ParserResult<{ body: FormData }>
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseEnrolledStudentsToJson: (xls: File) => Promise<ParserResult<{
|
|
8
|
+
body: FormData;
|
|
9
|
+
}>>;
|
package/types/poaep.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface PerfIndicator {
|
|
|
11
11
|
pi_desc: string;
|
|
12
12
|
FormativeCourses: PIFormative[];
|
|
13
13
|
SummativeCourse: PISummative;
|
|
14
|
-
Verb: PIVerb | null;
|
|
15
14
|
TaxonomyLevel: PITaxonomyLevel | null;
|
|
16
15
|
AssessmentTool: PIAssessmentTool;
|
|
17
16
|
PerformanceTargets: PIPerfTarget;
|
|
@@ -23,9 +22,6 @@ export interface PIFormative {
|
|
|
23
22
|
export interface PISummative {
|
|
24
23
|
course_id: string;
|
|
25
24
|
}
|
|
26
|
-
export interface PIVerb {
|
|
27
|
-
label: string;
|
|
28
|
-
}
|
|
29
25
|
export interface PIAssessmentTool {
|
|
30
26
|
at_desc: string;
|
|
31
27
|
}
|