@obe-loms/coms-parser 1.6.27 → 1.6.29
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 +2 -1
- package/DataTable/types/PoaepDTRow.d.ts +27 -2
- package/bundle.js +47 -33
- package/main.d.ts +23 -0
- package/package.json +1 -1
- package/parser/deptfaculty.d.ts +25 -0
- package/payloads/parseDeptFacultyToJson.d.ts +5 -3
- package/payloads/parseEnrolledStudentToJson.d.ts +1 -0
- package/test/curriculum/curriculum.test.d.ts +1 -0
- package/test/deptfaculty/deptfaculty.test.d.ts +1 -0
- package/types/deptfaculty.d.ts +15 -0
- package/types/poaep.d.ts +4 -0
|
@@ -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 { PoaepRow } from "../types/PoaepDTRow";
|
|
5
|
+
import { PoaepDT_PI, PoaepRow } from "../types/PoaepDTRow";
|
|
6
6
|
export declare const poaepHeaders: string[];
|
|
7
7
|
export declare class PoaepDT extends DataTable<POAEP, PoaepRow> {
|
|
8
8
|
/**
|
|
@@ -21,4 +21,5 @@ 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;
|
|
24
25
|
}
|
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
import Taxonomy from "../../types/Taxonomy";
|
|
2
|
+
/**
|
|
3
|
+
* Represents the Program Outcome column in the internal POAEP DataTable.
|
|
4
|
+
*/
|
|
2
5
|
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;
|
|
3
10
|
export type PoaepDT_Taxo = Taxonomy | null;
|
|
4
|
-
export type
|
|
11
|
+
export type PoaepDT_Verb = string | null;
|
|
12
|
+
export type PoaepDT_Rest = string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Represents the Formative Course column in the internal POAEP DataTable.
|
|
15
|
+
*/
|
|
5
16
|
export type PoaepDT_FC = string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Represents the Summative Course column in the internal POAEP DataTable.
|
|
19
|
+
*/
|
|
6
20
|
export type PoaepDT_SC = string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Represents the Assessment Tool column in the internal POAEP DataTable.
|
|
23
|
+
*/
|
|
7
24
|
export type PoaepDT_AT = string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Represents the Performance Target column in the internal POAEP DataTable.
|
|
27
|
+
*/
|
|
8
28
|
export type PoaepDT_Perf = number | null;
|
|
29
|
+
/**
|
|
30
|
+
* Represents the Passing Score column in the internal POAEP DataTable.
|
|
31
|
+
*/
|
|
9
32
|
export type PoaepDT_Pass = number | null;
|
|
33
|
+
/**
|
|
34
|
+
* Represents the Performance Target and Passing Score tuple column in the internal POAEP DataTable.
|
|
35
|
+
*/
|
|
10
36
|
export type PoaepDT_PT = [PoaepDT_Perf, PoaepDT_Pass];
|
|
11
37
|
export type PoaepRow = [
|
|
12
38
|
PoaepDT_PO,
|
|
13
|
-
PoaepDT_Taxo,
|
|
14
39
|
PoaepDT_PI,
|
|
15
40
|
PoaepDT_FC[],
|
|
16
41
|
PoaepDT_SC,
|
package/bundle.js
CHANGED
|
@@ -1,70 +1,84 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x2ee223 from 'papaparse';
|
|
2
|
+
import * as _0x1e82e9 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x102fbd){let _0x1d48e2='',_0x34c247='',_0x5dcbe5=0x0,_0x81bfff=null;const _0x5dd6d5=[];return _0x2ee223['parse'](_0x102fbd,{'skipEmptyLines':!![],'complete':_0x38bc75=>{_0x38bc75['data']['forEach'](_0x3967bb=>{const _0x1c1ac1=_0x3967bb['map'](_0x29c8f9=>(_0x29c8f9??'')['toString']()['trim']()),_0x53501c=_0x1c1ac1[0x0]??'';if(_0x53501c['includes']('Rev#')){const _0x263b82=_0x53501c['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x263b82&&(_0x1d48e2=_0x263b82[0x1]?.['trim']()??'',_0x34c247=_0x263b82[0x2]?.['trim']()??'',_0x5dcbe5=parseInt(_0x263b82[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x53501c)){_0x81bfff=0x1;return;}if(/SECOND YEAR/i['test'](_0x53501c)){_0x81bfff=0x2;return;}if(/THIRD YEAR/i['test'](_0x53501c)){_0x81bfff=0x3;return;}if(/FOURTH YEAR/i['test'](_0x53501c)){_0x81bfff=0x4;return;}if(/FIFTH YEAR/i['test'](_0x53501c)){_0x81bfff=0x5;return;}if(/First Semester/i['test'](_0x53501c)||/Second Semester/i['test'](_0x53501c)||/Summer/i['test'](_0x53501c))return;const _0x41f6f8=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x41f6f8['forEach'](({sem:_0x3c3a30,offset:_0x2641ae})=>{const _0x22dc30=_0x1c1ac1[_0x2641ae]??'',_0x6042d0=_0x1c1ac1[_0x2641ae+0x1]??'',_0x402752=_0x1c1ac1[_0x2641ae+0x2]??'',_0x234af4=_0x1c1ac1[_0x2641ae+0x3]??'',_0x16e69d=_0x1c1ac1[_0x2641ae+0x4]??'';_0x22dc30&&_0x81bfff&&_0x5dd6d5['push']({'curr_id':_0x1d48e2,'program_name':_0x34c247,'revision_no':_0x5dcbe5,'year_level':_0x81bfff,'sem':_0x3c3a30,'course_id':_0x22dc30,'course_desc':_0x6042d0,'total_units':_0x402752,'lec_unit':_0x234af4,'lab_unit':_0x16e69d});});});}}),_0x5dd6d5;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x27eabe,_0x52432f){return new Promise((_0x67fccf,_0x9ef13b)=>{const _0x57c416=new FileReader();_0x57c416['onload']=_0x263576=>{const _0x2f320a=_0x263576['target']?.['result'];if(!_0x2f320a){_0x9ef13b(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x5defe7=_0x1e82e9['read'](_0x2f320a,{'type':'array'});!_0x52432f&&(_0x52432f=_0x5defe7['SheetNames'][0x0]);if(!_0x52432f){_0x9ef13b(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x333d31=_0x5defe7['Sheets'][_0x52432f];if(!_0x333d31){_0x9ef13b(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x18a58e=_0x1e82e9['utils']['sheet_to_csv'](_0x333d31,{'strip':!![]}),_0x11a6a6=_0x27eabe['name']['replace'](/\.[^/.]+$/,'.csv'),_0x2fb34e=new File([_0x18a58e],_0x11a6a6,{'type':'text/csv','lastModified':Date['now']()});_0x67fccf(_0x2fb34e);}catch(_0xbb324d){_0x9ef13b(_0xbb324d);}},_0x57c416['onerror']=()=>{_0x9ef13b(new Error('File\x20reading\x20failed'));},_0x57c416['readAsArrayBuffer'](_0x27eabe);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x5b1a3b,_0x2166d7){try{const _0x18d417=await convertToCSVFile(_0x2166d7),_0x84bf0e=await _0x18d417['text'](),_0xc8161=parseCurriculum(_0x84bf0e),_0x46e5a3=_0x2ee223['unparse'](_0xc8161),_0x528285=new File([_0x46e5a3],_0x18d417['name'],{'type':'text/csv'}),_0x534d4d=new FormData();_0x534d4d['append']('csvFile',_0x528285);const _0x517388=await fetch(_0x5b1a3b+'/curr-courses/upload',{'method':'POST','body':_0x534d4d});if(!_0x517388['ok']){const _0x1164b4=await _0x517388['json']();throw _0x1164b4;}return _0x517388['json']();}catch(_0x519071){throw _0x519071;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x136ff6){let _0xf90203='',_0x41efb5='';const _0x225bb4=[],_0x17520b=_0x2ee223['parse'](_0x136ff6,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x3252cd=_0x17520b['data'];for(let _0x338092=0x0;_0x338092<Math['min'](0x5,_0x3252cd['length']);_0x338092++){const _0x2dd993=_0x3252cd[_0x338092];if(_0x2dd993&&_0x2dd993['length']>0x0){const _0x15e436=_0x2dd993[0x0]?.['toString']()||'',_0x4ace57=_0x15e436['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x4ace57){_0xf90203=_0x4ace57[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x4ace57[0x2]){const _0x5a9736=_0x4ace57[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x5a9736&&_0x5a9736[0x2]&&_0x5a9736[0x4]&&(_0x41efb5=_0x5a9736[0x2]+_0x5a9736[0x4]);}}}}let _0x34078c=-1;for(let _0x3b83cc=0x0;_0x3b83cc<_0x3252cd['length'];_0x3b83cc++){const _0x50b04a=_0x3252cd[_0x3b83cc];if(_0x50b04a&&_0x50b04a['some'](_0x162cde=>_0x162cde?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x34078c=_0x3b83cc;break;}}if(_0x34078c===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x46153a={'code':'','description':'','unit':0x0};for(let _0x3afa6c=_0x34078c+0x1;_0x3afa6c<_0x3252cd['length'];_0x3afa6c++){const _0x318224=_0x3252cd[_0x3afa6c];if(!_0x318224||_0x318224['length']<0x8)continue;const _0x16ae08=_0x318224[0x1]?.['toString']()['trim']()||'',_0x4da190=_0x318224[0x4]?.['toString']()['trim']()||'',_0x2a47d0=_0x318224[0x5]?.['toString']()['trim']()||'',_0x18eb71=_0x318224[0x6]?.['toString']()['trim']()||'',_0x16e54a=_0x318224[0x7]?.['toString']()['trim']()||'',_0x11d0eb=_0x318224[0x3]?.['toString']()['trim']()||'';let _0x3e060c=_0x318224[0x0]?.['toString']()['trim']()||'',_0x2a2bc1=_0x318224[0x2]?.['toString']()['trim']()||'';if(!_0x16ae08)continue;if(!_0x3e060c)_0x3e060c=_0x46153a['code'];if(!_0x2a2bc1)_0x2a2bc1=_0x46153a['description'];let _0x7658a3=_0x46153a['unit'];if(_0x11d0eb){const _0x55bb73=_0x11d0eb['match'](/(\d+)/);_0x55bb73&&_0x55bb73[0x1]&&(_0x7658a3=parseInt(_0x55bb73[0x1],0xa));}const _0x5b30f4={'sem':_0xf90203,'school_year':_0x41efb5,'code':_0x3e060c,'course_no':_0x16ae08,'course_desc':_0x2a2bc1,'unit':_0x7658a3,'time':_0x4da190,'days':_0x2a47d0,'faculty':_0x18eb71,'room':_0x16e54a};_0x46153a['code']=_0x3e060c,_0x46153a['description']=_0x2a2bc1,_0x46153a['unit']=_0x7658a3,_0x225bb4['push'](_0x5b30f4);}return _0x225bb4;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x260398,_0x30644e){try{const _0x2b5d52=await convertToCSVFile(_0x30644e),_0x32146e=await _0x2b5d52['text'](),_0x11a5c2=parseCourseOffering(_0x32146e),_0xcac9df=_0x2ee223['unparse'](_0x11a5c2),_0x76eea1=new File([_0xcac9df],_0x2b5d52['name'],{'type':'text/csv'}),_0x1ae086=new FormData();_0x1ae086['append']('csvFile',_0x76eea1);const _0x3502a2=await fetch(_0x260398+'/course-offerings/upload',{'method':'POST','body':_0x1ae086});if(!_0x3502a2['ok']){const _0x4f2386=await _0x3502a2['json']();throw _0x4f2386;}return _0x3502a2['json']();}catch(_0x3a845f){throw _0x3a845f;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x393983){if(!_0x393983)return {'performance_target':null,'passing_score':null};const _0x4a1da9=_0x393983['match'](/\d+/g);return {'performance_target':_0x4a1da9?.[0x0]?parseInt(_0x4a1da9[0x0],0xa):null,'passing_score':_0x4a1da9?.[0x1]?parseInt(_0x4a1da9[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(_0x5f5bb1){let _0xa3ed24={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0xbb8b56=0x0;_0xbb8b56<Math['min'](_0x5f5bb1['length'],0x14);_0xbb8b56++){const _0x35124b=(_0x5f5bb1[_0xbb8b56]??[])['map'](_0x298c14=>_0x298c14['toLowerCase']()['trim']()),_0x3c181f=_0x35124b['findIndex'](_0x4d1619=>HEADERS$1['co']['some'](_0x4eec16=>_0x4d1619['includes'](_0x4eec16))),_0x42055b=_0x35124b['findIndex'](_0x18f12a=>HEADERS$1['ilo']['some'](_0x41f3d0=>_0x18f12a['includes'](_0x41f3d0))),_0x444b54=_0x35124b['findIndex'](_0x57a53e=>HEADERS$1['assessTool']['some'](_0x150a24=>_0x57a53e['includes'](_0x150a24))),_0x4e9f05=_0x35124b['findIndex'](_0x567408=>HEADERS$1['perfTarget']['some'](_0x4312fa=>_0x567408['includes'](_0x4312fa))),_0x1a1549=[_0x3c181f,_0x42055b,_0x444b54,_0x4e9f05]['filter'](_0x1c1f94=>_0x1c1f94!==-1)['length'];if(_0x1a1549>=0x3){_0xa3ed24={'headerRowIndex':_0xbb8b56,'coIdx':_0x3c181f,'iloIdx':_0x42055b,'assessToolIdx':_0x444b54,'perfTargetIdx':_0x4e9f05};break;}}return _0xa3ed24;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x1aba3a){const _0x35d8ea={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':_0x1aba3a['trim']()},_0x40eb82=_0x1aba3a['match'](/^\((I|E|D)\)/);_0x40eb82&&(_0x35d8ea['cognitive_level']=_0x40eb82[0x1],_0x35d8ea['rest']=_0x1aba3a['slice'](_0x40eb82[0x0]['length'])['trim']());const _0x42e2dc=_0x35d8ea['rest']?.['match'](/^(.*?)\:/);_0x42e2dc&&(_0x35d8ea['taxonomy_level']=_0x42e2dc[0x1]['trim']()['toLowerCase']()||null,_0x35d8ea['rest']=_0x35d8ea['rest']?.['slice'](_0x42e2dc[0x0]['length'])['trim']()||null);const _0x4cb59b=_0x35d8ea['rest']?.['match'](/(?:shall|will)\s+([a-zA-Z-]+)/);if(_0x4cb59b)_0x35d8ea['verb']=_0x4cb59b[0x1]['trim']()['toLowerCase']()||null;else {const _0x230f3e=_0x35d8ea['rest']?.['match'](/^\w+/);if(_0x230f3e)_0x35d8ea['verb']=_0x230f3e[0x0]['trim']()['toLowerCase']()||null;}return _0x35d8ea;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x5c31c7){const _0x49dc1b=_0x2ee223['parse'](_0x5c31c7,{'skipEmptyLines':![]})['data'],_0xb310e2={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x398da4,coIdx:_0x387b0b,iloIdx:_0x390197,assessToolIdx:_0xe40757,perfTargetIdx:_0x21debf}=getCoaepHeader(_0x49dc1b);if(_0x398da4===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x49dc1b['forEach'](_0x473bb5=>{const _0x19d7b9=_0x473bb5['indexOf']('Name\x20of\x20Faculty:'),_0x231a0d=_0x473bb5['indexOf']('School\x20Year'),_0x1cf386=_0x473bb5['indexOf']('Course:'),_0x12f8f5=_0x473bb5['indexOf']('Semester');_0x19d7b9!==-1&&(_0xb310e2['COAEP']['faculty']=_0x473bb5[_0x19d7b9+0x1]?.['trim']()||_0xb310e2['COAEP']['faculty']);_0x231a0d!==-1&&(_0xb310e2['COAEP']['sy']=_0x473bb5[_0x231a0d+0x1]?.['trim']()||_0xb310e2['COAEP']['sy']);_0x1cf386!==-1&&(_0xb310e2['COAEP']['course']=_0x473bb5[_0x1cf386+0x1]?.['trim']()||_0xb310e2['COAEP']['course']);if(_0x12f8f5!==-1){const _0x319445=_0x473bb5[_0x12f8f5+0x1]?.['trim']()||'',_0x1aa69d=_0x319445['match'](/\d+/)?.[0x0];_0xb310e2['COAEP']['semester']=_0x1aa69d?parseInt(_0x1aa69d,0xa):_0xb310e2['COAEP']['semester'];}});let _0x32b6bc=null;return _0x49dc1b['forEach']((_0xbf74ff,_0x1348ea)=>{if(_0x1348ea<=_0x398da4)return;let _0x14bde1=_0xbf74ff[_0x387b0b-0x1]?.['trim']()||'',_0x4f130c=_0xbf74ff[_0x387b0b]?.['trim']()||'';/^\d+$/['test'](_0xbf74ff[_0x387b0b]?.['trim']()||'')&&(_0x14bde1=_0xbf74ff[_0x387b0b]?.['trim']()||'',_0x4f130c=_0xbf74ff[_0x387b0b+0x1]?.['trim']()||'');const _0x42ec03=_0xbf74ff[_0x390197]?.['trim']()||'',_0x16e8c3=_0xbf74ff[_0xe40757]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x36eab6=_0xbf74ff[_0x21debf]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x14bde1&&/^\d+$/['test'](_0x14bde1)){_0x32b6bc&&_0xb310e2['COAEP']['co']['push'](_0x32b6bc);const _0x49deb3=_0x4f130c,{verb:_0x425114,cognitive_level:_0x2aa21c,taxonomy_level:_0x38d8e2}=extractFromObjective(_0x49deb3);if(!_0x425114)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x14bde1+'\x20is\x20in\x20the\x20correct\x20format.'};_0x32b6bc={'statement':_0x49deb3,'ilo':[],'verb':_0x425114,'cognitive_level':_0x2aa21c,'taxonomy_level':_0x38d8e2};}if(_0x32b6bc&&_0x42ec03&&_0x36eab6){const _0x3aa422=_0x42ec03['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x3aa422['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x3aa422['length']<0xa)return;let _0x4043b2=_0x16e8c3;if(!_0x4043b2&&_0x3aa422['includes'](':')){const _0xcac333=_0x3aa422['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0xcac333&&(_0x4043b2=_0xcac333[0x1]?.['trim']()||'');}const {performance_target:_0x2efc07,passing_score:_0x50a31f}=performaceTarget(_0x36eab6),{verb:_0x68ee87,cognitive_level:_0x36398d,taxonomy_level:_0x176376}=extractFromObjective(_0x3aa422);_0x32b6bc['ilo']['push']({'statement':_0x3aa422,'assessment_tool':_0x4043b2,'performance_target':_0x2efc07,'passing_score':_0x50a31f,'verb':_0x68ee87,'cognitive_level':_0x36398d,'taxonomy_level':_0x176376});}}),_0x32b6bc&&_0xb310e2['COAEP']['co']['push'](_0x32b6bc),_0xb310e2;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x4069c5,_0x4f22ae,_0x284eee){try{const _0xda6501=await convertToCSVFile(_0x4f22ae),_0x248a4e=await _0xda6501['text'](),_0x30481f=parseCOAEP(_0x248a4e);console['log'](_0x30481f);const _0x267fef=await fetch(_0x4069c5+'/coaeps/upload?course_id='+_0x284eee,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x30481f)});if(!_0x267fef['ok']){const _0x10618a=await _0x267fef['json']();throw _0x10618a;}return _0x267fef['json']();}catch(_0x30ccec){throw _0x30ccec;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x1da7df,_0x2e1d34){try{const _0x2e7bb9=await convertToCSVFile(_0x2e1d34),_0x559e43=new FormData();_0x559e43['append']('csvFile',_0x2e7bb9);const _0x2c7ca7=await fetch(_0x1da7df+'/enrolled-students/upload',{'method':'POST','body':_0x559e43});if(!_0x2c7ca7['ok']){const _0x18645d=await _0x2c7ca7['json']();throw _0x18645d;}return _0x2c7ca7['json']();}catch(_0x501bab){throw _0x501bab;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x33fda3){const _0x3c40f1=_0x2ee223['parse'](_0x33fda3,{'skipEmptyLines':!![]})['data'];let _0xd4f1a8='',_0x4aae3a='',_0x1ec885='';const _0x5526c4=[];return _0x3c40f1['forEach'](_0x58a90a=>{const _0x13a37c=_0x58a90a['map'](_0x1c494b=>(_0x1c494b??'')['toString']()['trim']()),_0x1f82f=_0x13a37c[0x0]??'';if(_0x1f82f['startsWith']('Course\x20No:')){const _0x1fe06a=_0x1f82f['replace']('Course\x20No:','')['trim'](),_0x5b03e1=_0x1fe06a['split'](/\s+/);_0x1ec885=_0x5b03e1[0x0]??'';const [_0x506523,_0x26f621]=(_0x5b03e1[0x1]??'')['split']('-');_0x4aae3a=_0x506523??'';const _0x27aeb1=(_0x26f621??'')['match'](/[a-z]$/);_0xd4f1a8=_0x27aeb1?_0x27aeb1[0x0]:'';}if(/^\d+$/['test'](_0x1f82f)){const _0x5a5c29=_0x13a37c[0x2]??'';_0x5526c4['push']({'subj_code':_0x1ec885,'student_no':_0x5a5c29,'course_id':_0x4aae3a,'section':_0xd4f1a8});}}),{'enrolledCourses':_0x5526c4};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x14b32f,_0x48618a,_0x8bbe93,_0x230e0e){try{const _0x18a5b1=await convertToCSVFile(_0x48618a),_0x264bcf=await _0x18a5b1['text'](),_0x4b4f99=parseClassList(_0x264bcf),_0x36ae2e='subj_code='+_0x8bbe93+'&period_id='+_0x230e0e,_0x40926f=await fetch(_0x14b32f+'/enrolled-courses/upload?'+_0x36ae2e,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x4b4f99)});if(!_0x40926f['ok']){const _0x20e93b=await _0x40926f['json']();throw _0x20e93b;}return _0x40926f['json']();}catch(_0x597655){throw _0x597655;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x201844){const {data:_0x507e91}=_0x2ee223['parse'](_0x201844,{'skipEmptyLines':!![]}),_0x3c54f0=_0x507e91['filter'](_0x2734f5=>_0x2734f5['length']>0x0),_0x24992c=_0x3c54f0['find'](_0x287550=>_0x287550['some'](_0x4dd91d=>_0x4dd91d?.['includes']('Faculty'))),_0x23559f=_0x24992c?_0x24992c['findIndex'](_0xdf62=>_0xdf62?.['includes']('Faculty')):-1,_0x49870f=_0x23559f!==-1&&_0x24992c?_0x24992c[_0x23559f+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x481b77=_0x3c54f0['find'](_0x1bdc87=>_0x1bdc87['some'](_0x29849=>_0x29849?.['includes']('Semester'))),_0x539e60=_0x481b77?_0x481b77['findIndex'](_0x2c2a64=>_0x2c2a64?.['includes']('Semester')):-1,_0xdc3668=_0x539e60!==-1&&_0x481b77?_0x481b77[_0x539e60+0x2]?.['trim']()??'':'',_0x5370f0=_0xdc3668['includes']('1st')?0x1:_0xdc3668['includes']('2nd')?0x2:0x0,_0x4b1543=_0x3c54f0['find'](_0x54db55=>_0x54db55['some'](_0x5a6e78=>_0x5a6e78?.['includes']('Course\x20&\x20Sec'))),_0x5ab17c=_0x4b1543?_0x4b1543['findIndex'](_0x3f83ca=>_0x3f83ca?.['includes']('Course\x20&\x20Sec')):-1,_0x2664ff=_0x5ab17c!==-1&&_0x4b1543?_0x4b1543[_0x5ab17c+0x2]?.['trim']()??'':'';let _0x14f932='',_0x26213d='';if(_0x2664ff){const _0x1acbd2=_0x2664ff['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x1acbd2&&(_0x14f932=_0x1acbd2[0x1]??'',_0x1acbd2[0x2]&&(_0x26213d=_0x1acbd2[0x2]['replace'](/^OC/i,'')));}const _0x1350b2=_0x3c54f0['find'](_0x40534e=>_0x40534e['some'](_0x226c65=>_0x226c65?.['includes']('School\x20Year'))),_0x1aa8ee=_0x1350b2?_0x1350b2['findIndex'](_0x4287ba=>_0x4287ba?.['includes']('School\x20Year')):-1,_0x3c1ae8=_0x1aa8ee!==-1&&_0x1350b2?_0x1350b2[_0x1aa8ee+0x2]?.['trim']()??'':'';let _0xa1cbe2=0x0;if(_0x3c1ae8){const _0x4d3939=_0x3c1ae8['match'](/(\d{4})-(\d{4})/);if(_0x4d3939){const _0x166883=(_0x4d3939[0x1]??'')['slice'](0x2),_0x1be2e8=(_0x4d3939[0x2]??'')['slice'](0x2);_0xa1cbe2=parseInt(_0x166883+_0x1be2e8,0xa);}}const _0x17eb03={'faculty':_0x49870f,'course':_0x14f932,'section':_0x26213d,'semester':_0x5370f0,'sy':_0xa1cbe2},_0x225a94=_0x3c54f0['findIndex'](_0x4bf384=>_0x4bf384['some'](_0x798b7e=>_0x798b7e?.['trim']()==='CO\x20#'));if(_0x225a94===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x540986=_0x3c54f0[_0x225a94+0x1];if(!_0x540986)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0xfb0efa={};let _0x4848a2=0x1,_0x3123e5=0x1;for(let _0x3b9b91=0x3;_0x3b9b91<_0x540986['length'];_0x3b9b91++){const _0x501eb2=_0x540986[_0x3b9b91];if(!_0x501eb2)continue;const _0xb582e9='co'+_0x4848a2;if(!_0xfb0efa[_0xb582e9])_0xfb0efa[_0xb582e9]=[];_0xfb0efa[_0xb582e9]['push']('ilo'+_0x3123e5),_0x3123e5++,_0x3123e5>0x3&&(_0x4848a2++,_0x3123e5=0x1);}const _0x109de3=_0x3c54f0['findIndex'](_0x226f49=>_0x226f49['includes']('Name\x20of\x20Students'));if(_0x109de3===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x1d8722=_0x3c54f0[_0x109de3];if(!_0x1d8722)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x3fca24=_0x1d8722['findIndex'](_0xa38333=>_0xa38333?.['includes']('Name\x20of\x20Students'));if(_0x3fca24===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x3b6b6a=_0x3fca24+0x2,_0x5af489=[];for(let _0x263f9d=_0x109de3+0x1;_0x263f9d<_0x3c54f0['length'];_0x263f9d++){const _0x110705=_0x3c54f0[_0x263f9d];if(!_0x110705)continue;if(_0x110705['some'](_0x20bf2a=>_0x20bf2a?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x20bf2a?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x20bf2a?.['toUpperCase']()['includes']('INACTIVE')||_0x20bf2a?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x110705[_0x3fca24])continue;const _0x52ec51=_0x110705[_0x3fca24]['replace'](/"/g,'')['trim'](),_0x43bf1b=_0x110705['slice'](_0x3b6b6a)['map'](_0x295cbe=>_0x295cbe===null?null:!isNaN(Number(_0x295cbe))?parseFloat(_0x295cbe):0x0);let _0x5128c0=0x0;const _0x107ef3={};Object['entries'](_0xfb0efa)['forEach'](([_0x487c75,_0x594205])=>{const _0x493a14={};_0x594205['forEach'](_0x205623=>{_0x493a14[_0x205623]=_0x43bf1b[_0x5128c0]??0x0,_0x5128c0++;}),_0x107ef3[_0x487c75]={'transmuted_score':_0x493a14};}),_0x5af489['push']({'student_name':_0x52ec51,'coaep':_0x107ef3});}const _0x3b77ac=_0x3c54f0['find'](_0x5eaf99=>_0x5eaf99['some'](_0x326535=>_0x326535?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0xfc3127=_0x3c54f0['find'](_0x1d8aa8=>_0x1d8aa8['some'](_0x38714c=>_0x38714c?.['includes']('AVERAGE'))),_0x1c832c=_0x3b77ac?_0x3b77ac['slice'](_0x3b6b6a)['map'](_0x583c1b=>_0x583c1b&&!isNaN(Number(_0x583c1b))?parseInt(_0x583c1b):0x0):[],_0x41c301=_0xfc3127?_0xfc3127['slice'](_0x3b6b6a)['map'](_0x57d533=>_0x57d533&&_0x57d533!=='#DIV/0!'&&!isNaN(Number(_0x57d533))?parseInt(_0x57d533):0x0):[],_0x4ffdd7={};let _0x401807=0x0;return Object['entries'](_0xfb0efa)['forEach'](([_0x3e8afd,_0x2c8dcc])=>{if(!_0x4ffdd7[_0x3e8afd])_0x4ffdd7[_0x3e8afd]={};_0x2c8dcc['forEach'](_0x5a8420=>{_0x4ffdd7[_0x3e8afd][_0x5a8420]={'achievedMinimum':_0x1c832c[_0x401807]??0x0,'average':_0x41c301[_0x401807]??0x0},_0x401807++;});}),{'assessmentData':{'classAssignment':_0x17eb03,'student':_0x5af489,'total':_0x4ffdd7}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x97926c,_0x4f1b02){try{const _0x44be0e=await convertToCSVFile(_0x4f1b02),_0x5c779d=await _0x44be0e['text'](),_0x3d63ce=parseAssessmentCsv(_0x5c779d),_0x1ff731=await fetch(_0x97926c+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x3d63ce)});if(!_0x1ff731['ok']){const _0x29b05b=await _0x1ff731['json']();throw _0x29b05b;}return _0x1ff731['json']();}catch(_0x6def0c){throw _0x6def0c;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x49ffe6,_0x37b2b3){try{const _0x425da4=await convertToCSVFile(_0x37b2b3),_0x22b065=new FormData();_0x22b065['append']('csvFile',_0x425da4);const _0x594f62=await fetch(_0x49ffe6+'/dept-faculties/upload',{'method':'POST','body':_0x22b065});if(!_0x594f62['ok']){const _0x2f3086=await _0x594f62['json']();throw _0x2f3086;}return _0x594f62['json']();}catch(_0x1016cf){throw _0x1016cf;}}
|
|
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(_0x3771f0){let _0x506f74={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x4caefe=0x0;_0x4caefe<Math['min'](_0x3771f0['length'],0x14);_0x4caefe++){const _0x17a746=(_0x3771f0[_0x4caefe]??[])['map'](_0x26bc67=>_0x26bc67['toLowerCase']()['trim']()),_0x5b4845=_0x17a746['findIndex'](_0x545643=>HEADERS['po']['some'](_0xcfce11=>_0x545643['toLowerCase']()['includes'](_0xcfce11))),_0x5f57bd=_0x17a746['findIndex'](_0x21fc07=>HEADERS['tl']['some'](_0x450dde=>_0x21fc07['toLowerCase']()['includes'](_0x450dde))),_0x545b7b=_0x17a746['findIndex'](_0x210aa4=>HEADERS['pi']['some'](_0x162a4f=>_0x210aa4['toLowerCase']()['includes'](_0x162a4f))),_0x32b52d=_0x17a746['findIndex'](_0x1c0c3f=>HEADERS['fc']['some'](_0x1dd4ab=>_0x1c0c3f['toLowerCase']()['includes'](_0x1dd4ab))),_0x431f73=_0x17a746['findIndex'](_0x3333d5=>HEADERS['sc']['some'](_0x5c0ff8=>_0x3333d5['toLowerCase']()['includes'](_0x5c0ff8))),_0x12b74c=_0x17a746['findIndex'](_0x7c8afd=>HEADERS['at']['some'](_0x4605c6=>_0x7c8afd['toLowerCase']()['includes'](_0x4605c6))),_0x5c5b0b=_0x17a746['findIndex'](_0x102ef5=>HEADERS['pt']['some'](_0x4e450f=>_0x102ef5['toLowerCase']()['includes'](_0x4e450f))),_0x1ef89c=[_0x5b4845,_0x5f57bd,_0x545b7b,_0x32b52d,_0x431f73,_0x12b74c,_0x5c5b0b]['filter'](_0x2fe6bd=>_0x2fe6bd!==-1)['length'];if(_0x1ef89c>=0x3){_0x506f74={'headerIdx':_0x4caefe,'poIdx':_0x5b4845,'tlIdx':_0x5f57bd,'piIdx':_0x545b7b,'fcIdx':_0x32b52d,'scIdx':_0x431f73,'atIdx':_0x12b74c,'ptIdx':_0x5c5b0b};break;}}if(_0x506f74['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x506f74;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x31ac71=>{let _0x2e5013=_0x31ac71['split'](',')['reduce']((_0x2694eb,_0x4977a5)=>{const _0x25709c=_0x4977a5['trim']();if(_0x25709c)_0x2694eb['push'](_0x25709c);return _0x2694eb;},[]);return _0x2e5013;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x5a09c8=>{try{const _0x1218d7=_0x2ee223['parse'](_0x5a09c8,{'skipEmptyLines':![]})['data'],{headerIdx:_0x23a1c0,poIdx:_0x37ddcf,tlIdx:_0x211442,piIdx:_0x418aec,fcIdx:_0x21eed4,scIdx:_0x4c41da,atIdx:_0x5252ab,ptIdx:_0x25db3d}=getPoaepHeader(_0x1218d7),_0x59cfb2=[];let _0x2eb9d7={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x3f7d49='',_0x2ca024='',_0x3bcaf2='';for(let _0x11e11b=_0x23a1c0+0x1;_0x11e11b<_0x1218d7['length'];_0x11e11b++){const _0x22c7bd=_0x1218d7[_0x11e11b];if(!_0x22c7bd)break;const _0x24577d=_0x22c7bd[_0x37ddcf]?.['trim']()||'';_0x24577d!==''&&(_0x2eb9d7={'po_desc':_0x24577d,'seq_no':_0x2eb9d7['seq_no']+0x1,'PerfIndicators':[]},_0x59cfb2['push'](_0x2eb9d7),_0x3f7d49='',_0x2ca024='',_0x3bcaf2='');if(_0x2eb9d7['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x11e11b+'.');const _0x48abdf=_0x22c7bd[_0x418aec]?.['trim']()||'';if(_0x48abdf==='')break;const {taxonomy_level:_0x33d99d,verb:_0x110c2d,rest:_0x28b4da}=extractFromObjective(_0x48abdf),_0x5a334e=_0x22c7bd[_0x21eed4]?.['trim']()||'';if(_0x5a334e==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x11e11b+'.');const _0x24cc52=_0x22c7bd[_0x4c41da]?.['trim']()||_0x3f7d49;if(_0x24cc52==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x11e11b+'.');_0x3f7d49=_0x24cc52;const _0x5b96a4=_0x22c7bd[_0x5252ab]?.['trim']()||_0x2ca024;if(_0x5b96a4==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x11e11b+'.');_0x2ca024=_0x5b96a4;const _0x39b60d=_0x22c7bd[_0x25db3d]?.['trim']()||_0x3bcaf2;if(_0x39b60d==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x11e11b+'.');_0x3bcaf2=_0x39b60d;const _0x587ce2=_0x33d99d||_0x22c7bd[_0x211442]?.['trim']()||'';if(_0x587ce2===null)throw new Error('Empty\x20Taxonomy\x20Level\x20at\x20row\x20'+_0x11e11b+'.');const _0x2fffa2=_0x110c2d||null,_0x3d374=parseFormativeCourses(_0x5a334e);if(_0x3d374['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x11e11b+'.');const _0x3f89ad=performaceTarget(_0x39b60d);if(!_0x3f89ad['performance_target']||!_0x3f89ad['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x11e11b+'.');const _0x2a44a2={'pi_desc':_0x48abdf,'FormativeCourses':_0x3d374['map'](_0x975c9a=>({'course_id':_0x975c9a,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x24cc52},'Verb':_0x2fffa2?{'label':_0x2fffa2}:null,'TaxonomyLevel':{'label':_0x587ce2},'AssessmentTool':{'at_desc':_0x5b96a4},'PerformanceTargets':{'target_percent':_0x3f89ad['performance_target'],'min_score':_0x3f89ad['passing_score']}};_0x2eb9d7['PerfIndicators']['push'](_0x2a44a2);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x59cfb2}};}catch(_0x253fc7){return {'success':![],'error':_0x253fc7 instanceof Error?_0x253fc7['message']:_0x253fc7,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x50304d,_0x2651c6,_0x1a3c8c,_0x20a9c2,_0x264de2){try{const _0x52427b=await convertToCSVFile(_0x2651c6),_0x5df4b7=await _0x52427b['text'](),_0x346a4c=parsePOAEP(_0x5df4b7),_0x41de61=await fetch(_0x50304d+'/program-outcomes/poaep/upload?curr_id='+_0x20a9c2+'&period_id='+_0x264de2,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x1a3c8c},'credentials':'include','body':JSON['stringify'](_0x346a4c)});if(!_0x41de61['ok']){const _0x49c3bd=await _0x41de61['json']();throw _0x49c3bd;}return _0x41de61['json']();}catch(_0x18c5da){throw _0x18c5da;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];['state']={};constructor(_0x2d3aea='DataTable',_0x14bc4d){this['name']=_0x2d3aea,this['headers']=_0x14bc4d,this['table']=[],this['validators']=[],this['state']={};}['setDataTable'](_0x2dd689){this['name']=_0x2dd689['name'],this['headers']=_0x2dd689['headers'],this['table']=_0x2dd689['table'],this['state']=_0x2dd689['state'];}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getState'](){return this['state'];}['setState']=async _0x2c1314=>{await this['assertInitialized'](),this['state']=_0x2c1314;};['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'](_0x46911d){await this['assertInitialized'](),this['table']=_0x46911d;}async['initializeTable'](_0x136c67,_0x20e0ca){try{let _0x728f83;if(_0x136c67 instanceof File)_0x728f83=await this['fromXML'](_0x136c67,_0x20e0ca);else _0x728f83=await this['fromCSVString'](_0x136c67);if(!_0x728f83['success']||!_0x728f83['data'])return _0x728f83;if(_0x728f83['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0x728f83['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x4a1045){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x4a1045};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x27404b,_0x53bdc0){const _0x4d215f=await convertToCSVFile(_0x27404b,_0x53bdc0),_0x27d123=await _0x4d215f['text']();return this['fromCSVString'](_0x27d123);}async['searchTable'](_0x31af86){await this['assertInitialized']()['catch'](()=>{return [];});if(!_0x31af86)return [];const _0x3fdd14=[];for(let _0x267d46=0x0;_0x267d46<this['table']['length'];_0x267d46++){const _0x4c2536=this['table'][_0x267d46],_0x19598d=this['searchRow'](_0x4c2536,_0x31af86);for(const _0x640508 of _0x19598d){_0x3fdd14['push']({'row':_0x267d46,'column':_0x640508['column']});}}return _0x3fdd14;}async['validate'](){const _0x522e2f=[],_0x425792=[];try{await this['assertInitialized']()['then'](()=>{_0x522e2f['push']('Table\x20is\x20initialized.');})['catch'](_0x3eaa50=>_0x425792['push'](_0x3eaa50));if(_0x425792['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x522e2f,_0x425792);const {success:_0x363d5e,message:_0x1f09b1,error:_0x31e4b8,data:_0x56155c}=await this['toJson']();if(!_0x56155c)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x522e2f['push'](..._0x56155c['validMsgs']),_0x425792['push'](..._0x56155c['tableErrors']);const {jsonObj:_0x4a82d2}=_0x56155c;for(const _0x4530b8 of this['validators']){await _0x4530b8['validate'](_0x522e2f,_0x425792,this,_0x4a82d2);}let _0x55b099=this['name']+'\x20ran\x20its\x20validations.';if(_0x522e2f['length']>0x0)_0x55b099+='\x20'+_0x522e2f['length']+'\x20validations\x20were\x20successful.';if(_0x425792['length']>0x0)_0x55b099+='\x20'+_0x425792['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x55b099,'data':{'validMsgs':_0x522e2f,'tableErrors':_0x425792}};}catch(_0x16e363){return _0x425792['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x16e363}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x522e2f,'tableErrors':_0x425792}};}}['useValidator'](_0x50ee36){this['validators']['push'](_0x50ee36);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x443a91){this['name']=_0x443a91;}['getName'](){return this['name'];}['report'](_0x3838a0,_0xcc76d,_0x21ba2b){if(_0x3838a0['length']>0x0)_0x21ba2b['push'](..._0x3838a0);else _0xcc76d['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'](_0x470273,_0x29fb84,_0x52459b,_0x255a34){const _0x40a298=[];if(!_0x255a34){_0x29fb84['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x504a17=0x0;_0x504a17<_0x255a34['co']['length'];_0x504a17++){const _0x4f80af=_0x255a34['co'][_0x504a17];if(!_0x4f80af){(await _0x52459b['searchTable'](_0x504a17+0x1+''))['map'](({row:_0xe36424,column:_0x27157e})=>{_0x40a298['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x504a17+0x1)+'.','row':_0xe36424,'column':_0x27157e,'from':this['name']});});continue;}if(!_0x4f80af?.['ilo']){(await _0x52459b['searchTable'](_0x4f80af['statement']))['map'](({row:_0x2e3e95,column:_0x15ce1c})=>{_0x40a298['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x504a17+0x1)+'.','row':_0x2e3e95,'column':_0x15ce1c,'from':this['name']});});continue;}const _0x2c00a0=_0x4f80af['ilo']['length']-0x1,_0x2d76c5=_0x4f80af['ilo'][_0x2c00a0];if(!_0x2d76c5['taxonomy_level']){(await _0x52459b['searchTable'](_0x2d76c5['statement']))['map'](({row:_0x2d8afc,column:_0x50596a})=>{_0x40a298['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x504a17+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x2d8afc,'column':_0x50596a,'from':this['name']});});continue;}if(_0x2d76c5['taxonomy_level']['trim']()['toLowerCase']()!==_0x4f80af['taxonomy_level']['trim']()['toLowerCase']()){(await _0x52459b['searchTable'](_0x2d76c5['statement']))['map'](({row:_0x1eab84,column:_0x3c5d74})=>{_0x40a298['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x504a17+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x2d76c5['taxonomy_level']?.['toUpperCase']()+'\x20!=\x20'+_0x4f80af['taxonomy_level']?.['toUpperCase']()+')','row':_0x1eab84,'column':_0x3c5d74,'from':this['name']});});continue;}}this['report'](_0x40a298,_0x470273,_0x29fb84);}}
|
|
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'](_0x55f81b,_0x368ab5,_0x25a9b2,_0x37b4b2){const _0x418577=[];if(!_0x37b4b2){_0x368ab5['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x4b12bb=0x0;_0x4b12bb<_0x37b4b2['co']['length'];_0x4b12bb++){const _0x37cf53=_0x37b4b2['co'][_0x4b12bb];if(!_0x37cf53['taxonomy_level']){_0x418577['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x4b12bb+0x1),'from':this['name']});continue;}if(!whitelist$1['includes'](_0x37cf53['taxonomy_level']['toLowerCase']())){const {row:_0x3199a0,column:_0x3ae36e}=(await _0x25a9b2['searchTable'](_0x37cf53['statement']))[0x0];_0x3199a0&&_0x418577['push']({'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20APPLYING:\x20'+_0x37cf53['taxonomy_level']['toUpperCase'](),'row':_0x3199a0,'column':_0x3ae36e,'from':this['name']});}}this['report'](_0x418577,_0x55f81b,_0x368ab5);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'](_0x70da74,_0x46bba9,_0x5aab24,_0x48fa90){const _0x286cf6=[];if(!_0x48fa90){_0x46bba9['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x144a18=0x0;_0x144a18<_0x48fa90['co']['length'];_0x144a18++){const _0x982a4d=_0x48fa90['co'][_0x144a18];if(!_0x982a4d){(await _0x5aab24['searchTable'](_0x144a18+0x1+''))['map'](({row:_0x8e3b8a,column:_0x8f8d05})=>{_0x286cf6['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x144a18+0x1)+'.','row':_0x8e3b8a,'column':_0x8f8d05,'from':this['name']});});continue;}if(!_0x982a4d?.['ilo']){(await _0x5aab24['searchTable'](_0x982a4d['statement']))['map'](({row:_0x195216,column:_0x4eb021})=>{_0x286cf6['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x144a18+0x1)+'.','row':_0x195216,'column':_0x4eb021,'from':this['name']});});continue;}const _0x55d7d8=(await _0x5aab24['searchTable'](_0x982a4d['statement']))[0x0]??{'row':-1,'column':-1},_0x53c167=_0x982a4d['ilo']['map'](_0x5d6189=>taxoOrder[_0x5d6189['taxonomy_level']]);let _0x2079c3=_0x53c167[0x0];for(let _0x43fd67=0x1;_0x43fd67<_0x53c167['length'];_0x43fd67++){if(_0x53c167[_0x43fd67]<_0x2079c3){_0x286cf6['push']({'error':'Under\x20CO\x20'+(_0x144a18+0x1)+',\x20ILO\x20'+(_0x43fd67+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x43fd67+'\x27s.','row':_0x55d7d8['row'],'column':_0x55d7d8['column']+_0x43fd67,'from':this['name']});continue;}_0x2079c3=_0x53c167[_0x43fd67];}}this['report'](_0x286cf6,_0x70da74,_0x46bba9);}}
|
|
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'](_0x43c954,_0x13f04c,_0x3201ee,_0x436dac){const {success:_0x236980,data:_0xd8ccd5}=_0x3201ee['getTable'](),_0x5bacf5=[];if(!_0x236980){_0x5bacf5['push']({'error':'Unable\x20to\x20access\x20COAEP\x20table.','from':this['name']});return;}const {table:_0x42dbbc}=_0xd8ccd5;for(let _0x5525a0=0x0;_0x5525a0<_0x42dbbc['length'];_0x5525a0++){const _0x29d115=_0x42dbbc[_0x5525a0],[_0x803783,_0x5125f2]=_0x29d115[0x4];if(!_0x803783)_0x5bacf5['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x5525a0,'column':0x4,'from':this['name']});else _0x803783<minPerfTarget$1&&_0x5bacf5['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget$1+'.','row':_0x5525a0,'column':0x4,'from':this['name']});if(!_0x5125f2)_0x5bacf5['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x5525a0,'column':0x4,'from':this['name']});else _0x5125f2<minPassScore$1&&_0x5bacf5['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore$1+'.','row':_0x5525a0,'column':0x4,'from':this['name']});}this['report'](_0x5bacf5,_0x43c954,_0x13f04c);}}
|
|
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'](_0x14f30e,_0x4c749e){await this['assertInitialized']()['catch'](_0x46f0b8=>{_0x4c749e['push'](_0x46f0b8);return;});const _0x486c55=[];let _0x43353d=null,_0x34adbe=null;for(let _0x20f041=0x0;_0x20f041<this['table']['length'];_0x20f041++){const _0x62de42=[],_0x18ab57=this['table'][_0x20f041],_0x4a95df=_0x18ab57[0x0]||_0x43353d,_0x574a4d=_0x18ab57[0x1]||_0x34adbe,_0x42746f=_0x18ab57[0x2],_0x1db4ca=_0x18ab57[0x3],_0x436bf1=_0x18ab57[0x4];if(!_0x4a95df)_0x62de42['push'](0x0);if(!_0x574a4d)_0x62de42['push'](0x1);if(!_0x42746f)_0x62de42['push'](0x2);if(!_0x1db4ca)_0x62de42['push'](0x3);if(!_0x436bf1)_0x62de42['push'](0x4);if(_0x34adbe!==_0x574a4d)this['validateObjectiveGrammar'](_0x574a4d,_0x20f041,0x1,_0x4c749e);_0x43353d=_0x4a95df,_0x34adbe=_0x574a4d;for(const _0x39edda of _0x62de42){_0x486c55['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x39edda],'row':_0x20f041,'column':_0x39edda});}if(_0x42746f)this['validateObjectiveGrammar'](_0x42746f,_0x20f041,0x2,_0x4c749e);}if(_0x486c55['length']>0x0)_0x4c749e['push'](..._0x486c55);else _0x14f30e['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x5626c2){try{const _0x26eda2=[],_0x751d1=_0x2ee223['parse'](_0x5626c2,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0x14cd6e,coIdx:_0x511618,iloIdx:_0x562483,assessToolIdx:_0x404e91,perfTargetIdx:_0x75287f}=getCoaepHeader(_0x751d1);if(_0x14cd6e===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x751d1['forEach'](_0x48e86a=>{const _0x1877ab=_0x48e86a['indexOf']('Name\x20of\x20Faculty:'),_0x36d903=_0x48e86a['indexOf']('School\x20Year'),_0x3e6157=_0x48e86a['indexOf']('Course:'),_0x51ffb1=_0x48e86a['indexOf']('Semester');_0x1877ab!==-0x1&&(this['state']['faculty']=_0x48e86a[_0x1877ab+0x1]?.['trim']()||this['state']['faculty']);_0x36d903!==-0x1&&(this['state']['sy']=_0x48e86a[_0x36d903+0x1]?.['trim']()||this['state']['sy']);if(_0x3e6157!==-0x1){const _0x218d67=_0x48e86a[_0x3e6157+0x1]?.['trim']()['split']('\x20')[0x0]||'';this['state']['course']=_0x218d67||this['state']['course'];}if(_0x51ffb1!==-0x1){const _0x140412=_0x48e86a[_0x51ffb1+0x1]?.['trim']()||'',_0x5959a5=_0x140412['match'](/\d+/)?.[0x0];this['state']['semester']=_0x5959a5?parseInt(_0x5959a5,0xa):this['state']['semester'];}});for(let _0x8d9a92=0x0;_0x8d9a92<=_0x751d1['length'];_0x8d9a92++){const _0x19cac0=_0x751d1[_0x8d9a92];if(!_0x19cac0)break;if(_0x8d9a92<=_0x14cd6e)continue;if(!_0x19cac0[_0x562483])break;let _0x224686=_0x19cac0[_0x511618-0x1]?.['trim']()||'',_0x1be7bf=_0x19cac0[_0x511618]?.['trim']()||'',_0x22c25d=_0x19cac0[_0x562483]?.['trim']()||'';/^\d+$/['test'](_0x19cac0[_0x511618]?.['trim']()||'')&&(_0x224686=_0x19cac0[_0x511618]?.['trim']()||'',_0x1be7bf=_0x19cac0[_0x511618+0x1]?.['trim']()||'');let _0x58fb27=null;if(_0x1be7bf){const {cognitive_level:_0x57134c,taxonomy_level:_0x1a6168,verb:_0x50340a,rest:_0x39f59c}=extractFromObjective(_0x1be7bf);_0x58fb27=[_0x57134c??DEFAULT_CO_COG_LEVEL,_0x1a6168,_0x50340a,_0x39f59c];}let _0x2ca9cd;{const {cognitive_level:_0x42d7e1,taxonomy_level:_0x30e253,verb:_0x1afbdd,rest:_0x21cdb7}=extractFromObjective(_0x22c25d);_0x2ca9cd=[_0x42d7e1,_0x30e253,_0x1afbdd,_0x21cdb7];}const _0x25851b=_0x19cac0[_0x75287f]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x4c4085,passing_score:_0x5392a5}=performaceTarget(_0x25851b);_0x26eda2['push']([_0x224686,_0x58fb27,_0x2ca9cd,_0x19cac0[_0x404e91]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x4c4085,_0x5392a5]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x26eda2};}catch(_0xdd5e02){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0xdd5e02};}}async['toJson'](){const _0x31f88b=[],_0x39a268=[],_0x9a594f='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x420369={'faculty':this['state']['faculty'],'course':this['state']['course'],'sy':this['state']['sy'],'semester':this['state']['semester'],'co':[]};let _0x146db2=null,_0x377165='',_0x379a8d=[null,null];this['table']['forEach']((_0x5ddf75,_0x15173d)=>{if(_0x15173d===0x0&&!_0x5ddf75[0x1])_0x39a268['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x9a594f});_0x5ddf75[0x1]&&(_0x377165='',_0x379a8d=[null,null]);const _0x277c11=_0x5ddf75[0x1],_0x487199=_0x5ddf75[0x2],_0x55d99e=_0x5ddf75[0x3]||_0x377165,_0x3ededd=_0x5ddf75[0x4]||_0x379a8d;if(!_0x487199)_0x39a268['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x9a594f});if(!_0x55d99e)_0x39a268['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x15173d,'column':0x3,'from':_0x9a594f});if(!_0x3ededd)_0x39a268['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x15173d,'column':0x4,'from':_0x9a594f});if(_0x277c11){const [_0x3c4b83,_0x459b34,_0x4663b2,_0x5521cd]=_0x277c11,_0x3d0184={'statement':_0x5521cd,'ilo':[],'taxonomy_level':_0x459b34,'cognitive_level':_0x3c4b83,'verb':_0x4663b2};_0x146db2=_0x3d0184,_0x420369['co']['push'](_0x3d0184);}const [_0x5dabe7,_0x3ebd1e,_0x3d276a,_0xdf3bbc]=_0x487199,[_0x103091,_0x28f9b7]=_0x3ededd,_0x2feb27={'statement':_0xdf3bbc,'assessment_tool':_0x55d99e,'performance_target':_0x103091,'passing_score':_0x28f9b7,'cognitive_level':_0x5dabe7,'taxonomy_level':_0x3ebd1e,'verb':_0x3d276a};_0x146db2['ilo']['push'](_0x2feb27);});if(_0x39a268['length'])return _0x39a268['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x9a594f}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x420369,'validMsgs':_0x31f88b,'tableErrors':_0x39a268}};return _0x31f88b['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x420369,'validMsgs':_0x31f88b,'tableErrors':_0x39a268}};}catch(_0x4a3cb4){return _0x39a268['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x9a594f}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x4a3cb4,'data':{'jsonObj':null,'tableErrors':_0x39a268}};}}['validateObjectiveGrammar'](_0x1f9c08,_0x581590,_0xe010b7,_0x1d719b){if(!_0x1f9c08){_0x1d719b['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x581590,'column':_0xe010b7,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x11ed01,_0x33a944,_0x5a974b,_0x33c538]=_0x1f9c08,_0x4be6d9=[];if(!_0x11ed01)_0x4be6d9['push']('Cognitive\x20Level');if(!_0x33a944)_0x4be6d9['push']('Taxonomy\x20Level');if(!_0x5a974b)_0x4be6d9['push']('Verb');if(!_0x4be6d9['length'])return;_0x1d719b['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x4be6d9['join'](',\x20')+'.','row':_0x581590,'column':_0xe010b7,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}['searchRow'](_0x2cce3c,_0x10c10f){const _0x58390f=[],[_0x1fec0f,_0xe74eb1,_0x3a2530,_0x1edf56,_0x5d62bb]=_0x2cce3c;if(_0x1fec0f===_0x10c10f)_0x58390f['push']({'column':0x0});if(_0xe74eb1&&(_0xe74eb1[0x0]===_0x10c10f||_0xe74eb1[0x1]===_0x10c10f||_0xe74eb1[0x2]===_0x10c10f||_0xe74eb1[0x3]===_0x10c10f))_0x58390f['push']({'column':0x1});if(_0x3a2530&&(_0x3a2530[0x0]===_0x10c10f||_0x3a2530[0x1]===_0x10c10f||_0x3a2530[0x2]===_0x10c10f||_0x3a2530[0x3]===_0x10c10f))_0x58390f['push']({'column':0x2});if(_0x1edf56===_0x10c10f)_0x58390f['push']({'column':0x3});if(_0x5d62bb&&(_0x5d62bb[0x0]===_0x10c10f||_0x5d62bb[0x1]===_0x10c10f))_0x58390f['push']({'column':0x4});return _0x58390f;}}
|
|
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'](_0x55d2fb,_0x593202,_0x2e7a66,_0x4bd318){const _0x59ed2f=[],{success:_0x2ca56c,data:_0x413eef}=_0x2e7a66['getTable']();if(!_0x2ca56c){_0x593202['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x236ebb}=_0x413eef;for(let _0xee6e35=0x0;_0xee6e35<_0x236ebb['length'];_0xee6e35++){const _0x9e6fbb=_0x236ebb[_0xee6e35],_0x5cf87a=_0x9e6fbb[0x1]?.[0x0];if(!_0x5cf87a)continue;!whitelist['includes'](_0x5cf87a)&&_0x59ed2f['push']({'error':'Cannot\x20have\x20PO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x5cf87a['toUpperCase'](),'row':_0xee6e35,'column':0x1,'from':this['name']});}this['report'](_0x59ed2f,_0x55d2fb,_0x593202);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'](_0x3b670c,_0x4f9ffd,_0x4626c1,_0xe7a429){const _0x53fa8f=[],{success:_0x384719,data:_0x18b8b5}=_0x4626c1['getTable']();if(!_0x384719){_0x4f9ffd['push']({'error':'Unable\x20to\x20access\x20POAEP\x20table.','from':this['name']});return;}const {table:_0x43ae41}=_0x18b8b5;for(let _0x4e73b3=0x0;_0x4e73b3<_0x43ae41['length'];_0x4e73b3++){const _0x21f074=_0x43ae41[_0x4e73b3],[_0x126ff4,_0x1be90a]=_0x21f074[0x5];if(!_0x126ff4)_0x53fa8f['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x4e73b3,'column':0x6,'from':this['name']});else _0x126ff4<minPerfTarget&&_0x53fa8f['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x4e73b3,'column':0x6,'from':this['name']});if(!_0x1be90a)_0x53fa8f['push']({'error':'Passing\x20score\x20is\x20required.','row':_0x4e73b3,'column':0x6,'from':this['name']});else _0x1be90a<minPassScore&&_0x53fa8f['push']({'error':'Passing\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x4e73b3,'column':0x6,'from':this['name']});}this['report'](_0x53fa8f,_0x3b670c,_0x4f9ffd);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'](_0x2224e8){try{const _0x1c6196=[],_0x401e6a=_0x2ee223['parse'](_0x2224e8,{'skipEmptyLines':![]})['data'];_0x401e6a['forEach'](_0x2eae12=>{_0x2eae12['forEach'](_0x404f09=>{_0x404f09['includes']('PROGRAM:')&&(this['state']['program']=_0x404f09['replace']('PROGRAM:','')['trim']()['toUpperCase']());});});const {headerIdx:_0x4f9a0c,poIdx:_0x4abd95,tlIdx:_0x1106ce,piIdx:_0x4f363f,fcIdx:_0xa09cc,scIdx:_0x5d5998,atIdx:_0x928f8b,ptIdx:_0x1a1ed7}=getPoaepHeader(_0x401e6a);if(_0x4f9a0c===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20check\x20the\x20CSV.');let _0x2d3187='',_0x4a67a7='',_0x5c7521='';for(let _0x55dae4=_0x4f9a0c+0x1;_0x55dae4<_0x401e6a['length'];_0x55dae4++){const _0x32c79e=_0x401e6a[_0x55dae4];if(!_0x32c79e)break;if(_0x55dae4<=_0x4f9a0c)continue;let _0x3b19aa=_0x32c79e[_0x4abd95]?.['trim']()||'';if(_0x3b19aa){_0x2d3187='',_0x4a67a7='',_0x5c7521='';const [_0xcbc298,_0x1938fd]=this['extractPoDesc'](_0x3b19aa);if(_0x1938fd)_0x3b19aa=_0x1938fd;}const _0x1d03f4=_0x32c79e[_0x1106ce]?.['trim']()['toLowerCase']()||null,_0x151b57=_0x32c79e[_0x4f363f]?.['trim']()||'',_0x5b6cb1=_0x32c79e[_0xa09cc]?.['trim']()||'',_0x2c1398=_0x32c79e[_0x5d5998]?.['trim']()||_0x2d3187,_0xd04ecf=_0x32c79e[_0x928f8b]?.['trim']()||_0x4a67a7,_0x2147ab=_0x32c79e[_0x1a1ed7]?.['trim']()||_0x5c7521,{performance_target:_0x3e9b6d,passing_score:_0x2d71f4}=performaceTarget(_0x2147ab);let _0x3d0529=null;if(_0x151b57){const {cognitive_level:_0x2fc438,taxonomy_level:_0x152465,verb:_0x340230,rest:_0x3dc08a}=extractFromObjective(_0x151b57);_0x3d0529=[_0x152465??_0x1d03f4,_0x340230,_0x3dc08a];}if(!_0x5b6cb1)break;const _0x59136c=_0x5b6cb1['split'](',')['map'](_0x43a2ec=>_0x43a2ec['trim']());_0x1c6196['push']([_0x3b19aa,_0x3d0529,_0x59136c,_0x2c1398,_0xd04ecf,[_0x3e9b6d,_0x2d71f4]]),_0x2d3187=_0x2c1398,_0x4a67a7=_0xd04ecf,_0x5c7521=_0x2147ab;}if(_0x1c6196['length']===0x0)throw new Error('No\x20data\x20parsed.\x20Please\x20check\x20the\x20CSV.');return {'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':_0x1c6196};}catch(_0x530356){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x530356};}}async['toJson'](){const _0x428ffe=[],_0x85908c=[],_0x5a7af6='POAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x4de784={'po':[]};let _0x5eb851={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x5a09ad=null,_0x515adb=null,_0x304577=null;for(let _0x2da637=0x0;_0x2da637<this['table']['length'];_0x2da637++){const _0x17ddfe=this['table'][_0x2da637],_0x146897=[],_0x1c513b=_0x17ddfe[0x0]?.['trim']()||null;_0x1c513b&&_0x1c513b!==_0x5eb851['po_desc']&&(_0x5eb851={'po_desc':_0x1c513b,'seq_no':_0x5eb851['seq_no']+0x1,'PerfIndicators':[]},_0x4de784['po']['push'](_0x5eb851),_0x5a09ad=null,_0x515adb=null,_0x304577=null);if(_0x5eb851['po_desc']==='')_0x85908c['push']({'error':'Cannot\x20start\x20with\x20empty\x20Program\x20Outcome.','row':_0x2da637,'column':0x0,'from':_0x5a7af6});const _0x4f0633=_0x17ddfe[0x1]||[null,null,null],_0x3af98b=_0x17ddfe[0x2]||null,_0x91d6eb=_0x17ddfe[0x3]||_0x5a09ad,_0x35cfaa=_0x17ddfe[0x4]||_0x515adb,_0x563b56=_0x17ddfe[0x5]||_0x304577;(!_0x3af98b||_0x3af98b['length']===0x0)&&_0x85908c['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x2da637,'column':0x3,'from':_0x5a7af6});!_0x563b56&&_0x85908c['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x2da637,'column':0x6,'from':_0x5a7af6});if(_0x146897['length']>0x0){_0x85908c['push'](..._0x146897);continue;}const _0x4ab3bc={'pi_desc':_0x4f0633[0x2],'FormativeCourses':_0x3af98b['map'](_0x583899=>({'course_id':_0x583899,'cognitive_level':null})),'SummativeCourse':{'course_id':_0x91d6eb},'Verb':_0x4f0633[0x1]?{'label':_0x4f0633[0x1]}:null,'TaxonomyLevel':_0x4f0633[0x0]?{'label':_0x4f0633[0x0]}:null,'AssessmentTool':{'at_desc':_0x35cfaa},'PerformanceTargets':{'target_percent':_0x563b56[0x0],'min_score':_0x563b56[0x1]}};_0x5eb851['PerfIndicators']['push'](_0x4ab3bc);}if(_0x85908c['length']>0x0)return _0x85908c['push']({'error':'Converted\x20POAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x5a7af6}),{'success':!![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x4de784,'validMsgs':_0x428ffe,'tableErrors':_0x85908c}};return _0x428ffe['push']('Successfully\x20converted\x20POAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20POAEP\x20datatable.','data':{'jsonObj':_0x4de784,'validMsgs':_0x428ffe,'tableErrors':_0x85908c}};}catch(_0x51ca7d){return {'success':![],'message':'Error\x20parsing\x20POAEP\x20table','error':_0x51ca7d};}}async['validateFields'](_0x102152,_0x53de26){await this['assertInitialized']()['catch'](_0xd5cf5=>{_0x53de26['push'](_0xd5cf5);return;});const _0x23cbf6=[];let _0x55940d=null,_0x423258=null,_0x462968=null,_0x360428=null;for(let _0x17e3a6=0x0;_0x17e3a6<this['table']['length'];_0x17e3a6++){const _0x5098c5=[],_0x59c5f3=this['table'][_0x17e3a6];_0x59c5f3[0x0]&&_0x59c5f3[0x0]!==_0x55940d&&(_0x423258=null,_0x462968=null,_0x360428=null);const _0x3b60b0=_0x59c5f3[0x0]||_0x55940d,_0x4f7bd1=_0x59c5f3[0x1]||null,_0x39daa5=_0x59c5f3[0x2]||null,_0x4f2d97=_0x59c5f3[0x3]||_0x423258,_0x56cb21=_0x59c5f3[0x4]||_0x462968,_0x3f57c8=_0x59c5f3[0x5]||_0x360428;if(!_0x3b60b0)_0x5098c5['push'](0x0);if(!_0x4f7bd1)_0x5098c5['push'](0x1);if(!_0x39daa5)_0x5098c5['push'](0x2);if(!_0x4f2d97)_0x5098c5['push'](0x3);if(!_0x56cb21)_0x5098c5['push'](0x4);if(!_0x3f57c8)_0x5098c5['push'](0x5);_0x5098c5['length']>0x0&&_0x5098c5['forEach'](_0x1a9e7b=>{_0x23cbf6['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x1a9e7b]+'.','row':_0x17e3a6,'column':_0x1a9e7b,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'});}),_0x39daa5?.['length']===0x0&&_0x23cbf6['push']({'error':'Cannot\x20have\x20empty\x20Formative\x20Courses.','row':_0x17e3a6,'column':0x3,'from':this['name']['toUpperCase']()+'_VALIDATE_FIELDS'}),_0x55940d=_0x3b60b0,_0x423258=_0x4f2d97,_0x462968=_0x56cb21,_0x360428=_0x3f57c8;}if(_0x23cbf6['length']>0x0)_0x53de26['push'](..._0x23cbf6);else _0x102152['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}['extractPoDesc'](_0x39bc5e){const _0x3c8d52=/^.*(PO\d+):(.*)$/,_0x363c88=_0x3c8d52['exec'](_0x39bc5e['trim']());return _0x363c88?_0x363c88['slice'](0x1):['',_0x39bc5e['trim']()];}['searchRow'](_0x10e302,_0x3d0782){const _0x5c3119=[],[_0x50c9ee,_0x21b4cf,_0x272df0,_0x4434c9,_0x151f1d,_0x15b83a]=_0x10e302;if(_0x50c9ee===_0x3d0782)_0x5c3119['push']({'column':0x0});if(_0x21b4cf&&(_0x21b4cf[0x0]===_0x3d0782||_0x21b4cf[0x1]===_0x3d0782||_0x21b4cf[0x2]&&_0x21b4cf[0x2]['includes'](_0x3d0782)))_0x5c3119['push']({'column':0x1});if(_0x272df0&&_0x272df0['includes'](_0x3d0782))_0x5c3119['push']({'column':0x2});if(_0x4434c9===_0x3d0782)_0x5c3119['push']({'column':0x3});if(_0x151f1d===_0x3d0782)_0x5c3119['push']({'column':0x4});if(_0x15b83a&&(_0x15b83a[0x0]===_0x3d0782||_0x15b83a[0x1]===_0x3d0782))_0x5c3119['push']({'column':0x5});return _0x5c3119;}['validateObjectiveGrammar'](_0x21b327,_0x41e038,_0x593091,_0x1bc6af){if(!_0x21b327){_0x1bc6af['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x41e038,'column':_0x593091,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x272b2b,_0x1f2a07,_0x30c63f]=_0x21b327,_0x2c7e05=[];if(!_0x272b2b)_0x2c7e05['push']('Taxonomy\x20Level');if(!_0x1f2a07)_0x2c7e05['push']('Verb');if(!_0x30c63f)_0x2c7e05['push']('Performance\x20Indicator');if(!_0x2c7e05['length'])return;_0x1bc6af['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x2c7e05['join'](',\x20')+'.','row':_0x41e038,'column':_0x593091,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}}
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
const parseAssessmentDataToJson=async _0x572c13=>{try{const _0x5b0575=await convertToCSVFile(_0x572c13),_0x999f43=await _0x5b0575['text'](),_0x1cd4ba=parseAssessmentCsv(_0x999f43),_0x3b96af={'success':!![],'message':'Successfully\x20parsed\x20Assessment\x20Data.','data':_0x1cd4ba};return Promise['resolve'](_0x3b96af);}catch(_0x37bafb){return Promise['reject']({'success':![],'message':'Error\x20parsing\x20Assessment\x20Data.','error':_0x37bafb});}};
|
|
69
|
+
|
|
70
|
+
const parseClassListToJson=async _0x377551=>{try{const _0x4b02a9=await convertToCSVFile(_0x377551),_0xc370dc=await _0x4b02a9['text'](),_0x34f523=parseClassList(_0xc370dc),_0x1a79d2={'success':!![],'message':'Successfully\x20parsed\x20Class\x20List.','data':_0x34f523};return Promise['resolve'](_0x1a79d2);}catch(_0x5bfec8){return Promise['reject']({'success':![],'message':'Error\x20parsing\x20Class\x20List.','error':_0x5bfec8});}};
|
|
71
|
+
|
|
72
|
+
const parseCourseOfferingToJson=async _0x9683a6=>{try{const _0x14f15c=await convertToCSVFile(_0x9683a6),_0x25a2ea=await _0x14f15c['text'](),_0x3a3842=parseCourseOffering(_0x25a2ea),_0x2bf625={'success':!![],'message':'Successfully\x20parsed\x20Course\x20Offering.','data':{'courseOfferings':_0x3a3842}};return Promise['resolve'](_0x2bf625);}catch(_0x8a8cd3){return Promise['reject']({'success':![],'message':'Error\x20parsing\x20Course\x20Offering.','error':_0x8a8cd3});}};
|
|
73
|
+
|
|
74
|
+
const parseCurriculumToJson=async _0x315485=>{try{const _0x5297be=await convertToCSVFile(_0x315485),_0x120f64=await _0x5297be['text'](),_0x60b35d=parseCurriculum(_0x120f64),_0x2efda7={'success':!![],'message':'Successfully\x20parsed\x20Curriculum.','data':{'curriculums':_0x60b35d}};return Promise['resolve'](_0x2efda7);}catch(_0x427a58){return Promise['reject']({'success':![],'message':'Error\x20parsing\x20Curriculum.','error':_0x427a58});}};
|
|
75
|
+
|
|
76
|
+
const parseFullName=_0x3e71cc=>{const _0x598a3c=_0x3e71cc['split']('\x20');let _0x26a3d4,_0x13adc0,_0x4fe194;_0x26a3d4=_0x13adc0=_0x4fe194='',_0x26a3d4=_0x598a3c['shift']();if(_0x598a3c['length']>0x1)_0x4fe194=_0x598a3c['pop']();return _0x13adc0=_0x598a3c['join']('\x20'),{'lastname':_0x26a3d4,'firstname':_0x13adc0,'middlename':_0x4fe194};},mapCategories={'FULL\x20TIME':0x1,'PART\x20TIME\x20A':0x2,'PART\x20TIME\x20B':0x3,'PART\x20TIME\x20C':0x4,'PART\x20TIME\x20D':0x5};const attributeMapping=_0xf0b1f7=>{const {lastname:_0x229bee,firstname:_0x186b56,middlename:_0x2c564d}=parseFullName(_0xf0b1f7['Name']),_0x5458bf={'faculty_id':_0xf0b1f7['Fac\x20ID'],'lastname':_0x229bee,'firstname':_0x186b56,'middlename':_0x2c564d,'faculty_type':mapCategories[_0xf0b1f7['Category']]},_0x4ea4ff={'dept_id':_0xf0b1f7['Dept\x20ID'],'faculty_id':+_0xf0b1f7['Fac\x20ID']},_0x494f22={'username':_0xf0b1f7['Fac\x20ID']['toString']()['padStart'](0x4,'0'),'password':''};return {'faculty':_0x5458bf,'deptFaculty':_0x4ea4ff,'user':_0x494f22};};function parseDeptFaculty(_0x117356){const _0x391417=_0x2ee223['parse'](_0x117356,{'header':!![],'skipEmptyLines':!![]}),_0x5bc84a=[],_0x493bf1=[],_0x336600=[];for(const _0x4a8c85 of _0x391417['data']){const {faculty:_0x4bac03,deptFaculty:_0xca8fa0,user:_0x178b43}=attributeMapping(_0x4a8c85);_0x5bc84a['push'](_0x4bac03),_0x493bf1['push'](_0xca8fa0),_0x336600['push'](_0x178b43);}return {'faculties':_0x5bc84a,'deptFaculties':_0x493bf1,'users':_0x336600};}
|
|
77
|
+
|
|
78
|
+
const parseDeptFacultyToJson=async _0x198275=>{try{const _0x42e0ab=await convertToCSVFile(_0x198275),_0x997756=await _0x42e0ab['text'](),_0x20921e=parseDeptFaculty(_0x997756),_0x3423b5={'success':!![],'message':'Successfully\x20parsed\x20Dept\x20Faculty.','data':{'faculties':_0x20921e['faculties'],'deptFaculties':_0x20921e['deptFaculties'],'users':_0x20921e['users']}};return Promise['resolve'](_0x3423b5);}catch(_0x5d803d){return Promise['reject']({'success':![],'message':'Error\x20parsing\x20Dept\x20Faculty.','error':_0x5d803d});}};
|
|
79
|
+
|
|
80
|
+
const parseEnrolledStudentsToJson=async _0x953adb=>{try{const _0x3dcf55=await convertToCSVFile(_0x953adb),_0x5e4818=new FormData();_0x5e4818['append']('csvFile',_0x3dcf55);const _0x4c1f84={'success':!![],'message':'Successfully\x20parsed\x20Enrolled\x20Students.','data':{'body':_0x5e4818}};return Promise['resolve'](_0x4c1f84);}catch(_0x4256d2){return Promise['reject']({'success':![],'message':'Error\x20parsing\x20Enrolled\x20Students.','error':_0x4256d2});}};
|
|
81
|
+
|
|
82
|
+
class Client{['BASE_URL'];constructor(_0xb510d8){this['BASE_URL']=_0xb510d8;}['Parser'](){return {'curriculum':async _0xb8fad3=>{const _0x22ceb3=await uploadCurriculum(this['BASE_URL'],_0xb8fad3);return _0x22ceb3;},'courseOffering':async _0x2d8b96=>{const _0xecdacb=await uploadCourseOffering(this['BASE_URL'],_0x2d8b96);return _0xecdacb;},'coaep':async(_0x521417,_0x25f66d)=>{const _0x59b46a=await uploadCOAEP(this['BASE_URL'],_0x521417,_0x25f66d);return _0x59b46a;},'enrolledStudent':async _0x3bd1c8=>{const _0x3627c2=await uploadEnrolledStudent(this['BASE_URL'],_0x3bd1c8);return _0x3627c2;},'classlist':async(_0x3b48e2,_0x166249,_0x29c06a)=>{const _0x283f22=await uploadClassList(this['BASE_URL'],_0x3b48e2,_0x166249,_0x29c06a);return _0x283f22;},'assessmentData':async _0x1b311c=>{const _0x56cb40=await uploadAssessmentData(this['BASE_URL'],_0x1b311c);return _0x56cb40;},'deptFaculty':async _0x10e883=>{const _0x511361=await uploadDeptFaculty(this['BASE_URL'],_0x10e883);return _0x511361;},'poaep':async(_0x5b545b,_0x360ced,_0x5514ec,_0x13ae80)=>{const _0x44c134=await uploadPOAEP(this['BASE_URL'],_0x5b545b,_0x360ced,_0x5514ec,_0x13ae80);return _0x44c134;},'CoaepDT':CoaepDT,'PoaepDT':PoaepDT,'parseAssessmentDataToJson':parseAssessmentDataToJson,'parseClassListToJson':parseClassListToJson,'parseCourseOfferingToJson':parseCourseOfferingToJson,'parseCurriculumToJson':parseCurriculumToJson,'parseDeptFacultyToJson':parseDeptFacultyToJson,'parseEnrolledStudentsToJson':parseEnrolledStudentsToJson};}}
|
|
69
83
|
|
|
70
84
|
export { Client as default };
|
package/main.d.ts
CHANGED
|
@@ -28,5 +28,28 @@ export default class Client {
|
|
|
28
28
|
*/
|
|
29
29
|
CoaepDT: typeof CoaepDT;
|
|
30
30
|
PoaepDT: typeof PoaepDT;
|
|
31
|
+
/**
|
|
32
|
+
* Parsing Functions that return payload instead of calling the backend
|
|
33
|
+
*/
|
|
34
|
+
parseAssessmentDataToJson: (xls: File) => Promise<import("./DataTable/types/ParserResult").ParserResult<{
|
|
35
|
+
assessmentData: import("./types/assessmentdata").AssessmentData;
|
|
36
|
+
}>>;
|
|
37
|
+
parseClassListToJson: (xls: File) => Promise<import("./DataTable/types/ParserResult").ParserResult<{
|
|
38
|
+
enrolledCourses: import("./types/classList").classList[];
|
|
39
|
+
}>>;
|
|
40
|
+
parseCourseOfferingToJson: (xls: File) => Promise<import("./DataTable/types/ParserResult").ParserResult<{
|
|
41
|
+
courseOfferings: import("./types/courseOffering").CourseOffering[];
|
|
42
|
+
}>>;
|
|
43
|
+
parseCurriculumToJson: (xls: File) => Promise<import("./DataTable/types/ParserResult").ParserResult<{
|
|
44
|
+
curriculums: import("./types/curriculum").CurriculumCourses[];
|
|
45
|
+
}>>;
|
|
46
|
+
parseDeptFacultyToJson: (xls: File) => Promise<import("./DataTable/types/ParserResult").ParserResult<{
|
|
47
|
+
faculties: any[];
|
|
48
|
+
deptFaculties: any[];
|
|
49
|
+
users: any[];
|
|
50
|
+
}>>;
|
|
51
|
+
parseEnrolledStudentsToJson: (xls: File) => Promise<import("./DataTable/types/ParserResult").ParserResult<{
|
|
52
|
+
body: FormData;
|
|
53
|
+
}>>;
|
|
31
54
|
};
|
|
32
55
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Faculty, DeptFaculty, User } from "../types/deptfaculty";
|
|
2
|
+
export type deptFacultyCsvRow = {
|
|
3
|
+
"Dept ID": string;
|
|
4
|
+
"No.": number;
|
|
5
|
+
"Fac ID": number;
|
|
6
|
+
Name: string;
|
|
7
|
+
"Admin?": string;
|
|
8
|
+
"Designation Title": string;
|
|
9
|
+
Category: string;
|
|
10
|
+
};
|
|
11
|
+
export interface DeptFacultyParseResult {
|
|
12
|
+
faculties: Faculty[];
|
|
13
|
+
deptFaculties: DeptFaculty[];
|
|
14
|
+
users: User[];
|
|
15
|
+
}
|
|
16
|
+
export declare const attributeMapping: (row: deptFacultyCsvRow) => {
|
|
17
|
+
faculty: Faculty;
|
|
18
|
+
deptFaculty: DeptFaculty;
|
|
19
|
+
user: User;
|
|
20
|
+
};
|
|
21
|
+
export declare function parseDeptFaculty(csvData: string): {
|
|
22
|
+
faculties: Faculty[];
|
|
23
|
+
deptFaculties: DeptFaculty[];
|
|
24
|
+
users: User[];
|
|
25
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
2
2
|
/**
|
|
3
|
-
* Parses the department faculty from an Excel file and returns
|
|
3
|
+
* Parses the department faculty from an Excel file and returns three JSON arrays for bulk upload.
|
|
4
4
|
* @param xls - The Department Faculty Template Excel file to parse
|
|
5
|
-
* @returns ParserResult<{
|
|
5
|
+
* @returns ParserResult<{ faculties: Faculty[], deptFaculties: DeptFaculty[], users: User[] }>
|
|
6
6
|
*/
|
|
7
7
|
export declare const parseDeptFacultyToJson: (xls: File) => Promise<ParserResult<{
|
|
8
|
-
|
|
8
|
+
faculties: any[];
|
|
9
|
+
deptFaculties: any[];
|
|
10
|
+
users: any[];
|
|
9
11
|
}>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ParserResult } from "../DataTable/types/ParserResult";
|
|
2
2
|
/**
|
|
3
3
|
* Parses the enrolled students from an Excel file and returns a FormData object of the excel file wrapped in a ParserResult.
|
|
4
|
+
*
|
|
4
5
|
* @param xls - The Enrolled Students Template Excel file to parse
|
|
5
6
|
* @returns ParserResult<{ body: FormData }>
|
|
6
7
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Faculty {
|
|
2
|
+
faculty_id: number;
|
|
3
|
+
lastname: string;
|
|
4
|
+
firstname: string;
|
|
5
|
+
middlename: string;
|
|
6
|
+
faculty_type: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DeptFaculty {
|
|
9
|
+
dept_id: string;
|
|
10
|
+
faculty_id: number;
|
|
11
|
+
}
|
|
12
|
+
export interface User {
|
|
13
|
+
username: string;
|
|
14
|
+
password: string;
|
|
15
|
+
}
|
package/types/poaep.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface PerfIndicator {
|
|
|
11
11
|
pi_desc: string;
|
|
12
12
|
FormativeCourses: PIFormative[];
|
|
13
13
|
SummativeCourse: PISummative;
|
|
14
|
+
Verb: PIVerb | null;
|
|
14
15
|
TaxonomyLevel: PITaxonomyLevel | null;
|
|
15
16
|
AssessmentTool: PIAssessmentTool;
|
|
16
17
|
PerformanceTargets: PIPerfTarget;
|
|
@@ -22,6 +23,9 @@ export interface PIFormative {
|
|
|
22
23
|
export interface PISummative {
|
|
23
24
|
course_id: string;
|
|
24
25
|
}
|
|
26
|
+
export interface PIVerb {
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
25
29
|
export interface PIAssessmentTool {
|
|
26
30
|
at_desc: string;
|
|
27
31
|
}
|