@obe-loms/coms-parser 1.6.5 → 1.6.6
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.
|
@@ -2,13 +2,32 @@ import { COAEP } from "../../types/coaep";
|
|
|
2
2
|
import { DataTable } from "./DataTable";
|
|
3
3
|
import { ParserResult } from "../types/ParserResult";
|
|
4
4
|
import DataTableException from "../types/DataTableException";
|
|
5
|
+
/**
|
|
6
|
+
* Represents a row in the COAEP DataTable.
|
|
7
|
+
*
|
|
8
|
+
* @return row - Represents a full row of the internal table of the COAEP Data Table
|
|
9
|
+
* @return {string|null } row [0] - Co Number, Nullable
|
|
10
|
+
* @return {[string | null, string | null, string | null, string | null] | null} row [1] - [CO Cognitive Level, Taxonomy Level, Verb, Statement], nullable
|
|
11
|
+
* @return {[string | null, string | null, string | null, string | null] | null} row [2] - [ILO Cognitive Level, Taxonomy Level, Verb, Statement]
|
|
12
|
+
* @return {string|null } row [3] - Assessment Tool
|
|
13
|
+
* @return {[number | null, number | null] | null} row [4] - [PerfTarget, PassingScore]
|
|
14
|
+
*/
|
|
5
15
|
export type CoaepRow = [
|
|
6
16
|
string | null,
|
|
7
17
|
// CO No
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
[
|
|
19
|
+
string | null,
|
|
20
|
+
string | null,
|
|
21
|
+
string | null,
|
|
22
|
+
string | null
|
|
23
|
+
] | null,
|
|
24
|
+
[
|
|
25
|
+
string | null,
|
|
26
|
+
string | null,
|
|
27
|
+
string | null,
|
|
28
|
+
string | null
|
|
29
|
+
],
|
|
30
|
+
// ILO Cognitive Level, Taxonomy Level, Verb, Statement
|
|
12
31
|
string | null,
|
|
13
32
|
[
|
|
14
33
|
number | null,
|
|
@@ -36,10 +55,10 @@ export declare class CoaepDT extends DataTable<COAEP, CoaepRow> {
|
|
|
36
55
|
* Local helper function that to validate grammar of a CO/ILO statement.
|
|
37
56
|
* Checks if the statement follows grammar to fetch the fields: cognitive level, taxonomy level, verb
|
|
38
57
|
*
|
|
39
|
-
* @param {string}
|
|
58
|
+
* @param {[null | string, null | string, null | string, null | string] | null} objectiveArr - Array containing the parsed objective statement to validate.
|
|
40
59
|
* @param {number} row - The row of the statement in the table.
|
|
41
60
|
* @param {number} column - The column of the statement in the table.
|
|
42
61
|
* @param {DataTableException[]} tableErrors - The array of error messages to append to.
|
|
43
62
|
*/
|
|
44
|
-
validateObjectiveGrammar(
|
|
63
|
+
validateObjectiveGrammar(objectiveArr: [string | null, string | null, string | null, string | null] | null, row: number, column: number, tableErrors: DataTableException[]): void;
|
|
45
64
|
}
|
package/bundle.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x21af53 from 'papaparse';
|
|
2
|
+
import * as _0x183f75 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x52771e){let _0x14e40b='',_0x573a04='',_0xfd2571=0x0,_0x3aa429=null;const _0x176b72=[];return _0x21af53['parse'](_0x52771e,{'skipEmptyLines':!![],'complete':_0x4d2f54=>{_0x4d2f54['data']['forEach'](_0x119e56=>{const _0x794be0=_0x119e56['map'](_0x1896a5=>(_0x1896a5??'')['toString']()['trim']()),_0x455b34=_0x794be0[0x0]??'';if(_0x455b34['includes']('Rev#')){const _0x3bee3d=_0x455b34['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x3bee3d&&(_0x14e40b=_0x3bee3d[0x1]?.['trim']()??'',_0x573a04=_0x3bee3d[0x2]?.['trim']()??'',_0xfd2571=parseInt(_0x3bee3d[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0x455b34)){_0x3aa429=0x1;return;}if(/SECOND YEAR/i['test'](_0x455b34)){_0x3aa429=0x2;return;}if(/THIRD YEAR/i['test'](_0x455b34)){_0x3aa429=0x3;return;}if(/FOURTH YEAR/i['test'](_0x455b34)){_0x3aa429=0x4;return;}if(/FIFTH YEAR/i['test'](_0x455b34)){_0x3aa429=0x5;return;}if(/First Semester/i['test'](_0x455b34)||/Second Semester/i['test'](_0x455b34)||/Summer/i['test'](_0x455b34))return;const _0x5b05f2=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x5b05f2['forEach'](({sem:_0x306447,offset:_0x216b8c})=>{const _0x1da1b4=_0x794be0[_0x216b8c]??'',_0x2327e5=_0x794be0[_0x216b8c+0x1]??'',_0x4704e8=_0x794be0[_0x216b8c+0x2]??'',_0x5c0304=_0x794be0[_0x216b8c+0x3]??'',_0x3cf233=_0x794be0[_0x216b8c+0x4]??'';_0x1da1b4&&_0x3aa429&&_0x176b72['push']({'curr_id':_0x14e40b,'program_name':_0x573a04,'revision_no':_0xfd2571,'year_level':_0x3aa429,'sem':_0x306447,'course_id':_0x1da1b4,'course_desc':_0x2327e5,'total_units':_0x4704e8,'lec_unit':_0x5c0304,'lab_unit':_0x3cf233});});});}}),_0x176b72;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x2ac32d,_0x569a98){return new Promise((_0xb0b743,_0x3c5b44)=>{const _0x5dc9a8=new FileReader();_0x5dc9a8['onload']=_0x28e160=>{const _0x4a1062=_0x28e160['target']?.['result'];if(!_0x4a1062){_0x3c5b44(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x417dad=_0x183f75['read'](_0x4a1062,{'type':'array'});!_0x569a98&&(_0x569a98=_0x417dad['SheetNames'][0x0]);if(!_0x569a98){_0x3c5b44(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x2bffc1=_0x417dad['Sheets'][_0x569a98];if(!_0x2bffc1){_0x3c5b44(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x367007=_0x183f75['utils']['sheet_to_csv'](_0x2bffc1,{'strip':!![]}),_0x566cb2=_0x2ac32d['name']['replace'](/\.[^/.]+$/,'.csv'),_0x2d3a38=new File([_0x367007],_0x566cb2,{'type':'text/csv','lastModified':Date['now']()});_0xb0b743(_0x2d3a38);}catch(_0x25762e){_0x3c5b44(_0x25762e);}},_0x5dc9a8['onerror']=()=>{_0x3c5b44(new Error('File\x20reading\x20failed'));},_0x5dc9a8['readAsArrayBuffer'](_0x2ac32d);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x5696f1,_0x21cce1){try{const _0x311efb=await convertToCSVFile(_0x21cce1),_0x1fb6cf=await _0x311efb['text'](),_0x4f60f3=parseCurriculum(_0x1fb6cf),_0x289a02=_0x21af53['unparse'](_0x4f60f3),_0x3c85d1=new File([_0x289a02],_0x311efb['name'],{'type':'text/csv'}),_0x148d6a=new FormData();_0x148d6a['append']('csvFile',_0x3c85d1);const _0x4a8aca=await fetch(_0x5696f1+'/curr-courses/upload',{'method':'POST','body':_0x148d6a});if(!_0x4a8aca['ok']){const _0x4a7a53=await _0x4a8aca['json']();throw _0x4a7a53;}return _0x4a8aca['json']();}catch(_0x132e7c){throw _0x132e7c;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x5b8cdb){let _0x2bdf34='',_0x33c706='';const _0x2e6110=[],_0xea9a00=_0x21af53['parse'](_0x5b8cdb,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0xf472fb=_0xea9a00['data'];for(let _0x1e0bd9=0x0;_0x1e0bd9<Math['min'](0x5,_0xf472fb['length']);_0x1e0bd9++){const _0x130159=_0xf472fb[_0x1e0bd9];if(_0x130159&&_0x130159['length']>0x0){const _0x42fefa=_0x130159[0x0]?.['toString']()||'',_0x381262=_0x42fefa['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x381262){_0x2bdf34=_0x381262[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x381262[0x2]){const _0x11ff7e=_0x381262[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x11ff7e&&_0x11ff7e[0x2]&&_0x11ff7e[0x4]&&(_0x33c706=_0x11ff7e[0x2]+_0x11ff7e[0x4]);}}}}let _0x303410=-1;for(let _0x3f6730=0x0;_0x3f6730<_0xf472fb['length'];_0x3f6730++){const _0x2cfe89=_0xf472fb[_0x3f6730];if(_0x2cfe89&&_0x2cfe89['some'](_0x36c39d=>_0x36c39d?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x303410=_0x3f6730;break;}}if(_0x303410===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x2d31d5={'code':'','description':'','unit':0x0};for(let _0x3fce53=_0x303410+0x1;_0x3fce53<_0xf472fb['length'];_0x3fce53++){const _0x598112=_0xf472fb[_0x3fce53];if(!_0x598112||_0x598112['length']<0x8)continue;const _0x259270=_0x598112[0x1]?.['toString']()['trim']()||'',_0x59f512=_0x598112[0x4]?.['toString']()['trim']()||'',_0x37b2f3=_0x598112[0x5]?.['toString']()['trim']()||'',_0x2933cf=_0x598112[0x6]?.['toString']()['trim']()||'',_0x46394f=_0x598112[0x7]?.['toString']()['trim']()||'',_0x1f1d55=_0x598112[0x3]?.['toString']()['trim']()||'';let _0x244819=_0x598112[0x0]?.['toString']()['trim']()||'',_0x5e4f7c=_0x598112[0x2]?.['toString']()['trim']()||'';if(!_0x259270)continue;if(!_0x244819)_0x244819=_0x2d31d5['code'];if(!_0x5e4f7c)_0x5e4f7c=_0x2d31d5['description'];let _0x54b1e5=_0x2d31d5['unit'];if(_0x1f1d55){const _0x2a180b=_0x1f1d55['match'](/(\d+)/);_0x2a180b&&_0x2a180b[0x1]&&(_0x54b1e5=parseInt(_0x2a180b[0x1],0xa));}const _0x37688b={'sem':_0x2bdf34,'school_year':_0x33c706,'code':_0x244819,'course_no':_0x259270,'course_desc':_0x5e4f7c,'unit':_0x54b1e5,'time':_0x59f512,'days':_0x37b2f3,'faculty':_0x2933cf,'room':_0x46394f};_0x2d31d5['code']=_0x244819,_0x2d31d5['description']=_0x5e4f7c,_0x2d31d5['unit']=_0x54b1e5,_0x2e6110['push'](_0x37688b);}return _0x2e6110;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x2ee0c2,_0x5469b1){try{const _0x15c24a=await convertToCSVFile(_0x5469b1),_0x226c65=await _0x15c24a['text'](),_0x3098da=parseCourseOffering(_0x226c65),_0x209e28=_0x21af53['unparse'](_0x3098da),_0x2bdb97=new File([_0x209e28],_0x15c24a['name'],{'type':'text/csv'}),_0x4ebe0b=new FormData();_0x4ebe0b['append']('csvFile',_0x2bdb97);const _0x24a161=await fetch(_0x2ee0c2+'/course-offerings/upload',{'method':'POST','body':_0x4ebe0b});if(!_0x24a161['ok']){const _0x22fe43=await _0x24a161['json']();throw _0x22fe43;}return _0x24a161['json']();}catch(_0x1031ba){throw _0x1031ba;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x3c86d6){if(!_0x3c86d6)return {'performance_target':null,'passing_score':null};const _0x12f1c6=_0x3c86d6['match'](/\d+/g);return {'performance_target':_0x12f1c6?.[0x0]?parseInt(_0x12f1c6[0x0],0xa):null,'passing_score':_0x12f1c6?.[0x1]?parseInt(_0x12f1c6[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(_0x5d61a0){let _0xd34396={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x2aff10=0x0;_0x2aff10<Math['min'](_0x5d61a0['length'],0x14);_0x2aff10++){const _0x3a88fa=(_0x5d61a0[_0x2aff10]??[])['map'](_0x1044c6=>_0x1044c6['toLowerCase']()['trim']()),_0x9c532b=_0x3a88fa['findIndex'](_0x120af=>HEADERS$1['co']['some'](_0x143a94=>_0x120af['includes'](_0x143a94))),_0x47ea54=_0x3a88fa['findIndex'](_0xdc77d1=>HEADERS$1['ilo']['some'](_0x310aac=>_0xdc77d1['includes'](_0x310aac))),_0x194c30=_0x3a88fa['findIndex'](_0x349deb=>HEADERS$1['assessTool']['some'](_0x333491=>_0x349deb['includes'](_0x333491))),_0x33b839=_0x3a88fa['findIndex'](_0x2c5e82=>HEADERS$1['perfTarget']['some'](_0xd4e605=>_0x2c5e82['includes'](_0xd4e605))),_0x4c08c5=[_0x9c532b,_0x47ea54,_0x194c30,_0x33b839]['filter'](_0x5ca0d6=>_0x5ca0d6!==-1)['length'];if(_0x4c08c5>=0x3){_0xd34396={'headerRowIndex':_0x2aff10,'coIdx':_0x9c532b,'iloIdx':_0x47ea54,'assessToolIdx':_0x194c30,'perfTargetIdx':_0x33b839};break;}}return _0xd34396;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x41bb04){const _0x3e805b={'cognitive_level':null,'taxonomy_level':null,'verb':null,'rest':null},_0x38d014=/(?:\(([IED])\))?\s*(\w+)\s*:\s*(.*)/i,_0x3377ba=_0x41bb04['match'](_0x38d014);if(_0x3377ba){if(_0x3377ba[0x1])_0x3e805b['cognitive_level']=_0x3377ba[0x1];if(_0x3377ba[0x2])_0x3e805b['taxonomy_level']=_0x3377ba[0x2]['toLowerCase']();const _0x26739b=_0x3377ba[0x3]?.['trim']();_0x3e805b['rest']=_0x26739b;if(_0x26739b){const _0x3f6e8f=/(?:shall|will)\s+(\w+)/i,_0x483c51=_0x26739b['match'](_0x3f6e8f);_0x483c51?_0x3e805b['verb']=_0x483c51[0x1]['toLowerCase']():_0x3e805b['verb']=_0x26739b['split'](/\s+/)[0x0]['toLowerCase']();}}return _0x3e805b;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x51e9df){const _0x417695=_0x21af53['parse'](_0x51e9df,{'skipEmptyLines':![]})['data'],_0x239582={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x53bea7,coIdx:_0x5793fd,iloIdx:_0x164464,assessToolIdx:_0x16e53b,perfTargetIdx:_0x39a15d}=getCoaepHeader(_0x417695);if(_0x53bea7===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x417695['forEach'](_0x5f1d03=>{const _0x23a906=_0x5f1d03['indexOf']('Name\x20of\x20Faculty:'),_0x49b1b3=_0x5f1d03['indexOf']('School\x20Year'),_0x4e1704=_0x5f1d03['indexOf']('Course:'),_0x27a345=_0x5f1d03['indexOf']('Semester');_0x23a906!==-1&&(_0x239582['COAEP']['faculty']=_0x5f1d03[_0x23a906+0x1]?.['trim']()||_0x239582['COAEP']['faculty']);_0x49b1b3!==-1&&(_0x239582['COAEP']['sy']=_0x5f1d03[_0x49b1b3+0x1]?.['trim']()||_0x239582['COAEP']['sy']);_0x4e1704!==-1&&(_0x239582['COAEP']['course']=_0x5f1d03[_0x4e1704+0x1]?.['trim']()||_0x239582['COAEP']['course']);if(_0x27a345!==-1){const _0x959ee7=_0x5f1d03[_0x27a345+0x1]?.['trim']()||'',_0x3438f7=_0x959ee7['match'](/\d+/)?.[0x0];_0x239582['COAEP']['semester']=_0x3438f7?parseInt(_0x3438f7,0xa):_0x239582['COAEP']['semester'];}});let _0x926af=null;return _0x417695['forEach']((_0x376801,_0x5621c2)=>{if(_0x5621c2<=_0x53bea7)return;let _0x35b250=_0x376801[_0x5793fd-0x1]?.['trim']()||'',_0x42c226=_0x376801[_0x5793fd]?.['trim']()||'';/^\d+$/['test'](_0x376801[_0x5793fd]?.['trim']()||'')&&(_0x35b250=_0x376801[_0x5793fd]?.['trim']()||'',_0x42c226=_0x376801[_0x5793fd+0x1]?.['trim']()||'');const _0x1d3d77=_0x376801[_0x164464]?.['trim']()||'',_0xb49f92=_0x376801[_0x16e53b]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x2b4fc0=_0x376801[_0x39a15d]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x35b250&&/^\d+$/['test'](_0x35b250)){_0x926af&&_0x239582['COAEP']['co']['push'](_0x926af);const _0x3a099e=_0x42c226,{verb:_0x2a648e,cognitive_level:_0x1e5565,taxonomy_level:_0x56fed5}=extractFromObjective(_0x3a099e);if(!_0x2a648e)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x35b250+'\x20is\x20in\x20the\x20correct\x20format.'};_0x926af={'statement':_0x3a099e,'ilo':[],'verb':_0x2a648e,'cognitive_level':_0x1e5565,'taxonomy_level':_0x56fed5};}if(_0x926af&&_0x1d3d77&&_0x2b4fc0){const _0x4223aa=_0x1d3d77['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x4223aa['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x4223aa['length']<0xa)return;let _0x5ca382=_0xb49f92;if(!_0x5ca382&&_0x4223aa['includes'](':')){const _0x25845b=_0x4223aa['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x25845b&&(_0x5ca382=_0x25845b[0x1]?.['trim']()||'');}const {performance_target:_0x1e56b3,passing_score:_0x6206dd}=performaceTarget(_0x2b4fc0),{verb:_0x485f79,cognitive_level:_0x366086,taxonomy_level:_0x54205d}=extractFromObjective(_0x4223aa);_0x926af['ilo']['push']({'statement':_0x4223aa,'assessment_tool':_0x5ca382,'performance_target':_0x1e56b3,'passing_score':_0x6206dd,'verb':_0x485f79,'cognitive_level':_0x366086,'taxonomy_level':_0x54205d});}}),_0x926af&&_0x239582['COAEP']['co']['push'](_0x926af),_0x239582;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x570eff,_0x5a4622,_0x53d01b){try{const _0x3e0ceb=await convertToCSVFile(_0x5a4622),_0x1cc7fb=await _0x3e0ceb['text'](),_0x152be6=parseCOAEP(_0x1cc7fb);console['log'](_0x152be6);const _0x1b1baf=await fetch(_0x570eff+'/coaeps/upload?course_id='+_0x53d01b,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x152be6)});if(!_0x1b1baf['ok']){const _0x46cd8e=await _0x1b1baf['json']();throw _0x46cd8e;}return _0x1b1baf['json']();}catch(_0x26539b){throw _0x26539b;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0x37edfd,_0x5adbf5){try{const _0x7a0461=await convertToCSVFile(_0x5adbf5),_0xc99e33=new FormData();_0xc99e33['append']('csvFile',_0x7a0461);const _0x511cda=await fetch(_0x37edfd+'/enrolled-students/upload',{'method':'POST','body':_0xc99e33});if(!_0x511cda['ok']){const _0x4bdb93=await _0x511cda['json']();throw _0x4bdb93;}return _0x511cda['json']();}catch(_0xd7eca1){throw _0xd7eca1;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x16f2cf){const _0x15f49a=_0x21af53['parse'](_0x16f2cf,{'skipEmptyLines':!![]})['data'];let _0x47e34a='',_0x5175ac='',_0x5eb169='';const _0x20d2b5=[];return _0x15f49a['forEach'](_0x2095fd=>{const _0x3cee39=_0x2095fd['map'](_0x1ac777=>(_0x1ac777??'')['toString']()['trim']()),_0x335f93=_0x3cee39[0x0]??'';if(_0x335f93['startsWith']('Course\x20No:')){const _0x5d4bbb=_0x335f93['replace']('Course\x20No:','')['trim'](),_0x63a3aa=_0x5d4bbb['split'](/\s+/);_0x5eb169=_0x63a3aa[0x0]??'';const [_0x4aec7d,_0x46de63]=(_0x63a3aa[0x1]??'')['split']('-');_0x5175ac=_0x4aec7d??'';const _0x47f7e2=(_0x46de63??'')['match'](/[a-z]$/);_0x47e34a=_0x47f7e2?_0x47f7e2[0x0]:'';}if(/^\d+$/['test'](_0x335f93)){const _0x395a0b=_0x3cee39[0x2]??'';_0x20d2b5['push']({'subj_code':_0x5eb169,'student_no':_0x395a0b,'course_id':_0x5175ac,'section':_0x47e34a});}}),{'enrolledCourses':_0x20d2b5};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x276a0a,_0x19f629,_0xd9d478,_0x5263c7){try{const _0x393b8f=await convertToCSVFile(_0x19f629),_0x25ae02=await _0x393b8f['text'](),_0x3573cb=parseClassList(_0x25ae02),_0x17ee0f='subj_code='+_0xd9d478+'&period_id='+_0x5263c7,_0x5c7c78=await fetch(_0x276a0a+'/enrolled-courses/upload?'+_0x17ee0f,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x3573cb)});if(!_0x5c7c78['ok']){const _0x422a36=await _0x5c7c78['json']();throw _0x422a36;}return _0x5c7c78['json']();}catch(_0xcdfdbd){throw _0xcdfdbd;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x41d145){const {data:_0x403de7}=_0x21af53['parse'](_0x41d145,{'skipEmptyLines':!![]}),_0x4488a4=_0x403de7['filter'](_0x32ef09=>_0x32ef09['length']>0x0),_0x554bc7=_0x4488a4['find'](_0x289f18=>_0x289f18['some'](_0x491cf4=>_0x491cf4?.['includes']('Faculty'))),_0x147d8d=_0x554bc7?_0x554bc7['findIndex'](_0x278b81=>_0x278b81?.['includes']('Faculty')):-1,_0x16f0b9=_0x147d8d!==-1&&_0x554bc7?_0x554bc7[_0x147d8d+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x458b93=_0x4488a4['find'](_0x58a164=>_0x58a164['some'](_0x6c1621=>_0x6c1621?.['includes']('Semester'))),_0x20ce74=_0x458b93?_0x458b93['findIndex'](_0x3058ab=>_0x3058ab?.['includes']('Semester')):-1,_0x25af5f=_0x20ce74!==-1&&_0x458b93?_0x458b93[_0x20ce74+0x2]?.['trim']()??'':'',_0x228dd7=_0x25af5f['includes']('1st')?0x1:_0x25af5f['includes']('2nd')?0x2:0x0,_0x15d7e9=_0x4488a4['find'](_0x503502=>_0x503502['some'](_0x2a27e6=>_0x2a27e6?.['includes']('Course\x20&\x20Sec'))),_0x96e19b=_0x15d7e9?_0x15d7e9['findIndex'](_0x3d57e9=>_0x3d57e9?.['includes']('Course\x20&\x20Sec')):-1,_0x653f8b=_0x96e19b!==-1&&_0x15d7e9?_0x15d7e9[_0x96e19b+0x2]?.['trim']()??'':'';let _0x519b11='',_0x2a9f75='';if(_0x653f8b){const _0x552e4b=_0x653f8b['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x552e4b&&(_0x519b11=_0x552e4b[0x1]??'',_0x552e4b[0x2]&&(_0x2a9f75=_0x552e4b[0x2]['replace'](/^OC/i,'')));}const _0x99a3ab=_0x4488a4['find'](_0x482739=>_0x482739['some'](_0x10d869=>_0x10d869?.['includes']('School\x20Year'))),_0x364f7a=_0x99a3ab?_0x99a3ab['findIndex'](_0xb6966f=>_0xb6966f?.['includes']('School\x20Year')):-1,_0x2faadc=_0x364f7a!==-1&&_0x99a3ab?_0x99a3ab[_0x364f7a+0x2]?.['trim']()??'':'';let _0x4f8b49=0x0;if(_0x2faadc){const _0x206000=_0x2faadc['match'](/(\d{4})-(\d{4})/);if(_0x206000){const _0x21e0ff=(_0x206000[0x1]??'')['slice'](0x2),_0x3cbfc2=(_0x206000[0x2]??'')['slice'](0x2);_0x4f8b49=parseInt(_0x21e0ff+_0x3cbfc2,0xa);}}const _0x808170={'faculty':_0x16f0b9,'course':_0x519b11,'section':_0x2a9f75,'semester':_0x228dd7,'sy':_0x4f8b49},_0x24e5ab=_0x4488a4['findIndex'](_0x532b5c=>_0x532b5c['some'](_0x5f8d24=>_0x5f8d24?.['trim']()==='CO\x20#'));if(_0x24e5ab===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x2d1367=_0x4488a4[_0x24e5ab+0x1];if(!_0x2d1367)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x1e3042={};let _0x57e096=0x1,_0xfc81d7=0x1;for(let _0x26e8db=0x3;_0x26e8db<_0x2d1367['length'];_0x26e8db++){const _0x89b5fc=_0x2d1367[_0x26e8db];if(!_0x89b5fc)continue;const _0x56a82b='co'+_0x57e096;if(!_0x1e3042[_0x56a82b])_0x1e3042[_0x56a82b]=[];_0x1e3042[_0x56a82b]['push']('ilo'+_0xfc81d7),_0xfc81d7++,_0xfc81d7>0x3&&(_0x57e096++,_0xfc81d7=0x1);}const _0x4eef20=_0x4488a4['findIndex'](_0x934a0d=>_0x934a0d['includes']('Name\x20of\x20Students'));if(_0x4eef20===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x8ee1b1=_0x4488a4[_0x4eef20];if(!_0x8ee1b1)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x31aca1=_0x8ee1b1['findIndex'](_0x47a789=>_0x47a789?.['includes']('Name\x20of\x20Students'));if(_0x31aca1===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x3083b4=_0x31aca1+0x2,_0x27edae=[];for(let _0x419b9a=_0x4eef20+0x1;_0x419b9a<_0x4488a4['length'];_0x419b9a++){const _0x3c1d93=_0x4488a4[_0x419b9a];if(!_0x3c1d93)continue;if(_0x3c1d93['some'](_0x4f905a=>_0x4f905a?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x4f905a?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x4f905a?.['toUpperCase']()['includes']('INACTIVE')||_0x4f905a?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x3c1d93[_0x31aca1])continue;const _0x484931=_0x3c1d93[_0x31aca1]['replace'](/"/g,'')['trim'](),_0x3a9c72=_0x3c1d93['slice'](_0x3083b4)['map'](_0x3064e8=>_0x3064e8===null?null:!isNaN(Number(_0x3064e8))?parseFloat(_0x3064e8):0x0);let _0x70a324=0x0;const _0x5cd691={};Object['entries'](_0x1e3042)['forEach'](([_0x1429b5,_0x518b64])=>{const _0x3f5f72={};_0x518b64['forEach'](_0x40a971=>{_0x3f5f72[_0x40a971]=_0x3a9c72[_0x70a324]??0x0,_0x70a324++;}),_0x5cd691[_0x1429b5]={'transmuted_score':_0x3f5f72};}),_0x27edae['push']({'student_name':_0x484931,'coaep':_0x5cd691});}const _0x1777d5=_0x4488a4['find'](_0x1c2f75=>_0x1c2f75['some'](_0x2ed987=>_0x2ed987?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x29e1be=_0x4488a4['find'](_0x297e97=>_0x297e97['some'](_0x146592=>_0x146592?.['includes']('AVERAGE'))),_0x3ad5b3=_0x1777d5?_0x1777d5['slice'](_0x3083b4)['map'](_0x19dd8e=>_0x19dd8e&&!isNaN(Number(_0x19dd8e))?parseInt(_0x19dd8e):0x0):[],_0x78a68c=_0x29e1be?_0x29e1be['slice'](_0x3083b4)['map'](_0x35ab2b=>_0x35ab2b&&_0x35ab2b!=='#DIV/0!'&&!isNaN(Number(_0x35ab2b))?parseInt(_0x35ab2b):0x0):[],_0x5b3d6c={};let _0x57adeb=0x0;return Object['entries'](_0x1e3042)['forEach'](([_0x53a485,_0x33cc98])=>{if(!_0x5b3d6c[_0x53a485])_0x5b3d6c[_0x53a485]={};_0x33cc98['forEach'](_0x19aba9=>{_0x5b3d6c[_0x53a485][_0x19aba9]={'achievedMinimum':_0x3ad5b3[_0x57adeb]??0x0,'average':_0x78a68c[_0x57adeb]??0x0},_0x57adeb++;});}),{'assessmentData':{'classAssignment':_0x808170,'student':_0x27edae,'total':_0x5b3d6c}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x11b32d,_0x136270){try{const _0x1750dc=await convertToCSVFile(_0x136270),_0x2345a8=await _0x1750dc['text'](),_0x31574a=parseAssessmentCsv(_0x2345a8),_0xe331a3=await fetch(_0x11b32d+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x31574a)});if(!_0xe331a3['ok']){const _0xfe8d9e=await _0xe331a3['json']();throw _0xfe8d9e;}return _0xe331a3['json']();}catch(_0x2c7abf){throw _0x2c7abf;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0x485df5,_0x497f27){try{const _0xc9efd0=await convertToCSVFile(_0x497f27),_0x4682a3=new FormData();_0x4682a3['append']('csvFile',_0xc9efd0);const _0x355776=await fetch(_0x485df5+'/dept-faculties/upload',{'method':'POST','body':_0x4682a3});if(!_0x355776['ok']){const _0x3663c0=await _0x355776['json']();throw _0x3663c0;}return _0x355776['json']();}catch(_0x28f5ce){throw _0x28f5ce;}}
|
|
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(_0x1f5a94){let _0x392f61={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x55ffe0=0x0;_0x55ffe0<Math['min'](_0x1f5a94['length'],0x14);_0x55ffe0++){const _0x46cbdc=(_0x1f5a94[_0x55ffe0]??[])['map'](_0x388965=>_0x388965['toLowerCase']()['trim']()),_0x136878=_0x46cbdc['findIndex'](_0x34cf46=>HEADERS['po']['some'](_0xb4ac49=>_0x34cf46['toLowerCase']()['includes'](_0xb4ac49))),_0x2972c0=_0x46cbdc['findIndex'](_0x3fee3f=>HEADERS['tl']['some'](_0x5c63ab=>_0x3fee3f['toLowerCase']()['includes'](_0x5c63ab))),_0x1a2b6e=_0x46cbdc['findIndex'](_0x54f717=>HEADERS['pi']['some'](_0x1e3786=>_0x54f717['toLowerCase']()['includes'](_0x1e3786))),_0x4e04e0=_0x46cbdc['findIndex'](_0x28859a=>HEADERS['fc']['some'](_0x2fc02d=>_0x28859a['toLowerCase']()['includes'](_0x2fc02d))),_0x322837=_0x46cbdc['findIndex'](_0x19be7f=>HEADERS['sc']['some'](_0x489889=>_0x19be7f['toLowerCase']()['includes'](_0x489889))),_0x58f470=_0x46cbdc['findIndex'](_0x140e8b=>HEADERS['at']['some'](_0x3c0a06=>_0x140e8b['toLowerCase']()['includes'](_0x3c0a06))),_0x4968a0=_0x46cbdc['findIndex'](_0x2d7767=>HEADERS['pt']['some'](_0x3fa531=>_0x2d7767['toLowerCase']()['includes'](_0x3fa531))),_0xf4de2b=[_0x136878,_0x2972c0,_0x1a2b6e,_0x4e04e0,_0x322837,_0x58f470,_0x4968a0]['filter'](_0x21927c=>_0x21927c!==-1)['length'];if(_0xf4de2b>=0x3){_0x392f61={'headerIdx':_0x55ffe0,'poIdx':_0x136878,'tlIdx':_0x2972c0,'piIdx':_0x1a2b6e,'fcIdx':_0x4e04e0,'scIdx':_0x322837,'atIdx':_0x58f470,'ptIdx':_0x4968a0};break;}}if(_0x392f61['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x392f61;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x2d4d4f=>{let _0x2ef607=_0x2d4d4f['split'](',')['reduce']((_0xb4f077,_0x4739c3)=>{const _0x5d039e=_0x4739c3['trim']();if(_0x5d039e)_0xb4f077['push'](_0x5d039e);return _0xb4f077;},[]);return _0x2ef607;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0x354c2f=>{try{const _0x29ea40=_0x21af53['parse'](_0x354c2f,{'skipEmptyLines':![]})['data'],{headerIdx:_0x1509d9,poIdx:_0x597423,tlIdx:_0x2d5526,piIdx:_0x476b1c,fcIdx:_0x147572,scIdx:_0x22f0a3,atIdx:_0x4ef345,ptIdx:_0x58fc07}=getPoaepHeader(_0x29ea40),_0x8ba89a=[];let _0x2d1645={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0x5128a2='',_0x4729b2='',_0x174a13='';for(let _0x173aa9=_0x1509d9+0x1;_0x173aa9<_0x29ea40['length'];_0x173aa9++){const _0x5ae256=_0x29ea40[_0x173aa9];if(!_0x5ae256)break;const _0x46e191=_0x5ae256[_0x597423]?.['trim']()||'';_0x46e191!==''&&(_0x2d1645={'po_desc':_0x46e191,'seq_no':_0x2d1645['seq_no']+0x1,'PerfIndicators':[]},_0x8ba89a['push'](_0x2d1645),_0x5128a2='',_0x4729b2='',_0x174a13='');if(_0x2d1645['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x173aa9+'.');const _0xacf30=_0x5ae256[_0x476b1c]?.['trim']()||'';if(_0xacf30==='')break;const _0x5f18ef=_0x5ae256[_0x147572]?.['trim']()||'';if(_0x5f18ef==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x173aa9+'.');const _0x4e93e8=_0x5ae256[_0x22f0a3]?.['trim']()||_0x5128a2;if(_0x4e93e8==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x173aa9+'.');_0x5128a2=_0x4e93e8;const _0x2265f2=_0x5ae256[_0x4ef345]?.['trim']()||_0x4729b2;if(_0x2265f2==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x173aa9+'.');_0x4729b2=_0x2265f2;const _0x32a576=_0x5ae256[_0x58fc07]?.['trim']()||_0x174a13;if(_0x32a576==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x173aa9+'.');_0x174a13=_0x32a576;const _0x528d93=parseFormativeCourses(_0x5f18ef);if(_0x528d93['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x173aa9+'.');const _0x13b577=performaceTarget(_0x32a576);if(!_0x13b577['performance_target']||!_0x13b577['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x173aa9+'.');const _0x345106={'pi_desc':_0xacf30,'FormativeCourses':_0x528d93['map'](_0x5d199c=>({'course_id':_0x5d199c,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x4e93e8},'AssessmentTool':{'at_desc':_0x2265f2},'PerformanceTargets':{'target_percent':_0x13b577['performance_target'],'min_score':_0x13b577['passing_score']}};_0x2d1645['PerfIndicators']['push'](_0x345106);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x8ba89a}};}catch(_0xb9866b){return {'success':![],'error':_0xb9866b instanceof Error?_0xb9866b['message']:_0xb9866b,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x175329,_0x34d0d9,_0x31bb0d,_0x5d65d2,_0x2a2db5){try{const _0x8bce21=await convertToCSVFile(_0x34d0d9),_0x101f5e=await _0x8bce21['text'](),_0x16cbdb=parsePOAEP(_0x101f5e),_0x36a13d=await fetch(_0x175329+'/program-outcomes/poaep/upload?curr_id='+_0x5d65d2+'&period_id='+_0x2a2db5,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x31bb0d},'credentials':'include','body':JSON['stringify'](_0x16cbdb)});if(!_0x36a13d['ok']){const _0x44261d=await _0x36a13d['json']();throw _0x44261d;}return _0x36a13d['json']();}catch(_0x3ec31c){throw _0x3ec31c;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['headers'];['table'];['validators']=[];constructor(
|
|
44
|
+
class DataTable{['name'];['headers'];['table'];['validators']=[];constructor(_0x4e584d='DataTable',_0x2e158d){this['name']=_0x4e584d,this['headers']=_0x2e158d,this['table']=[],this['validators']=[];}['getName'](){return this['name'];}['getHeaders'](){return this['headers'];}['getTable'](){if(this['table']['length']===0x0)return {'success':![],'message':'Datatable\x20is\x20unset.'};return {'success':!![],'message':'Successfully\x20fetched\x20datatable.','data':{'name':this['name'],'headers':this['headers'],'table':this['table']}};}async['setTable'](_0x24b73f){await this['assertInitialized']();}async['initializeTable'](_0xbd9e36,_0x49262f){try{let _0xaf536c;if(_0xbd9e36 instanceof File)_0xaf536c=await this['fromXML'](_0xbd9e36,_0x49262f);else _0xaf536c=await this['fromCSVString'](_0xbd9e36);if(!_0xaf536c['success']||!_0xaf536c['data'])return _0xaf536c;if(_0xaf536c['data']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');return this['table']=_0xaf536c['data'],{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x1b56ad){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x1b56ad};}}async['assertInitialized'](){if(this['table']['length']===0x0)Promise['reject']({'error':this['name']+'\x20is\x20unset.','from':this['name']['toUpperCase']()+'_ASSERT_INIT'});}async['fromXML'](_0x5d647d,_0x5e6d60){const _0x1d915e=await convertToCSVFile(_0x5d647d,_0x5e6d60),_0x500117=await _0x1d915e['text']();return this['fromCSVString'](_0x500117);}async['findValue'](_0x33cb33){let [_0x2098fc,_0x14e79f]=[-1,-1];if(!_0x33cb33)return {'row':_0x2098fc,'column':_0x14e79f};for(let _0x49dace=0x0;_0x49dace<this['table']['length'];_0x49dace++){const _0x35feea=this['table'][_0x49dace];for(let _0x3c031c=0x0;_0x3c031c<_0x35feea['length'];_0x3c031c++){if(typeof _0x33cb33==='string'){if(_0x35feea[_0x3c031c]===_0x33cb33)return {'row':_0x49dace,'column':_0x3c031c};}else {if(_0x35feea[_0x3c031c]){if(_0x35feea[_0x3c031c]===_0x33cb33)return {'row':_0x49dace,'column':_0x3c031c};}}}}return {'row':_0x2098fc,'column':_0x14e79f};}async['validate'](){const _0x266289=[],_0x21ed66=[];try{await this['assertInitialized']()['then'](()=>{_0x266289['push']('Table\x20is\x20initialized.');})['catch'](_0x355903=>_0x21ed66['push'](_0x355903));if(_0x21ed66['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x266289,_0x21ed66);const {success:_0x54884d,message:_0x1f7bf2,error:_0x5e408f,data:_0x41947a}=await this['toJson']();if(!_0x41947a)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x266289['push'](..._0x41947a['validMsgs']),_0x21ed66['push'](..._0x41947a['tableErrors']);const {jsonObj:_0x5505db}=_0x41947a;for(const _0x443077 of this['validators']){await _0x443077['validate'](_0x266289,_0x21ed66,this,_0x5505db);}let _0x5180a7=this['name']+'\x20ran\x20its\x20validations.';if(_0x266289['length']>0x0)_0x5180a7+='\x20'+_0x266289['length']+'\x20validations\x20were\x20successful.';if(_0x21ed66['length']>0x0)_0x5180a7+='\x20'+_0x21ed66['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x5180a7,'data':{'validMsgs':_0x266289,'tableErrors':_0x21ed66}};}catch(_0x5a5d44){return _0x21ed66['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x5a5d44}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x266289,'tableErrors':_0x21ed66}};}}['useValidator'](_0x39b75d){this['validators']['push'](_0x39b75d);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x2ccfb0){this['name']=_0x2ccfb0;}['getName'](){return this['name'];}['report'](_0x5c26b8,_0x2faf2b,_0x5881b8){if(_0x5c26b8['length']>0x0)_0x5881b8['push'](..._0x5c26b8);else _0x2faf2b['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'](_0x57cfce,_0x54bb80,_0x339072,_0xc582c4){const _0x40f622=[];if(!_0xc582c4){_0x54bb80['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x7bb3c0=0x0;_0x7bb3c0<_0xc582c4['co']['length'];_0x7bb3c0++){const _0x494903=_0xc582c4['co'][_0x7bb3c0];if(!_0x494903){const {row:_0x154040,column:_0x170044}=await _0x339072['findValue'](_0x7bb3c0+0x1+'');_0x40f622['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x7bb3c0+0x1)+'.','row':_0x154040,'column':_0x170044+0x1,'from':this['name']});continue;}if(!_0x494903?.['ilo']){const {row:_0x1e7992,column:_0x1b3b97}=await _0x339072['findValue'](_0x494903['statement']);_0x40f622['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x7bb3c0+0x1)+'.','row':_0x1e7992,'column':_0x1b3b97,'from':this['name']});continue;}const _0x226ef0=_0x494903['ilo']['length']-0x1,_0x4e7f73=_0x494903['ilo'][_0x226ef0];if(!_0x4e7f73['taxonomy_level']){const {row:_0x57ac09,column:_0x4e93da}=await _0x339072['findValue'](_0x4e7f73['statement']);_0x40f622['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x7bb3c0+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x57ac09,'column':_0x4e93da,'from':this['name']});continue;}if(_0x4e7f73['taxonomy_level']!==_0x494903['taxonomy_level']){const {row:_0x4bab65,column:_0x55e45c}=await _0x339072['findValue'](_0x4e7f73['statement']);_0x40f622['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x7bb3c0+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x4e7f73['taxonomy_level']+'\x20!==\x20'+_0x494903['taxonomy_level']+')','row':_0x4bab65,'column':_0x55e45c,'from':this['name']});}}this['report'](_0x40f622,_0x57cfce,_0x54bb80);}}
|
|
49
49
|
|
|
50
|
-
const whitelist=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](
|
|
50
|
+
const whitelist=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](_0x577999,_0x1011f6,_0x8c86ee,_0x575a93){const _0x225228=[];if(!_0x575a93){_0x1011f6['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x56dc9d=0x0;_0x56dc9d<_0x575a93['co']['length'];_0x56dc9d++){const _0x312a2b=_0x575a93['co'][_0x56dc9d];if(!_0x312a2b['taxonomy_level']){_0x225228['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x56dc9d+0x1),'from':this['name']});continue;}if(!whitelist['includes'](_0x312a2b['taxonomy_level'])){const {row:_0x2f40a0,column:_0x56120a}=await _0x8c86ee['findValue'](_0x312a2b['statement']);let _0x157ea4={'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x312a2b['taxonomy_level']['toUpperCase'](),'from':this['name']};(_0x2f40a0!==-1||_0x56120a!==-1)&&(_0x157ea4['row']=_0x2f40a0,_0x157ea4['column']=_0x56120a),_0x225228['push'](_0x157ea4);}}this['report'](_0x225228,_0x577999,_0x1011f6);return;}}
|
|
51
51
|
|
|
52
|
-
const taxoOrder={'remembering':0x1,'understanding':0x2,'applying':0x3,'analyzing':0x4,'evaluating':0x5,'creating':0x6};class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](
|
|
52
|
+
const taxoOrder={'remembering':0x1,'understanding':0x2,'applying':0x3,'analyzing':0x4,'evaluating':0x5,'creating':0x6};class ILOTaxoOrder extends DTValidator{constructor(){super('ILO_TAXO_ORDER');}async['validate'](_0x2b31e6,_0x372aab,_0x3c61a3,_0x3f27fa){const _0x45d71c=[];if(!_0x3f27fa){_0x372aab['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x87536c=0x0;_0x87536c<_0x3f27fa['co']['length'];_0x87536c++){const _0x8ff340=_0x3f27fa['co'][_0x87536c];if(!_0x8ff340){const {row:_0x51a523,column:_0x1bc3c6}=await _0x3c61a3['findValue'](_0x87536c+0x1+'');_0x45d71c['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x87536c+0x1)+'.','row':_0x51a523,'column':_0x1bc3c6+0x1,'from':this['name']});continue;}if(!_0x8ff340?.['ilo']){const {row:_0x2d0ee7,column:_0x12d079}=await _0x3c61a3['findValue'](_0x8ff340['statement']);_0x45d71c['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x87536c+0x1)+'.','row':_0x2d0ee7,'column':_0x12d079,'from':this['name']});continue;}const _0x37691c=await _0x3c61a3['findValue'](_0x8ff340['ilo'][0x0]['statement']),_0x35e324=_0x8ff340['ilo']['map'](_0x119932=>taxoOrder[_0x119932['taxonomy_level']]);let _0x547504=_0x35e324[0x0];for(let _0x2cc972=0x1;_0x2cc972<_0x35e324['length'];_0x2cc972++){if(_0x35e324[_0x2cc972]<_0x547504){_0x45d71c['push']({'error':'Under\x20CO\x20'+(_0x87536c+0x1)+',\x20ILO\x20'+(_0x2cc972+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x2cc972+'\x27s.','row':_0x37691c['row'],'column':_0x37691c['column']+_0x2cc972,'from':this['name']});continue;}_0x547504=_0x35e324[_0x2cc972];}}this['report'](_0x45d71c,_0x2b31e6,_0x372aab);}}
|
|
53
53
|
|
|
54
|
-
const minPerfTarget=0x32,minPassScore=0x32;class MinPerfTarget extends DTValidator{constructor(){super('MIN_PERF_TARGET');}async['validate'](
|
|
54
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPerfTarget extends DTValidator{constructor(){super('MIN_PERF_TARGET');}async['validate'](_0x15146e,_0x1e97b3,_0x557a40,_0x5865c2){const {success:_0x3e936d,data:_0x4a0835}=_0x557a40['getTable'](),_0x5ccf59=[];if(!_0x3e936d){_0x5ccf59['push']({'error':'Failed\x20to\x20access\x20table\x20data.','from':this['name']});return;}const {table:_0x17a246}=_0x4a0835;for(let _0x208458=0x0;_0x208458<_0x17a246['length'];_0x208458++){const _0x35bbf7=_0x17a246[_0x208458],[_0x45fa7a,_0x400d37]=_0x35bbf7[0x4];if(!_0x45fa7a)_0x5ccf59['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x208458,'column':0x4,'from':this['name']});else _0x45fa7a<minPerfTarget&&_0x5ccf59['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x208458,'column':0x4,'from':this['name']});if(!_0x400d37)_0x5ccf59['push']({'error':'Pass\x20score\x20is\x20required.','row':_0x208458,'column':0x6,'from':this['name']});else _0x400d37<minPassScore&&_0x5ccf59['push']({'error':'Pass\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x208458,'column':0x6,'from':this['name']});}this['report'](_0x5ccf59,_0x15146e,_0x1e97b3);}}
|
|
55
55
|
|
|
56
|
-
class CoaepDT extends DataTable{['faculty']=null;['course']=null;['sy']=null;['semester']=null;constructor(){super('CoaepDT',['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target']),this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](
|
|
56
|
+
class CoaepDT extends DataTable{['faculty']=null;['course']=null;['sy']=null;['semester']=null;constructor(){super('CoaepDT',['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target']),this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](_0x4f1700,_0x5ec9eb){const _0x43c470=[];let _0x486682=null,_0x124ee9=null;for(let _0x4f32e1=0x0;_0x4f32e1<this['table']['length'];_0x4f32e1++){const _0x68441=[],_0x182745=this['table'][_0x4f32e1],_0x2aa979=_0x182745[0x0]||_0x486682,_0x58a52a=_0x182745[0x1]||_0x124ee9,_0xd962a0=_0x182745[0x2],_0x473130=_0x182745[0x3],_0x3a1ad1=_0x182745[0x4];if(!_0x2aa979)_0x68441['push'](0x0);if(!_0x124ee9)_0x68441['push'](0x1);if(!_0xd962a0)_0x68441['push'](0x2);if(!_0x473130)_0x68441['push'](0x3);if(!_0x3a1ad1)_0x68441['push'](0x4);if(_0x124ee9!==_0x58a52a)this['validateObjectiveGrammar'](_0x58a52a,_0x4f32e1,0x1,_0x5ec9eb);_0x486682=_0x2aa979,_0x124ee9=_0x58a52a;for(const _0xa6d4c2 of _0x68441){_0x43c470['push']({'error':'Missing\x20field:\x20'+this['headers'][_0xa6d4c2],'row':_0x4f32e1,'column':_0xa6d4c2});}if(_0xd962a0)this['validateObjectiveGrammar'](_0xd962a0,_0x4f32e1,0x2,_0x5ec9eb);}if(_0x43c470['length']>0x0)_0x5ec9eb['push'](..._0x43c470);else _0x4f1700['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x22f570){try{const _0x52f17f=[],_0x5bf4ce=_0x21af53['parse'](_0x22f570,{'skipEmptyLines':![]})['data'],{headerRowIndex:_0xca3fa4,coIdx:_0x5c79f4,iloIdx:_0x2fa920,assessToolIdx:_0x37dc7c,perfTargetIdx:_0x389ca2}=getCoaepHeader(_0x5bf4ce);if(_0xca3fa4===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x5bf4ce['forEach'](_0x1d0141=>{const _0x260436=_0x1d0141['indexOf']('Name\x20of\x20Faculty:'),_0x3576b0=_0x1d0141['indexOf']('School\x20Year'),_0x98b716=_0x1d0141['indexOf']('Course:'),_0x51d88c=_0x1d0141['indexOf']('Semester');_0x260436!==-0x1&&(this['faculty']=_0x1d0141[_0x260436+0x1]?.['trim']()||this['faculty']);_0x3576b0!==-0x1&&(this['sy']=_0x1d0141[_0x3576b0+0x1]?.['trim']()||this['sy']);_0x98b716!==-0x1&&(this['course']=_0x1d0141[_0x98b716+0x1]?.['trim']()||this['course']);if(_0x51d88c!==-0x1){const _0x2a7c71=_0x1d0141[_0x51d88c+0x1]?.['trim']()||'',_0xeeb6f2=_0x2a7c71['match'](/\d+/)?.[0x0];this['semester']=_0xeeb6f2?parseInt(_0xeeb6f2,0xa):this['semester'];}});for(let _0x1a0a8b=0x0;_0x1a0a8b<=_0x5bf4ce['length'];_0x1a0a8b++){const _0xb7ecad=_0x5bf4ce[_0x1a0a8b];if(!_0xb7ecad)break;if(_0x1a0a8b<=_0xca3fa4)continue;if(!_0xb7ecad[_0x2fa920])break;let _0xe88c85=_0xb7ecad[_0x5c79f4-0x1]?.['trim']()||'',_0x28b2ac=_0xb7ecad[_0x5c79f4]?.['trim']()||'',_0x42fc40=_0xb7ecad[_0x2fa920]?.['trim']()||'';/^\d+$/['test'](_0xb7ecad[_0x5c79f4]?.['trim']()||'')&&(_0xe88c85=_0xb7ecad[_0x5c79f4]?.['trim']()||'',_0x28b2ac=_0xb7ecad[_0x5c79f4+0x1]?.['trim']()||'');let _0x36b158=null;if(_0x28b2ac){const {cognitive_level:_0x53f001,taxonomy_level:_0x4fa117,verb:_0x46f6b9,rest:_0x4fba17}=extractFromObjective(_0x28b2ac);_0x36b158=[_0x53f001,_0x4fa117,_0x46f6b9,_0x4fba17];}let _0x1173b4;{const {cognitive_level:_0x434059,taxonomy_level:_0xffe5a0,verb:_0x4fa5ee,rest:_0x52fee5}=extractFromObjective(_0x42fc40);_0x1173b4=[_0x434059,_0xffe5a0,_0x4fa5ee,_0x52fee5];}const _0x58ba47=_0xb7ecad[_0x389ca2]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x2a4be4,passing_score:_0x15afc0}=performaceTarget(_0x58ba47);_0x52f17f['push']([_0xe88c85,_0x36b158,_0x1173b4,_0xb7ecad[_0x37dc7c]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x2a4be4,_0x15afc0]]);}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x52f17f};}catch(_0x53db05){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x53db05};}}async['toJson'](){const _0x40a2d8=[],_0x295a44=[],_0x213d51='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x1a12c7={'faculty':this['faculty'],'course':this['course'],'sy':this['sy'],'semester':this['semester'],'co':[]};let _0x1f1cce=null,_0x9eb953='',_0x1fa654=[null,null];this['table']['forEach']((_0x2edb46,_0x101d96)=>{if(_0x101d96===0x0&&!_0x2edb46[0x1])_0x295a44['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x213d51});_0x2edb46[0x1]&&(_0x9eb953='',_0x1fa654=[null,null]);const _0x25a953=_0x2edb46[0x1],_0x312009=_0x2edb46[0x2],_0x14476b=_0x2edb46[0x3]||_0x9eb953,_0x4f5201=_0x2edb46[0x4]||_0x1fa654;if(!_0x312009)_0x295a44['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x213d51});if(!_0x14476b)_0x295a44['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x101d96,'column':0x3,'from':_0x213d51});if(!_0x4f5201)_0x295a44['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x101d96,'column':0x4,'from':_0x213d51});if(_0x25a953){const [_0x3e3ab6,_0x172043,_0xfa9544,_0x28cc7c]=_0x25a953,_0x1f9ec7={'statement':_0x28cc7c,'ilo':[],'taxonomy_level':_0x172043,'cognitive_level':_0x3e3ab6,'verb':_0xfa9544};_0x1f1cce=_0x1f9ec7,_0x1a12c7['co']['push'](_0x1f9ec7);}const [_0x3f8a1b,_0x537de1,_0x54978a,_0xdd6c1c]=_0x312009,[_0x3b589f,_0x269a14]=_0x4f5201,_0x1d3240={'statement':_0xdd6c1c,'assessment_tool':_0x14476b,'performance_target':_0x3b589f,'passing_score':_0x269a14,'cognitive_level':_0x3f8a1b,'taxonomy_level':_0x537de1,'verb':_0x54978a};_0x1f1cce['ilo']['push'](_0x1d3240);});if(_0x295a44['length'])return _0x295a44['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x213d51}),{'success':![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x1a12c7,'validMsgs':_0x40a2d8,'tableErrors':_0x295a44}};return _0x40a2d8['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x1a12c7,'validMsgs':_0x40a2d8,'tableErrors':_0x295a44}};}catch(_0x11d5e0){return _0x295a44['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x213d51}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x11d5e0,'data':{'jsonObj':null,'tableErrors':_0x295a44}};}}['validateObjectiveGrammar'](_0x1eaca5,_0x81a4a5,_0x201afa,_0x34c756){if(!_0x1eaca5){_0x34c756['push']({'error':'Cannot\x20find\x20objective\x20statement.','row':_0x81a4a5,'column':_0x201afa,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});return;}const [_0x129c44,_0x2b0547,_0x3b5a39,_0x4b5850]=_0x1eaca5,_0x5f658e=[];if(!_0x129c44)_0x5f658e['push']('cognitive_level');if(!_0x2b0547)_0x5f658e['push']('taxonomy_level');if(!_0x3b5a39)_0x5f658e['push']('verb');if(!_0x5f658e['length'])return;_0x34c756['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x5f658e['join'](',\x20')+'.','row':_0x81a4a5,'column':_0x201afa,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}}
|
|
57
57
|
|
|
58
|
-
class Client{['BASE_URL'];constructor(
|
|
58
|
+
class Client{['BASE_URL'];constructor(_0x2df35d){this['BASE_URL']=_0x2df35d;}['Parser'](){return {'curriculum':async _0x737621=>{const _0x47afb8=await uploadCurriculum(this['BASE_URL'],_0x737621);return _0x47afb8;},'courseOffering':async _0x34efdf=>{const _0x157821=await uploadCourseOffering(this['BASE_URL'],_0x34efdf);return _0x157821;},'coaep':async(_0x35e02f,_0x5a6888)=>{const _0xba3e7=await uploadCOAEP(this['BASE_URL'],_0x35e02f,_0x5a6888);return _0xba3e7;},'enrolledStudent':async _0x11c0c3=>{const _0xf68d81=await uploadEnrolledStudent(this['BASE_URL'],_0x11c0c3);return _0xf68d81;},'classlist':async(_0x18f8a4,_0x4d4efb,_0x5187b6)=>{const _0x1fec25=await uploadClassList(this['BASE_URL'],_0x18f8a4,_0x4d4efb,_0x5187b6);return _0x1fec25;},'assessmentData':async _0xd0e41d=>{const _0x48fbf9=await uploadAssessmentData(this['BASE_URL'],_0xd0e41d);return _0x48fbf9;},'deptFaculty':async _0x23b1f1=>{const _0x1ea803=await uploadDeptFaculty(this['BASE_URL'],_0x23b1f1);return _0x1ea803;},'poaep':async(_0x74c6ec,_0x375f07,_0x41e1c5,_0xc39920)=>{const _0x4b902d=await uploadPOAEP(this['BASE_URL'],_0x74c6ec,_0x375f07,_0x41e1c5,_0xc39920);return _0x4b902d;},'CoaepDT':CoaepDT};}}
|
|
59
59
|
|
|
60
60
|
export { Client as default };
|