@obe-loms/coms-parser 1.6.1 → 1.6.3
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/CoaepDT.d.ts +3 -2
- package/DataTable/models/DataTable.d.ts +21 -16
- package/DataTable/models/PoaepDT.d.ts +20 -0
- package/DataTable/models/validators/coaep/MinPerfTarget.d.ts +8 -0
- package/bundle.js +31 -29
- package/package.json +1 -1
- package/test/poaep/poaepDataTable.test.d.ts +1 -0
- package/types/Taxonomy.d.ts +2 -0
- package/types/poaep.d.ts +3 -0
|
@@ -2,7 +2,8 @@ import { COAEP } from "../../types/coaep";
|
|
|
2
2
|
import { DataTable, DataTableInfo } from "./DataTable";
|
|
3
3
|
import { ParserResult } from "../types/ParserResult";
|
|
4
4
|
import DataTableException from "../types/DataTableException";
|
|
5
|
-
export
|
|
5
|
+
export type CoaepDTCellType = null | string | (number | null)[];
|
|
6
|
+
export declare class CoaepDT extends DataTable<COAEP, CoaepDTCellType> {
|
|
6
7
|
faculty: string | null;
|
|
7
8
|
course: string | null;
|
|
8
9
|
sy: string | null;
|
|
@@ -13,7 +14,7 @@ export declare class CoaepDT extends DataTable<COAEP> {
|
|
|
13
14
|
*/
|
|
14
15
|
constructor();
|
|
15
16
|
validateFields(validMsgs: string[], tableErrors: DataTableException[]): Promise<void>;
|
|
16
|
-
fromCSVString(csvString: string): Promise<ParserResult<DataTableInfo
|
|
17
|
+
fromCSVString(csvString: string): Promise<ParserResult<DataTableInfo<CoaepDTCellType>>>;
|
|
17
18
|
toJson(): Promise<ParserResult<{
|
|
18
19
|
jsonObj: COAEP | null;
|
|
19
20
|
validMsgs: string[];
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { ParserResult } from "../types/ParserResult";
|
|
2
2
|
import DataTableException from "../types/DataTableException";
|
|
3
3
|
import { DTValidator } from "./DTValidator";
|
|
4
|
-
export type
|
|
4
|
+
export type DefaultCellType = string | null;
|
|
5
|
+
export type DataTableInfo<U> = {
|
|
5
6
|
name: string;
|
|
6
|
-
table:
|
|
7
|
+
table: U[][];
|
|
7
8
|
headers: string[];
|
|
8
9
|
};
|
|
9
|
-
export declare abstract class DataTable<T> {
|
|
10
|
+
export declare abstract class DataTable<T, U = DefaultCellType> {
|
|
10
11
|
protected name: string;
|
|
11
|
-
protected table:
|
|
12
|
+
protected table: U[][];
|
|
12
13
|
protected headers: string[];
|
|
13
14
|
protected validators: DTValidator<this, T>[];
|
|
14
15
|
/**
|
|
15
16
|
* Creates a new DataTable, initializes default values.
|
|
16
17
|
* If no name is given, the name defaults to "DataTable".
|
|
17
18
|
*
|
|
19
|
+
* @template T - The type of the DataTable JSON output.
|
|
20
|
+
* @template U - The type of the inner table cells.
|
|
21
|
+
*
|
|
18
22
|
* @param {string} _name - The name of the DataTable. Defaults to "DataTable".
|
|
19
23
|
*/
|
|
20
24
|
constructor(_name?: string);
|
|
@@ -32,7 +36,7 @@ export declare abstract class DataTable<T> {
|
|
|
32
36
|
* Gets the DataTable from the current object.
|
|
33
37
|
* @returns ParserResult<DataTableInfo>
|
|
34
38
|
*/
|
|
35
|
-
getTable(): ParserResult<DataTableInfo
|
|
39
|
+
getTable(): ParserResult<DataTableInfo<U>>;
|
|
36
40
|
/**
|
|
37
41
|
* Sets the DataTable from a given table.
|
|
38
42
|
* Asserts first if the DataTable is initialized,
|
|
@@ -41,7 +45,7 @@ export declare abstract class DataTable<T> {
|
|
|
41
45
|
* @param table - Internal table of type (string | null)[][].
|
|
42
46
|
* @returns A Promise that resolves when the table has been set.
|
|
43
47
|
*/
|
|
44
|
-
setTable(table:
|
|
48
|
+
setTable(table: U[][]): Promise<void>;
|
|
45
49
|
/**
|
|
46
50
|
* Populates the internal table from a given File or CSV string.
|
|
47
51
|
*
|
|
@@ -51,7 +55,7 @@ export declare abstract class DataTable<T> {
|
|
|
51
55
|
* @param {File | string} data - The File or CSV string to initialize the DataTable from.
|
|
52
56
|
* @returns A Promise that resolves to a ParserResult.
|
|
53
57
|
*/
|
|
54
|
-
initializeTable(data: File | string): Promise<ParserResult
|
|
58
|
+
initializeTable(data: File | string): Promise<ParserResult<DataTableInfo<U>>>;
|
|
55
59
|
/**
|
|
56
60
|
* Asserts that the DataTable has been initialized.
|
|
57
61
|
* If not, it throws a DataTableException.
|
|
@@ -66,7 +70,7 @@ export declare abstract class DataTable<T> {
|
|
|
66
70
|
* @param csvString - The CSV string to parse.
|
|
67
71
|
* @returns A Promise that resolves to a ParserResult when the parsing is complete.
|
|
68
72
|
*/
|
|
69
|
-
abstract fromCSVString(csvString: string): Promise<ParserResult<DataTableInfo
|
|
73
|
+
abstract fromCSVString(csvString: string): Promise<ParserResult<DataTableInfo<U>>>;
|
|
70
74
|
/**
|
|
71
75
|
* Converts the DataTable to its JSON representation.
|
|
72
76
|
* The method will run all validators on the DataTable before conversion.
|
|
@@ -88,7 +92,7 @@ export declare abstract class DataTable<T> {
|
|
|
88
92
|
* @param sheetName - Optional sheetname to set the DataTable from. Defaults to 1st sheet.
|
|
89
93
|
* @returns A Promise that resolves to a ParserResult when the DataTable is set.
|
|
90
94
|
*/
|
|
91
|
-
fromXML(xls: File, sheetName?: string): Promise<ParserResult<DataTableInfo
|
|
95
|
+
fromXML(xls: File, sheetName?: string): Promise<ParserResult<DataTableInfo<U>>>;
|
|
92
96
|
/**
|
|
93
97
|
* Finds the row and column index of a given string in the DataTable.
|
|
94
98
|
*
|
|
@@ -101,6 +105,7 @@ export declare abstract class DataTable<T> {
|
|
|
101
105
|
}>;
|
|
102
106
|
/**
|
|
103
107
|
* Runs all validators on the DataTable.
|
|
108
|
+
* By default runs the validations of the validateFields and toJson methods.
|
|
104
109
|
* If any validator fails, it will append the error message to the tableErrors array.
|
|
105
110
|
* If all validators pass, it will append the successful validation messages to the validMsgs array.
|
|
106
111
|
*
|
|
@@ -111,13 +116,6 @@ export declare abstract class DataTable<T> {
|
|
|
111
116
|
validMsgs: string[];
|
|
112
117
|
tableErrors: DataTableException[];
|
|
113
118
|
}>>;
|
|
114
|
-
/**
|
|
115
|
-
* Adds a validator to the DataTable.
|
|
116
|
-
* This validator will be called when the validate method is called.
|
|
117
|
-
*
|
|
118
|
-
* @param validator - The validator to add to the DataTable.
|
|
119
|
-
*/
|
|
120
|
-
useValidator(validator: DTValidator<this, T>): void;
|
|
121
119
|
/**
|
|
122
120
|
* Validates all fields in the DataTable.
|
|
123
121
|
*
|
|
@@ -126,4 +124,11 @@ export declare abstract class DataTable<T> {
|
|
|
126
124
|
* @returns {Promise<void>} - A promise that resolves when the validation is complete.
|
|
127
125
|
*/
|
|
128
126
|
abstract validateFields(validMsgs: string[], tableErrors: DataTableException[]): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Adds a custom validator to the DataTable.
|
|
129
|
+
* This validator will be called when the validate method is called.
|
|
130
|
+
*
|
|
131
|
+
* @param validator - The validator to add to the DataTable.
|
|
132
|
+
*/
|
|
133
|
+
useValidator(validator: DTValidator<this, T>): void;
|
|
129
134
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { POAEP } from "../../types/poaep";
|
|
2
|
+
import DataTableException from "../types/DataTableException";
|
|
3
|
+
import ParserResult from "../types/ParserResult";
|
|
4
|
+
import { DataTable, DataTableInfo } from "./DataTable";
|
|
5
|
+
type CellType = null | string | (string | number | null)[];
|
|
6
|
+
export declare class PoaepDT extends DataTable<POAEP, CellType> {
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the DataTable for POAEP
|
|
9
|
+
* Also sets up custom validators for the DataTable
|
|
10
|
+
*/
|
|
11
|
+
constructor();
|
|
12
|
+
fromCSVString(csvString: string): Promise<ParserResult<DataTableInfo<CellType>>>;
|
|
13
|
+
toJson(): Promise<ParserResult<{
|
|
14
|
+
jsonObj: POAEP | null;
|
|
15
|
+
validMsgs: string[];
|
|
16
|
+
tableErrors: DataTableException[];
|
|
17
|
+
}>>;
|
|
18
|
+
validateFields(validMsgs: string[], tableErrors: DataTableException[]): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { COAEP } from "../../../../types/coaep";
|
|
2
|
+
import DataTableException from "../../../types/DataTableException";
|
|
3
|
+
import { CoaepDT } from "../../CoaepDT";
|
|
4
|
+
import { DTValidator } from "../../DTValidator";
|
|
5
|
+
export declare class MinPerfTarget extends DTValidator<CoaepDT, COAEP> {
|
|
6
|
+
constructor();
|
|
7
|
+
validate(validMsgs: string[], tableErrors: DataTableException[], coaepDT: CoaepDT, coaepObj: COAEP | null): Promise<void>;
|
|
8
|
+
}
|
package/bundle.js
CHANGED
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import _0x5084af from 'papaparse';
|
|
2
|
+
import * as _0x3eec61 from 'xlsx';
|
|
3
3
|
|
|
4
|
-
function parseCurriculum(
|
|
4
|
+
function parseCurriculum(_0x4d1c33){let _0x384931='',_0x130eae='',_0x51400f=0x0,_0xeedfb5=null;const _0xf24785=[];return _0x5084af['parse'](_0x4d1c33,{'skipEmptyLines':!![],'complete':_0x1e9f7d=>{_0x1e9f7d['data']['forEach'](_0x55be75=>{const _0x18c7d1=_0x55be75['map'](_0x2ad793=>(_0x2ad793??'')['toString']()['trim']()),_0xb4a65c=_0x18c7d1[0x0]??'';if(_0xb4a65c['includes']('Rev#')){const _0x2f9582=_0xb4a65c['match'](/([A-Z0-9]+)\s*-\s*.*:\s*(.*?)\s+Rev#\s*(\d+)/i);_0x2f9582&&(_0x384931=_0x2f9582[0x1]?.['trim']()??'',_0x130eae=_0x2f9582[0x2]?.['trim']()??'',_0x51400f=parseInt(_0x2f9582[0x3]??'0',0xa));return;}if(/FIRST YEAR/i['test'](_0xb4a65c)){_0xeedfb5=0x1;return;}if(/SECOND YEAR/i['test'](_0xb4a65c)){_0xeedfb5=0x2;return;}if(/THIRD YEAR/i['test'](_0xb4a65c)){_0xeedfb5=0x3;return;}if(/FOURTH YEAR/i['test'](_0xb4a65c)){_0xeedfb5=0x4;return;}if(/FIFTH YEAR/i['test'](_0xb4a65c)){_0xeedfb5=0x5;return;}if(/First Semester/i['test'](_0xb4a65c)||/Second Semester/i['test'](_0xb4a65c)||/Summer/i['test'](_0xb4a65c))return;const _0x411ada=[{'sem':0x1,'offset':0x0},{'sem':0x2,'offset':0x6},{'sem':0x3,'offset':0xc}];_0x411ada['forEach'](({sem:_0x5de49d,offset:_0x4c9b1b})=>{const _0xb81082=_0x18c7d1[_0x4c9b1b]??'',_0x106170=_0x18c7d1[_0x4c9b1b+0x1]??'',_0x2d22e7=_0x18c7d1[_0x4c9b1b+0x2]??'',_0x57a40f=_0x18c7d1[_0x4c9b1b+0x3]??'',_0x56480e=_0x18c7d1[_0x4c9b1b+0x4]??'';_0xb81082&&_0xeedfb5&&_0xf24785['push']({'curr_id':_0x384931,'program_name':_0x130eae,'revision_no':_0x51400f,'year_level':_0xeedfb5,'sem':_0x5de49d,'course_id':_0xb81082,'course_desc':_0x106170,'total_units':_0x2d22e7,'lec_unit':_0x57a40f,'lab_unit':_0x56480e});});});}}),_0xf24785;}
|
|
5
5
|
|
|
6
|
-
function convertToCSVFile(
|
|
6
|
+
function convertToCSVFile(_0x1bae0d,_0x51df03){return new Promise((_0x5b69e5,_0x2ce5a2)=>{const _0x2664cd=new FileReader();_0x2664cd['onload']=_0x28fb30=>{const _0x584b18=_0x28fb30['target']?.['result'];if(!_0x584b18){_0x2ce5a2(new Error('Failed\x20to\x20read\x20file'));return;}try{const _0x13fd3b=_0x3eec61['read'](_0x584b18,{'type':'array'});!_0x51df03&&(_0x51df03=_0x13fd3b['SheetNames'][0x0]);if(!_0x51df03){_0x2ce5a2(new Error('No\x20sheets\x20found\x20in\x20workbook'));return;}const _0x31c393=_0x13fd3b['Sheets'][_0x51df03];if(!_0x31c393){_0x2ce5a2(new Error('No\x20sheets\x20found\x20in\x20worksheet'));return;}const _0x3ebca0=_0x3eec61['utils']['sheet_to_csv'](_0x31c393,{'strip':!![]}),_0x1d0198=_0x1bae0d['name']['replace'](/\.[^/.]+$/,'.csv'),_0x1ee11b=new File([_0x3ebca0],_0x1d0198,{'type':'text/csv','lastModified':Date['now']()});_0x5b69e5(_0x1ee11b);}catch(_0x536d98){_0x2ce5a2(_0x536d98);}},_0x2664cd['onerror']=()=>{_0x2ce5a2(new Error('File\x20reading\x20failed'));},_0x2664cd['readAsArrayBuffer'](_0x1bae0d);});}
|
|
7
7
|
|
|
8
|
-
async function uploadCurriculum(
|
|
8
|
+
async function uploadCurriculum(_0x50ac86,_0x2235f3){try{const _0x3b90e7=await convertToCSVFile(_0x2235f3),_0x166c13=await _0x3b90e7['text'](),_0x415cc3=parseCurriculum(_0x166c13),_0x4a29e1=_0x5084af['unparse'](_0x415cc3),_0x5a9628=new File([_0x4a29e1],_0x3b90e7['name'],{'type':'text/csv'}),_0x54cd64=new FormData();_0x54cd64['append']('csvFile',_0x5a9628);const _0x41a7ad=await fetch(_0x50ac86+'/curr-courses/upload',{'method':'POST','body':_0x54cd64});if(!_0x41a7ad['ok']){const _0x32ec70=await _0x41a7ad['json']();throw _0x32ec70;}return _0x41a7ad['json']();}catch(_0x409ec8){throw _0x409ec8;}}
|
|
9
9
|
|
|
10
|
-
function parseCourseOffering(
|
|
10
|
+
function parseCourseOffering(_0x344041){let _0x21b53c='',_0x1d0633='';const _0x1cabba=[],_0x496958=_0x5084af['parse'](_0x344041,{'header':![],'skipEmptyLines':!![],'delimiter':','}),_0x54d419=_0x496958['data'];for(let _0x3373c7=0x0;_0x3373c7<Math['min'](0x5,_0x54d419['length']);_0x3373c7++){const _0x5b99ca=_0x54d419[_0x3373c7];if(_0x5b99ca&&_0x5b99ca['length']>0x0){const _0x38b3bd=_0x5b99ca[0x0]?.['toString']()||'',_0x27bdba=_0x38b3bd['match'](/(First|Second)\s+Sem\s+S\/Y\s+(\d{4}-\d{4})/i);if(_0x27bdba){_0x21b53c=_0x27bdba[0x1]?.['toLowerCase']()==='first'?'1':'2';if(_0x27bdba[0x2]){const _0x2d0394=_0x27bdba[0x2]['match'](/(\d{2})(\d{2})-(\d{2})(\d{2})/);_0x2d0394&&_0x2d0394[0x2]&&_0x2d0394[0x4]&&(_0x1d0633=_0x2d0394[0x2]+_0x2d0394[0x4]);}}}}let _0x22b277=-1;for(let _0x44c1ee=0x0;_0x44c1ee<_0x54d419['length'];_0x44c1ee++){const _0xd59eb7=_0x54d419[_0x44c1ee];if(_0xd59eb7&&_0xd59eb7['some'](_0x5e6f32=>_0x5e6f32?.['toString']()['toUpperCase']()['includes']('CODE'))){_0x22b277=_0x44c1ee;break;}}if(_0x22b277===-1)throw new Error('Could\x20not\x20find\x20header\x20row\x20in\x20CSV\x20data');let _0x569ebb={'code':'','description':'','unit':0x0};for(let _0x35d85a=_0x22b277+0x1;_0x35d85a<_0x54d419['length'];_0x35d85a++){const _0x539d21=_0x54d419[_0x35d85a];if(!_0x539d21||_0x539d21['length']<0x8)continue;const _0x5c8fbe=_0x539d21[0x1]?.['toString']()['trim']()||'',_0x341f87=_0x539d21[0x4]?.['toString']()['trim']()||'',_0x3c41d1=_0x539d21[0x5]?.['toString']()['trim']()||'',_0x3e358f=_0x539d21[0x6]?.['toString']()['trim']()||'',_0x2b7c9a=_0x539d21[0x7]?.['toString']()['trim']()||'',_0x3673b3=_0x539d21[0x3]?.['toString']()['trim']()||'';let _0x2ec956=_0x539d21[0x0]?.['toString']()['trim']()||'',_0x9c3d7a=_0x539d21[0x2]?.['toString']()['trim']()||'';if(!_0x5c8fbe)continue;if(!_0x2ec956)_0x2ec956=_0x569ebb['code'];if(!_0x9c3d7a)_0x9c3d7a=_0x569ebb['description'];let _0xcf2f1c=_0x569ebb['unit'];if(_0x3673b3){const _0x4df361=_0x3673b3['match'](/(\d+)/);_0x4df361&&_0x4df361[0x1]&&(_0xcf2f1c=parseInt(_0x4df361[0x1],0xa));}const _0x87e7e3={'sem':_0x21b53c,'school_year':_0x1d0633,'code':_0x2ec956,'course_no':_0x5c8fbe,'course_desc':_0x9c3d7a,'unit':_0xcf2f1c,'time':_0x341f87,'days':_0x3c41d1,'faculty':_0x3e358f,'room':_0x2b7c9a};_0x569ebb['code']=_0x2ec956,_0x569ebb['description']=_0x9c3d7a,_0x569ebb['unit']=_0xcf2f1c,_0x1cabba['push'](_0x87e7e3);}return _0x1cabba;}
|
|
11
11
|
|
|
12
|
-
async function uploadCourseOffering(
|
|
12
|
+
async function uploadCourseOffering(_0x441368,_0x43d64f){try{const _0x2ca68a=await convertToCSVFile(_0x43d64f),_0x19a713=await _0x2ca68a['text'](),_0x48ac74=parseCourseOffering(_0x19a713),_0x2955b0=_0x5084af['unparse'](_0x48ac74),_0x5dc851=new File([_0x2955b0],_0x2ca68a['name'],{'type':'text/csv'}),_0x13f002=new FormData();_0x13f002['append']('csvFile',_0x5dc851);const _0x1be852=await fetch(_0x441368+'/course-offerings/upload',{'method':'POST','body':_0x13f002});if(!_0x1be852['ok']){const _0x10d746=await _0x1be852['json']();throw _0x10d746;}return _0x1be852['json']();}catch(_0x35fb7c){throw _0x35fb7c;}}
|
|
13
13
|
|
|
14
|
-
function performaceTarget(
|
|
14
|
+
function performaceTarget(_0x3d0a17){if(!_0x3d0a17)return {'performance_target':null,'passing_score':null};const _0x4f1aff=_0x3d0a17['match'](/\d+/g);return {'performance_target':_0x4f1aff?.[0x0]?parseInt(_0x4f1aff[0x0],0xa):null,'passing_score':_0x4f1aff?.[0x1]?parseInt(_0x4f1aff[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(_0x52cd06){let _0x2b4769={'headerRowIndex':-1,'coIdx':-1,'iloIdx':-1,'assessToolIdx':-1,'perfTargetIdx':-1};for(let _0x3cbbd0=0x0;_0x3cbbd0<Math['min'](_0x52cd06['length'],0x14);_0x3cbbd0++){const _0x3615fe=(_0x52cd06[_0x3cbbd0]??[])['map'](_0x40b9=>_0x40b9['toLowerCase']()['trim']()),_0x42694d=_0x3615fe['findIndex'](_0x429a91=>HEADERS$1['co']['some'](_0x44d29e=>_0x429a91['includes'](_0x44d29e))),_0x180a94=_0x3615fe['findIndex'](_0x3f409b=>HEADERS$1['ilo']['some'](_0x3632fa=>_0x3f409b['includes'](_0x3632fa))),_0xb2b320=_0x3615fe['findIndex'](_0x3744e3=>HEADERS$1['assessTool']['some'](_0x138797=>_0x3744e3['includes'](_0x138797))),_0x1d837c=_0x3615fe['findIndex'](_0x2a3ba6=>HEADERS$1['perfTarget']['some'](_0x43f3d5=>_0x2a3ba6['includes'](_0x43f3d5))),_0x9b2524=[_0x42694d,_0x180a94,_0xb2b320,_0x1d837c]['filter'](_0x1d098d=>_0x1d098d!==-1)['length'];if(_0x9b2524>=0x3){_0x2b4769={'headerRowIndex':_0x3cbbd0,'coIdx':_0x42694d,'iloIdx':_0x180a94,'assessToolIdx':_0xb2b320,'perfTargetIdx':_0x1d837c};break;}}return _0x2b4769;}
|
|
17
17
|
|
|
18
|
-
function extractFromObjective(
|
|
18
|
+
function extractFromObjective(_0x51c11f){const _0x320c03={'cognitive_level':null,'taxonomy_level':null,'verb':null},_0x2a276b=/(?:\(([IED])\))?\s*(\w+)\s*:\s*(.*)/i,_0x489b0f=_0x51c11f['match'](_0x2a276b);if(_0x489b0f){if(_0x489b0f[0x1])_0x320c03['cognitive_level']=_0x489b0f[0x1];if(_0x489b0f[0x2])_0x320c03['taxonomy_level']=_0x489b0f[0x2]['toLowerCase']();const _0x46c083=_0x489b0f[0x3]?.['trim']();if(_0x46c083){const _0x1785d5=/(?:shall|will)\s+(\w+)/i,_0xca736c=_0x46c083['match'](_0x1785d5);_0xca736c?_0x320c03['verb']=_0xca736c[0x1]['toLowerCase']():_0x320c03['verb']=_0x46c083['split'](/\s+/)[0x0]['toLowerCase']();}}return _0x320c03;}
|
|
19
19
|
|
|
20
|
-
function parseCOAEP(
|
|
20
|
+
function parseCOAEP(_0x378d76){const _0x31cd5f=_0x5084af['parse'](_0x378d76,{'skipEmptyLines':![]})['data'],_0x2124ac={'COAEP':{'faculty':null,'course':null,'sy':null,'semester':null,'co':[]}},{headerRowIndex:_0x138ea7,coIdx:_0x4ee632,iloIdx:_0x992a3f,assessToolIdx:_0x4afddb,perfTargetIdx:_0x23e467}=getCoaepHeader(_0x31cd5f);if(_0x138ea7===-1)return {'error':'Could\x20not\x20auto-detect\x20header\x20row.','message':'Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.'};_0x31cd5f['forEach'](_0x5d81b7=>{const _0xca7ace=_0x5d81b7['indexOf']('Name\x20of\x20Faculty:'),_0x5d01a0=_0x5d81b7['indexOf']('School\x20Year'),_0x4de3ee=_0x5d81b7['indexOf']('Course:'),_0x3edda1=_0x5d81b7['indexOf']('Semester');_0xca7ace!==-1&&(_0x2124ac['COAEP']['faculty']=_0x5d81b7[_0xca7ace+0x1]?.['trim']()||_0x2124ac['COAEP']['faculty']);_0x5d01a0!==-1&&(_0x2124ac['COAEP']['sy']=_0x5d81b7[_0x5d01a0+0x1]?.['trim']()||_0x2124ac['COAEP']['sy']);_0x4de3ee!==-1&&(_0x2124ac['COAEP']['course']=_0x5d81b7[_0x4de3ee+0x1]?.['trim']()||_0x2124ac['COAEP']['course']);if(_0x3edda1!==-1){const _0x282c2b=_0x5d81b7[_0x3edda1+0x1]?.['trim']()||'',_0xeaaccc=_0x282c2b['match'](/\d+/)?.[0x0];_0x2124ac['COAEP']['semester']=_0xeaaccc?parseInt(_0xeaaccc,0xa):_0x2124ac['COAEP']['semester'];}});let _0x49688f=null;return _0x31cd5f['forEach']((_0x1e1672,_0x3e4b66)=>{if(_0x3e4b66<=_0x138ea7)return;let _0x283ee6=_0x1e1672[_0x4ee632-0x1]?.['trim']()||'',_0x499092=_0x1e1672[_0x4ee632]?.['trim']()||'';/^\d+$/['test'](_0x1e1672[_0x4ee632]?.['trim']()||'')&&(_0x283ee6=_0x1e1672[_0x4ee632]?.['trim']()||'',_0x499092=_0x1e1672[_0x4ee632+0x1]?.['trim']()||'');const _0x1c486e=_0x1e1672[_0x992a3f]?.['trim']()||'',_0xec9d2a=_0x1e1672[_0x4afddb]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',_0x18d001=_0x1e1672[_0x23e467]?.['replace'](/\s+/g,'\x20')['trim']()||'';if(_0x283ee6&&/^\d+$/['test'](_0x283ee6)){_0x49688f&&_0x2124ac['COAEP']['co']['push'](_0x49688f);const _0x45d4d7=_0x499092,{verb:_0x7042fd,cognitive_level:_0x14bc41,taxonomy_level:_0x3af9cf}=extractFromObjective(_0x45d4d7);if(!_0x7042fd)return {'error':'Could\x20not\x20find\x20verb.','message':'Please\x20ensure\x20the\x20Course\x20Outcome\x20#'+_0x283ee6+'\x20is\x20in\x20the\x20correct\x20format.'};_0x49688f={'statement':_0x45d4d7,'ilo':[],'verb':_0x7042fd,'cognitive_level':_0x14bc41,'taxonomy_level':_0x3af9cf};}if(_0x49688f&&_0x1c486e&&_0x18d001){const _0x78ab82=_0x1c486e['replace'](/^ILO\d+[:.]?\s*/,'');if(_0x78ab82['match'](/^(Revision|Prepared|Date|Approved|Effectivity|Page)/i)||_0x78ab82['length']<0xa)return;let _0x37f834=_0xec9d2a;if(!_0x37f834&&_0x78ab82['includes'](':')){const _0x5e483b=_0x78ab82['match'](/^ILO\d+:\s*(.+?)(?:\s*\(|$)/);_0x5e483b&&(_0x37f834=_0x5e483b[0x1]?.['trim']()||'');}const {performance_target:_0x48c0f1,passing_score:_0x454864}=performaceTarget(_0x18d001),{verb:_0x24dad2,cognitive_level:_0xb4b3be,taxonomy_level:_0x23ae61}=extractFromObjective(_0x78ab82);_0x49688f['ilo']['push']({'statement':_0x78ab82,'assessment_tool':_0x37f834,'performance_target':_0x48c0f1,'passing_score':_0x454864,'verb':_0x24dad2,'cognitive_level':_0xb4b3be,'taxonomy_level':_0x23ae61});}}),_0x49688f&&_0x2124ac['COAEP']['co']['push'](_0x49688f),_0x2124ac;}
|
|
21
21
|
|
|
22
|
-
async function uploadCOAEP(
|
|
22
|
+
async function uploadCOAEP(_0x2ac168,_0x52bcb3,_0x4aa639){try{const _0x2d5706=await convertToCSVFile(_0x52bcb3),_0x4b19b4=await _0x2d5706['text'](),_0x3f9aa5=parseCOAEP(_0x4b19b4);console['log'](_0x3f9aa5);const _0x6dd52b=await fetch(_0x2ac168+'/coaeps/upload?course_id='+_0x4aa639,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x3f9aa5)});if(!_0x6dd52b['ok']){const _0x144720=await _0x6dd52b['json']();throw _0x144720;}return _0x6dd52b['json']();}catch(_0x46e9de){throw _0x46e9de;}}
|
|
23
23
|
|
|
24
|
-
async function uploadEnrolledStudent(
|
|
24
|
+
async function uploadEnrolledStudent(_0xef6802,_0x272b80){try{const _0x1d38d0=await convertToCSVFile(_0x272b80),_0x1e9b9d=new FormData();_0x1e9b9d['append']('csvFile',_0x1d38d0);const _0x2b1d55=await fetch(_0xef6802+'/enrolled-students/upload',{'method':'POST','body':_0x1e9b9d});if(!_0x2b1d55['ok']){const _0x194751=await _0x2b1d55['json']();throw _0x194751;}return _0x2b1d55['json']();}catch(_0x5f199f){throw _0x5f199f;}}
|
|
25
25
|
|
|
26
|
-
function parseClassList(
|
|
26
|
+
function parseClassList(_0x4119c6){const _0x41821f=_0x5084af['parse'](_0x4119c6,{'skipEmptyLines':!![]})['data'];let _0x13fe2a='',_0x2980c9='',_0x1ef181='';const _0x4e441f=[];return _0x41821f['forEach'](_0x248fa3=>{const _0x306428=_0x248fa3['map'](_0x4bcb76=>(_0x4bcb76??'')['toString']()['trim']()),_0x4b0b9b=_0x306428[0x0]??'';if(_0x4b0b9b['startsWith']('Course\x20No:')){const _0x5dd835=_0x4b0b9b['replace']('Course\x20No:','')['trim'](),_0x4527d9=_0x5dd835['split'](/\s+/);_0x1ef181=_0x4527d9[0x0]??'';const [_0x24e8dc,_0x51fbcc]=(_0x4527d9[0x1]??'')['split']('-');_0x2980c9=_0x24e8dc??'';const _0x5eb128=(_0x51fbcc??'')['match'](/[a-z]$/);_0x13fe2a=_0x5eb128?_0x5eb128[0x0]:'';}if(/^\d+$/['test'](_0x4b0b9b)){const _0x127a52=_0x306428[0x2]??'';_0x4e441f['push']({'subj_code':_0x1ef181,'student_no':_0x127a52,'course_id':_0x2980c9,'section':_0x13fe2a});}}),{'enrolledCourses':_0x4e441f};}
|
|
27
27
|
|
|
28
|
-
async function uploadClassList(
|
|
28
|
+
async function uploadClassList(_0x16de8c,_0x11d9bc,_0x4f550b,_0x2b0c59){try{const _0x1f5314=await convertToCSVFile(_0x11d9bc),_0x49a0d5=await _0x1f5314['text'](),_0x498e0a=parseClassList(_0x49a0d5),_0x11233a='subj_code='+_0x4f550b+'&period_id='+_0x2b0c59,_0x2be949=await fetch(_0x16de8c+'/enrolled-courses/upload?'+_0x11233a,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x498e0a)});if(!_0x2be949['ok']){const _0x23c17d=await _0x2be949['json']();throw _0x23c17d;}return _0x2be949['json']();}catch(_0x43bc30){throw _0x43bc30;}}
|
|
29
29
|
|
|
30
|
-
function parseAssessmentCsv(
|
|
30
|
+
function parseAssessmentCsv(_0x379cd3){const {data:_0x287286}=_0x5084af['parse'](_0x379cd3,{'skipEmptyLines':!![]}),_0x339e31=_0x287286['filter'](_0xa2ad96=>_0xa2ad96['length']>0x0),_0x590c89=_0x339e31['find'](_0x2bd20b=>_0x2bd20b['some'](_0x132033=>_0x132033?.['includes']('Faculty'))),_0x27d349=_0x590c89?_0x590c89['findIndex'](_0xd6d74c=>_0xd6d74c?.['includes']('Faculty')):-1,_0x26b7d5=_0x27d349!==-1&&_0x590c89?_0x590c89[_0x27d349+0x2]?.['replace'](/"/g,'')['trim']()??'':'',_0x262c1a=_0x339e31['find'](_0x5c31bb=>_0x5c31bb['some'](_0x1da12b=>_0x1da12b?.['includes']('Semester'))),_0xa6e691=_0x262c1a?_0x262c1a['findIndex'](_0x21e693=>_0x21e693?.['includes']('Semester')):-1,_0x5497dc=_0xa6e691!==-1&&_0x262c1a?_0x262c1a[_0xa6e691+0x2]?.['trim']()??'':'',_0x410aa0=_0x5497dc['includes']('1st')?0x1:_0x5497dc['includes']('2nd')?0x2:0x0,_0x1e4c6f=_0x339e31['find'](_0x33300f=>_0x33300f['some'](_0x3baae6=>_0x3baae6?.['includes']('Course\x20&\x20Sec'))),_0x422c2d=_0x1e4c6f?_0x1e4c6f['findIndex'](_0x31cb60=>_0x31cb60?.['includes']('Course\x20&\x20Sec')):-1,_0x31ec25=_0x422c2d!==-1&&_0x1e4c6f?_0x1e4c6f[_0x422c2d+0x2]?.['trim']()??'':'';let _0x4a6163='',_0x21f3c6='';if(_0x31ec25){const _0x42b1d6=_0x31ec25['match'](/^([A-Za-z0-9]+)-?([A-Za-z]+)?/);_0x42b1d6&&(_0x4a6163=_0x42b1d6[0x1]??'',_0x42b1d6[0x2]&&(_0x21f3c6=_0x42b1d6[0x2]['replace'](/^OC/i,'')));}const _0x5973f1=_0x339e31['find'](_0x474109=>_0x474109['some'](_0x5b91cb=>_0x5b91cb?.['includes']('School\x20Year'))),_0x4893ed=_0x5973f1?_0x5973f1['findIndex'](_0x421fcc=>_0x421fcc?.['includes']('School\x20Year')):-1,_0x25788f=_0x4893ed!==-1&&_0x5973f1?_0x5973f1[_0x4893ed+0x2]?.['trim']()??'':'';let _0x4a2862=0x0;if(_0x25788f){const _0x27819d=_0x25788f['match'](/(\d{4})-(\d{4})/);if(_0x27819d){const _0x322191=(_0x27819d[0x1]??'')['slice'](0x2),_0x1ec4ab=(_0x27819d[0x2]??'')['slice'](0x2);_0x4a2862=parseInt(_0x322191+_0x1ec4ab,0xa);}}const _0x28a620={'faculty':_0x26b7d5,'course':_0x4a6163,'section':_0x21f3c6,'semester':_0x410aa0,'sy':_0x4a2862},_0x259344=_0x339e31['findIndex'](_0x2d86c0=>_0x2d86c0['some'](_0x46541b=>_0x46541b?.['trim']()==='CO\x20#'));if(_0x259344===-1)throw new Error('CO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x3a94f6=_0x339e31[_0x259344+0x1];if(!_0x3a94f6)throw new Error('ILO\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x441670={};let _0xdeee5=0x1,_0x203dc4=0x1;for(let _0x397e91=0x3;_0x397e91<_0x3a94f6['length'];_0x397e91++){const _0x2e3c5d=_0x3a94f6[_0x397e91];if(!_0x2e3c5d)continue;const _0x37e4ce='co'+_0xdeee5;if(!_0x441670[_0x37e4ce])_0x441670[_0x37e4ce]=[];_0x441670[_0x37e4ce]['push']('ilo'+_0x203dc4),_0x203dc4++,_0x203dc4>0x3&&(_0xdeee5++,_0x203dc4=0x1);}const _0x16c87e=_0x339e31['findIndex'](_0x1da25c=>_0x1da25c['includes']('Name\x20of\x20Students'));if(_0x16c87e===-1)throw new Error('Student\x20header\x20row\x20not\x20found\x20in\x20CSV');const _0x1799da=_0x339e31[_0x16c87e];if(!_0x1799da)throw new Error('Student\x20header\x20row\x20is\x20missing');const _0x1ef13e=_0x1799da['findIndex'](_0x343094=>_0x343094?.['includes']('Name\x20of\x20Students'));if(_0x1ef13e===-1)throw new Error('Name\x20of\x20Students\x20column\x20not\x20found\x20in\x20CSV');const _0x55d8cb=_0x1ef13e+0x2,_0xeebd0c=[];for(let _0x362e55=_0x16c87e+0x1;_0x362e55<_0x339e31['length'];_0x362e55++){const _0x3e16e5=_0x339e31[_0x362e55];if(!_0x3e16e5)continue;if(_0x3e16e5['some'](_0x7a2e1e=>_0x7a2e1e?.['toUpperCase']()['includes']('TOTAL\x20STUDENTS')||_0x7a2e1e?.['toUpperCase']()['includes']('ACHIEVED\x20THE\x20MINIMUM')||_0x7a2e1e?.['toUpperCase']()['includes']('INACTIVE')||_0x7a2e1e?.['toUpperCase']()['includes']('AVERAGE')))continue;if(!_0x3e16e5[_0x1ef13e])continue;const _0x1947ce=_0x3e16e5[_0x1ef13e]['replace'](/"/g,'')['trim'](),_0x101032=_0x3e16e5['slice'](_0x55d8cb)['map'](_0x1d39ba=>_0x1d39ba===null?null:!isNaN(Number(_0x1d39ba))?parseFloat(_0x1d39ba):0x0);let _0x476880=0x0;const _0x2788a6={};Object['entries'](_0x441670)['forEach'](([_0x25dd68,_0xb4d070])=>{const _0x3e0f4e={};_0xb4d070['forEach'](_0x189c4f=>{_0x3e0f4e[_0x189c4f]=_0x101032[_0x476880]??0x0,_0x476880++;}),_0x2788a6[_0x25dd68]={'transmuted_score':_0x3e0f4e};}),_0xeebd0c['push']({'student_name':_0x1947ce,'coaep':_0x2788a6});}const _0x2bf0ae=_0x339e31['find'](_0x5442f2=>_0x5442f2['some'](_0x3a7f40=>_0x3a7f40?.['includes']('ACHIEVED\x20THE\x20MINIMUM'))),_0x3b6954=_0x339e31['find'](_0x50b564=>_0x50b564['some'](_0x413444=>_0x413444?.['includes']('AVERAGE'))),_0x1e164b=_0x2bf0ae?_0x2bf0ae['slice'](_0x55d8cb)['map'](_0x216e05=>_0x216e05&&!isNaN(Number(_0x216e05))?parseInt(_0x216e05):0x0):[],_0x20f46a=_0x3b6954?_0x3b6954['slice'](_0x55d8cb)['map'](_0x49ba94=>_0x49ba94&&_0x49ba94!=='#DIV/0!'&&!isNaN(Number(_0x49ba94))?parseInt(_0x49ba94):0x0):[],_0x3fa9b0={};let _0x41f09e=0x0;return Object['entries'](_0x441670)['forEach'](([_0x2a4ecd,_0xbda9c6])=>{if(!_0x3fa9b0[_0x2a4ecd])_0x3fa9b0[_0x2a4ecd]={};_0xbda9c6['forEach'](_0x3b3ff3=>{_0x3fa9b0[_0x2a4ecd][_0x3b3ff3]={'achievedMinimum':_0x1e164b[_0x41f09e]??0x0,'average':_0x20f46a[_0x41f09e]??0x0},_0x41f09e++;});}),{'assessmentData':{'classAssignment':_0x28a620,'student':_0xeebd0c,'total':_0x3fa9b0}};}
|
|
31
31
|
|
|
32
|
-
async function uploadAssessmentData(
|
|
32
|
+
async function uploadAssessmentData(_0x290c8b,_0x120c56){try{const _0x1f5260=await convertToCSVFile(_0x120c56),_0x1b98d1=await _0x1f5260['text'](),_0x3947a7=parseAssessmentCsv(_0x1b98d1),_0x51f0f6=await fetch(_0x290c8b+'/assessment-data/upload',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify'](_0x3947a7)});if(!_0x51f0f6['ok']){const _0xe3a25c=await _0x51f0f6['json']();throw _0xe3a25c;}return _0x51f0f6['json']();}catch(_0x4b5224){throw _0x4b5224;}}
|
|
33
33
|
|
|
34
|
-
async function uploadDeptFaculty(
|
|
34
|
+
async function uploadDeptFaculty(_0xc3e436,_0x487e87){try{const _0x1692e7=await convertToCSVFile(_0x487e87),_0x36c3fb=new FormData();_0x36c3fb['append']('csvFile',_0x1692e7);const _0x41a44b=await fetch(_0xc3e436+'/dept-faculties/upload',{'method':'POST','body':_0x36c3fb});if(!_0x41a44b['ok']){const _0x38c4dc=await _0x41a44b['json']();throw _0x38c4dc;}return _0x41a44b['json']();}catch(_0x2d6bf3){throw _0x2d6bf3;}}
|
|
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(_0x325279){let _0x51f268={'headerIdx':-1,'poIdx':-1,'tlIdx':-1,'piIdx':-1,'fcIdx':-1,'scIdx':-1,'atIdx':-1,'ptIdx':-1};for(let _0x46faad=0x0;_0x46faad<Math['min'](_0x325279['length'],0x14);_0x46faad++){const _0x521820=(_0x325279[_0x46faad]??[])['map'](_0x450b74=>_0x450b74['toLowerCase']()['trim']()),_0x117988=_0x521820['findIndex'](_0x4a3656=>HEADERS['po']['some'](_0x1da5d2=>_0x4a3656['toLowerCase']()['includes'](_0x1da5d2))),_0x39d7e5=_0x521820['findIndex'](_0x2bb49a=>HEADERS['tl']['some'](_0x2c8292=>_0x2bb49a['toLowerCase']()['includes'](_0x2c8292))),_0x527276=_0x521820['findIndex'](_0x3fbca7=>HEADERS['pi']['some'](_0x3145d6=>_0x3fbca7['toLowerCase']()['includes'](_0x3145d6))),_0x416616=_0x521820['findIndex'](_0x2629ca=>HEADERS['fc']['some'](_0x24b30a=>_0x2629ca['toLowerCase']()['includes'](_0x24b30a))),_0x2178c7=_0x521820['findIndex'](_0x346fc6=>HEADERS['sc']['some'](_0x59c4ab=>_0x346fc6['toLowerCase']()['includes'](_0x59c4ab))),_0x221027=_0x521820['findIndex'](_0x251478=>HEADERS['at']['some'](_0x1bf169=>_0x251478['toLowerCase']()['includes'](_0x1bf169))),_0x196a95=_0x521820['findIndex'](_0x2c0dd6=>HEADERS['pt']['some'](_0x5ab361=>_0x2c0dd6['toLowerCase']()['includes'](_0x5ab361))),_0x52d129=[_0x117988,_0x39d7e5,_0x527276,_0x416616,_0x2178c7,_0x221027,_0x196a95]['filter'](_0x5e561b=>_0x5e561b!==-1)['length'];if(_0x52d129>=0x3){_0x51f268={'headerIdx':_0x46faad,'poIdx':_0x117988,'tlIdx':_0x39d7e5,'piIdx':_0x527276,'fcIdx':_0x416616,'scIdx':_0x2178c7,'atIdx':_0x221027,'ptIdx':_0x196a95};break;}}if(_0x51f268['headerIdx']===-1)throw new Error('No\x20valid\x20headers\x20found\x20in\x20POAEP\x20file.');return _0x51f268;}
|
|
37
37
|
|
|
38
|
-
const parseFormativeCourses=
|
|
38
|
+
const parseFormativeCourses=_0x490386=>{let _0x1a0ee1=_0x490386['split'](',')['reduce']((_0x355768,_0x47e7c5)=>{const _0x1be243=_0x47e7c5['trim']();if(_0x1be243)_0x355768['push'](_0x1be243);return _0x355768;},[]);return _0x1a0ee1;};
|
|
39
39
|
|
|
40
|
-
const parsePOAEP=
|
|
40
|
+
const parsePOAEP=_0xb1b9ab=>{try{const _0x2d1ff6=_0x5084af['parse'](_0xb1b9ab,{'skipEmptyLines':![]})['data'],{headerIdx:_0x37c29d,poIdx:_0x373710,tlIdx:_0x252555,piIdx:_0xd7103b,fcIdx:_0x31bca9,scIdx:_0x40bb8e,atIdx:_0x36af2a,ptIdx:_0x28683c}=getPoaepHeader(_0x2d1ff6),_0x3db197=[];let _0x2726ac={'po_desc':'','seq_no':0x0,'PerfIndicators':[]},_0xc11d81='',_0x3bd4f='',_0x5e8580='';for(let _0x150e90=_0x37c29d+0x1;_0x150e90<_0x2d1ff6['length'];_0x150e90++){const _0x1e4b4d=_0x2d1ff6[_0x150e90];if(!_0x1e4b4d)break;const _0x324c5e=_0x1e4b4d[_0x373710]?.['trim']()||'';_0x324c5e!==''&&(_0x2726ac={'po_desc':_0x324c5e,'seq_no':_0x2726ac['seq_no']+0x1,'PerfIndicators':[]},_0x3db197['push'](_0x2726ac),_0xc11d81='',_0x3bd4f='',_0x5e8580='');if(_0x2726ac['po_desc']==='')throw new Error('Invalid\x20Program\x20Outcome\x20at\x20row\x20'+_0x150e90+'.');const _0x21c7b0=_0x1e4b4d[_0xd7103b]?.['trim']()||'';if(_0x21c7b0==='')break;const _0xc528dd=_0x1e4b4d[_0x31bca9]?.['trim']()||'';if(_0xc528dd==='')throw new Error('Empty\x20Formative\x20Courses\x20at\x20row\x20'+_0x150e90+'.');const _0x189e27=_0x1e4b4d[_0x40bb8e]?.['trim']()||_0xc11d81;if(_0x189e27==='')throw new Error('Empty\x20Summative\x20Course\x20at\x20row\x20'+_0x150e90+'.');_0xc11d81=_0x189e27;const _0x7a5f8a=_0x1e4b4d[_0x36af2a]?.['trim']()||_0x3bd4f;if(_0x7a5f8a==='')throw new Error('Empty\x20Assessment\x20Tool\x20at\x20row\x20'+_0x150e90+'.');_0x3bd4f=_0x7a5f8a;const _0x49e7ba=_0x1e4b4d[_0x28683c]?.['trim']()||_0x5e8580;if(_0x49e7ba==='')throw new Error('Empty\x20Performance\x20Target\x20at\x20row\x20'+_0x150e90+'.');_0x5e8580=_0x49e7ba;const _0x4eafc0=parseFormativeCourses(_0xc528dd);if(_0x4eafc0['length']===0x0)throw new Error('Invalid\x20Formative\x20Courses\x20format\x20at\x20row\x20'+_0x150e90+'.');const _0x357317=performaceTarget(_0x49e7ba);if(!_0x357317['performance_target']||!_0x357317['passing_score'])throw new Error('Invalid\x20Performance\x20Targets\x20format\x20at\x20row\x20'+_0x150e90+'.');const _0x1d2847={'pi_desc':_0x21c7b0,'FormativeCourses':_0x4eafc0['map'](_0x13f2f0=>({'course_id':_0x13f2f0,'cognitive_level':0x0})),'SummativeCourse':{'course_id':_0x189e27},'AssessmentTool':{'at_desc':_0x7a5f8a},'PerformanceTargets':{'target_percent':_0x357317['performance_target'],'min_score':_0x357317['passing_score']}};_0x2726ac['PerfIndicators']['push'](_0x1d2847);}return {'success':!![],'message':'Successfully\x20parsed\x20POAEP\x20file.','data':{'POAEP':_0x3db197}};}catch(_0x332b65){return {'success':![],'error':_0x332b65 instanceof Error?_0x332b65['message']:_0x332b65,'message':'Please\x20ensure\x20the\x20file\x20follows\x20the\x20POAEP\x20template.'};}};
|
|
41
41
|
|
|
42
|
-
async function uploadPOAEP(
|
|
42
|
+
async function uploadPOAEP(_0x4f7c5c,_0x12b5c7,_0x4e5c18,_0x53e173,_0x52907b){try{const _0x14709e=await convertToCSVFile(_0x12b5c7),_0x18d1a2=await _0x14709e['text'](),_0x54c158=parsePOAEP(_0x18d1a2),_0x40bd6b=await fetch(_0x4f7c5c+'/program-outcomes/poaep/upload?curr_id='+_0x53e173+'&period_id='+_0x52907b,{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x4e5c18},'credentials':'include','body':JSON['stringify'](_0x54c158)});if(!_0x40bd6b['ok']){const _0x1e6026=await _0x40bd6b['json']();throw _0x1e6026;}return _0x40bd6b['json']();}catch(_0x4350b9){throw _0x4350b9;}}
|
|
43
43
|
|
|
44
|
-
class DataTable{['name'];['table']
|
|
44
|
+
class DataTable{['name'];['table'];['headers'];['validators']=[];constructor(_0x1d4fa0='DataTable'){this['name']=_0x1d4fa0,this['table']=[],this['headers']=[],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'],'table':this['table'],'headers':this['headers']}};}async['setTable'](_0x26697b){await this['assertInitialized']();if(_0x26697b[0x0]['length']!==this['headers']['length'])Promise['reject'](new Error('Number\x20of\x20columns\x20does\x20not\x20match\x20number\x20of\x20headers.'));this['table']=_0x26697b;}async['initializeTable'](_0x3771f5){try{let _0x1bf180;if(_0x3771f5 instanceof File)_0x1bf180=await this['fromXML'](_0x3771f5);else _0x1bf180=await this['fromCSVString'](_0x3771f5);if(!_0x1bf180['success']||!_0x1bf180['data'])return _0x1bf180;if(_0x1bf180['data']['table']['length']===0x0)throw new Error('Cannot\x20set\x20an\x20empty\x20table.');const {table:_0x228ba0,headers:_0x412337}=_0x1bf180['data'];return this['table']=_0x228ba0,this['headers']=_0x412337,{'success':!![],'message':'Successfully\x20set\x20table.'};}catch(_0x43c9b4){return {'success':![],'message':'Error\x20setting\x20table.','error':_0x43c9b4};}}async['assertInitialized'](){if(this['headers']['length']===0x0)throw {'error':'This\x20'+this['name']+'\x20is\x20not\x20initialized.','from':'ASSERT_INIT'};return Promise['resolve']('The\x20table\x20is\x20initialized.');}async['fromXML'](_0x83852c,_0x37801b){const _0x116bbe=await convertToCSVFile(_0x83852c,_0x37801b),_0xab5773=await _0x116bbe['text']();return this['fromCSVString'](_0xab5773);}async['findValue'](_0x9204e5){await this['assertInitialized']();for(let _0x583110=0x0;_0x583110<this['table']['length'];_0x583110++){for(let _0x8709b7=0x0;_0x8709b7<this['table'][_0x583110]['length'];_0x8709b7++){if(this['table'][_0x583110][_0x8709b7]===_0x9204e5)return {'row':_0x583110,'column':_0x8709b7};}}return {'row':-1,'column':-1};}async['validate'](){const _0x10551e=[],_0x66fa11=[];try{await this['assertInitialized']()['then'](_0x2eb7fc=>{_0x10551e['push'](_0x2eb7fc);})['catch'](_0xc18d96=>_0x66fa11['push'](_0xc18d96));if(_0x66fa11['length']>0x0)throw 'Cannot\x20validate\x20uninitialized\x20table.';await this['validateFields'](_0x10551e,_0x66fa11);const {success:_0x116ec4,message:_0x36a7b7,error:_0x3c7f70,data:_0x5cfd3f}=await this['toJson']();if(!_0x5cfd3f)throw 'Cannot\x20access\x20Json\x20Object\x20data.';_0x10551e['push'](..._0x5cfd3f['validMsgs']),_0x66fa11['push'](..._0x5cfd3f['tableErrors']);const {jsonObj:_0x183613}=_0x5cfd3f;for(const _0x17a1aa of this['validators']){await _0x17a1aa['validate'](_0x10551e,_0x66fa11,this,_0x183613);}let _0x151d70=this['name']+'\x20ran\x20its\x20validations.';if(_0x10551e['length']>0x0)_0x151d70+='\x20'+_0x10551e['length']+'\x20validations\x20were\x20successful.';if(_0x66fa11['length']>0x0)_0x151d70+='\x20'+_0x66fa11['length']+'\x20validations\x20failed.';return {'success':!![],'message':_0x151d70,'data':{'validMsgs':_0x10551e,'tableErrors':_0x66fa11}};}catch(_0x4b4983){return _0x66fa11['push']({'error':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','from':this['name']['toUpperCase']()+'_VALIDATE','cause':_0x4b4983}),{'success':![],'message':this['name']+'\x20failed\x20to\x20run\x20all\x20its\x20validations.','data':{'validMsgs':_0x10551e,'tableErrors':_0x66fa11}};}}['useValidator'](_0x2113b3){this['validators']['push'](_0x2113b3);}}
|
|
45
45
|
|
|
46
|
-
class DTValidator{['name'];constructor(
|
|
46
|
+
class DTValidator{['name'];constructor(_0x54c547){this['name']=_0x54c547;}['getName'](){return this['name'];}['report'](_0x50027a,_0x5b708a,_0x284f7f){if(_0x50027a['length']>0x0)_0x284f7f['push'](..._0x50027a);else _0x5b708a['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'](_0x230995,_0x485179,_0x38e045,_0x4d47b0){const _0x5f26d2=[];if(!_0x4d47b0){_0x485179['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x37cfec=0x0;_0x37cfec<_0x4d47b0['co']['length'];_0x37cfec++){const _0x590de0=_0x4d47b0['co'][_0x37cfec];if(!_0x590de0){const {row:_0x1f9b4e,column:_0x476e5c}=await _0x38e045['findValue'](_0x37cfec+0x1+'');_0x5f26d2['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x37cfec+0x1)+'.','row':_0x1f9b4e,'column':_0x476e5c+0x1,'from':this['name']});continue;}if(!_0x590de0?.['ilo']){const {row:_0x20eb53,column:_0x139dd2}=await _0x38e045['findValue'](_0x590de0['statement']);_0x5f26d2['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x37cfec+0x1)+'.','row':_0x20eb53,'column':_0x139dd2,'from':this['name']});continue;}const _0x14f900=_0x590de0['ilo']['length']-0x1,_0x2256bb=_0x590de0['ilo'][_0x14f900];if(!_0x2256bb['taxonomy_level']){const {row:_0x49d58c,column:_0x133bfd}=await _0x38e045['findValue'](_0x2256bb['statement']);_0x5f26d2['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x37cfec+0x1)+'\x20has\x20no\x20Taxonomy\x20Level.','row':_0x49d58c,'column':_0x133bfd,'from':this['name']});continue;}if(_0x2256bb['taxonomy_level']!==_0x590de0['taxonomy_level']){const {row:_0x771b61,column:_0x1a36ee}=await _0x38e045['findValue'](_0x2256bb['statement']);_0x5f26d2['push']({'error':'Last\x20ILO\x20for\x20CO\x20'+(_0x37cfec+0x1)+'\x20does\x20not\x20match\x20the\x20CO\x27s\x20Taxonomy\x20Level.\x20('+_0x2256bb['taxonomy_level']+'\x20!==\x20'+_0x590de0['taxonomy_level']+')','row':_0x771b61,'column':_0x1a36ee,'from':this['name']});}}this['report'](_0x5f26d2,_0x230995,_0x485179);}}
|
|
49
49
|
|
|
50
|
-
const
|
|
50
|
+
const whitelist=['applying','analyzing','evaluating','creating'];class MinCOtaxo extends DTValidator{constructor(){super('MIN_CO_TAXO');}async['validate'](_0x4fb61d,_0x573676,_0x3d1e6f,_0x34ff07){const _0x3cf306=[];if(!_0x34ff07){_0x573676['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x3ec8a6=0x0;_0x3ec8a6<_0x34ff07['co']['length'];_0x3ec8a6++){const _0x4ced40=_0x34ff07['co'][_0x3ec8a6];if(!_0x4ced40['taxonomy_level']){_0x3cf306['push']({'error':'No\x20taxonomy\x20level\x20for\x20CO\x20'+(_0x3ec8a6+0x1),'from':this['name']});continue;}if(!whitelist['includes'](_0x4ced40['taxonomy_level'])){const {row:_0x280764,column:_0xf882f8}=await _0x3d1e6f['findValue'](_0x4ced40['statement']);let _0x4f392b={'error':'Cannot\x20have\x20CO\x20Taxonomy\x20Level\x20of\x20lower\x20than\x20Applying:\x20'+_0x4ced40['taxonomy_level']['toUpperCase'](),'from':this['name']};(_0x280764!==-1||_0xf882f8!==-1)&&(_0x4f392b['row']=_0x280764,_0x4f392b['column']=_0xf882f8),_0x3cf306['push'](_0x4f392b);}}this['report'](_0x3cf306,_0x4fb61d,_0x573676);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'](_0x5bbf07,_0x2a1bde,_0x109d96,_0xee6921){const _0x44ce96=[];if(!_0xee6921){_0x2a1bde['push']({'error':'Unable\x20to\x20access\x20COAEP\x20object.','from':this['name']});return;}for(let _0x4b904a=0x0;_0x4b904a<_0xee6921['co']['length'];_0x4b904a++){const _0x349005=_0xee6921['co'][_0x4b904a];if(!_0x349005){const {row:_0x4712de,column:_0x156d7d}=await _0x109d96['findValue'](_0x4b904a+0x1+'');_0x44ce96['push']({'error':'No\x20CO\x20Statement\x20for\x20CO\x20'+(_0x4b904a+0x1)+'.','row':_0x4712de,'column':_0x156d7d+0x1,'from':this['name']});continue;}if(!_0x349005?.['ilo']){const {row:_0xfca9d8,column:_0x4ede76}=await _0x109d96['findValue'](_0x349005['statement']);_0x44ce96['push']({'error':'No\x20ILOs\x20for\x20CO\x20'+(_0x4b904a+0x1)+'.','row':_0xfca9d8,'column':_0x4ede76,'from':this['name']});continue;}const _0xafdddc=await _0x109d96['findValue'](_0x349005['ilo'][0x0]['statement']),_0x1bee70=_0x349005['ilo']['map'](_0x1d8a62=>taxoOrder[_0x1d8a62['taxonomy_level']]);let _0x38e8a4=_0x1bee70[0x0];for(let _0x5cdee6=0x1;_0x5cdee6<_0x1bee70['length'];_0x5cdee6++){if(_0x1bee70[_0x5cdee6]<_0x38e8a4){_0x44ce96['push']({'error':'Under\x20CO\x20'+(_0x4b904a+0x1)+',\x20ILO\x20'+(_0x5cdee6+0x1)+'\x20should\x20not\x20have\x20a\x20taxonomy\x20level\x20lower\x20than\x20ILO\x20'+_0x5cdee6+'\x27s.','row':_0xafdddc['row'],'column':_0xafdddc['column']+_0x5cdee6,'from':this['name']});continue;}_0x38e8a4=_0x1bee70[_0x5cdee6];}}this['report'](_0x44ce96,_0x5bbf07,_0x2a1bde);}}
|
|
53
53
|
|
|
54
|
-
class
|
|
54
|
+
const minPerfTarget=0x32,minPassScore=0x32;class MinPerfTarget extends DTValidator{constructor(){super('MIN_PERF_TARGET');}async['validate'](_0x3947e,_0x37c123,_0x306eef,_0x5f5871){const {success:_0x5cd240,data:_0xb66b07}=_0x306eef['getTable'](),_0x210a2a=[];if(!_0x5cd240){_0x210a2a['push']({'error':'Failed\x20to\x20access\x20table\x20data.','from':this['name']});return;}const {table:_0x62fc2e}=_0xb66b07;for(let _0x238a33=0x0;_0x238a33<_0x62fc2e['length'];_0x238a33++){const _0x40fba7=_0x62fc2e[_0x238a33],[_0xd96763,_0x39ed45]=_0x40fba7[0x4];if(!_0xd96763)_0x210a2a['push']({'error':'Performance\x20target\x20is\x20required.','row':_0x238a33,'column':0x4,'from':this['name']});else _0xd96763<minPerfTarget&&_0x210a2a['push']({'error':'Performance\x20target\x20must\x20be\x20at\x20least\x20'+minPerfTarget+'.','row':_0x238a33,'column':0x4,'from':this['name']});if(!_0x39ed45)_0x210a2a['push']({'error':'Pass\x20score\x20is\x20required.','row':_0x238a33,'column':0x6,'from':this['name']});else _0x39ed45<minPassScore&&_0x210a2a['push']({'error':'Pass\x20score\x20must\x20be\x20at\x20least\x20'+minPassScore+'.','row':_0x238a33,'column':0x6,'from':this['name']});}this['report'](_0x210a2a,_0x3947e,_0x37c123);}}
|
|
55
55
|
|
|
56
|
-
class
|
|
56
|
+
class CoaepDT extends DataTable{['faculty']=null;['course']=null;['sy']=null;['semester']=null;constructor(){super('CoaepDT'),this['useValidator'](new MinCOtaxo()),this['useValidator'](new LastILOTaxo()),this['useValidator'](new ILOTaxoOrder()),this['useValidator'](new MinPerfTarget());}async['validateFields'](_0x2d0d30,_0x18a197){const _0x340858=[];let _0x172dfd=null,_0x2e8749=null;for(let _0xc77eeb=0x0;_0xc77eeb<this['table']['length'];_0xc77eeb++){const _0x183d4a=[],_0x4dd8e0=this['table'][_0xc77eeb],_0x23f99e=_0x4dd8e0[0x0]||_0x172dfd,_0x57721c=_0x4dd8e0[0x1]||_0x2e8749,_0x4ee19d=_0x4dd8e0[0x2],_0x16e406=_0x4dd8e0[0x3],_0x5f34c6=_0x4dd8e0[0x4];if(!_0x23f99e)_0x183d4a['push'](0x0);if(!_0x57721c)_0x183d4a['push'](0x1);if(!_0x4ee19d)_0x183d4a['push'](0x2);if(!_0x16e406)_0x183d4a['push'](0x3);if(!_0x5f34c6)_0x183d4a['push'](0x4);if(_0x2e8749!==_0x57721c)this['validateObjectiveGrammar'](_0x57721c,_0xc77eeb,0x1,_0x18a197);_0x172dfd=_0x23f99e,_0x2e8749=_0x57721c;for(const _0x17d33b of _0x183d4a){_0x340858['push']({'error':'Missing\x20field:\x20'+this['headers'][_0x17d33b],'row':_0xc77eeb,'column':_0x17d33b});}if(_0x4ee19d)this['validateObjectiveGrammar'](_0x4ee19d,_0xc77eeb,0x2,_0x18a197);}if(_0x340858['length']>0x0)_0x18a197['push'](..._0x340858);else _0x2d0d30['push'](this['name']+'\x20successfully\x20validated\x20all\x20fields.');}async['fromCSVString'](_0x2f79ae){try{const _0x349710={'name':this['name'],'table':[],'headers':[],'types':[]},_0x2502eb=_0x5084af['parse'](_0x2f79ae,{'skipEmptyLines':![]})['data'];_0x349710['headers']=['No.','Course\x20Outcome\x20Statement','Intended\x20Learning\x20Outcome','Assessment\x20Tool','Performance\x20Target'];const {headerRowIndex:_0xaa03f0,coIdx:_0x3efc78,iloIdx:_0x858ab5,assessToolIdx:_0xdac277,perfTargetIdx:_0x3317a1}=getCoaepHeader(_0x2502eb);if(_0xaa03f0===-0x1)throw new Error('Could\x20not\x20auto-detect\x20header\x20row.\x20Please\x20ensure\x20the\x20CSV\x20file\x20is\x20in\x20the\x20correct\x20COAEP\x20format.');_0x2502eb['forEach'](_0x5a9f4d=>{const _0x24f5be=_0x5a9f4d['indexOf']('Name\x20of\x20Faculty:'),_0x5170a1=_0x5a9f4d['indexOf']('School\x20Year'),_0x1ed135=_0x5a9f4d['indexOf']('Course:'),_0x4cd9c3=_0x5a9f4d['indexOf']('Semester');_0x24f5be!==-0x1&&(this['faculty']=_0x5a9f4d[_0x24f5be+0x1]?.['trim']()||this['faculty']);_0x5170a1!==-0x1&&(this['sy']=_0x5a9f4d[_0x5170a1+0x1]?.['trim']()||this['sy']);_0x1ed135!==-0x1&&(this['course']=_0x5a9f4d[_0x1ed135+0x1]?.['trim']()||this['course']);if(_0x4cd9c3!==-0x1){const _0x205e66=_0x5a9f4d[_0x4cd9c3+0x1]?.['trim']()||'',_0x5968c4=_0x205e66['match'](/\d+/)?.[0x0];this['semester']=_0x5968c4?parseInt(_0x5968c4,0xa):this['semester'];}});for(let _0x52e4e6=0x0;_0x52e4e6<=_0x2502eb['length'];_0x52e4e6++){const _0x1c35e2=_0x2502eb[_0x52e4e6];if(!_0x1c35e2)break;if(_0x52e4e6<=_0xaa03f0)continue;let _0x250579=_0x1c35e2[_0x3efc78-0x1]?.['trim']()||'',_0x1f6fc2=_0x1c35e2[_0x3efc78]?.['trim']()||'';/^\d+$/['test'](_0x1c35e2[_0x3efc78]?.['trim']()||'')&&(_0x250579=_0x1c35e2[_0x3efc78]?.['trim']()||'',_0x1f6fc2=_0x1c35e2[_0x3efc78+0x1]?.['trim']()||'');const _0x4dc0c3=_0x1c35e2[_0x3317a1]?.['replace'](/\s+/g,'\x20')['trim']()||'',{performance_target:_0x289d7b,passing_score:_0x2035d2}=performaceTarget(_0x4dc0c3);if(_0x1c35e2[_0x858ab5])_0x349710['table']['push']([_0x250579,_0x1f6fc2,_0x1c35e2[_0x858ab5]?.['trim']()||'',_0x1c35e2[_0xdac277]?.['replace'](/^ILO\d+[:.]?\s*/,'')['trim']()||'',[_0x289d7b,_0x2035d2]]);else break;}return {'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable.','data':_0x349710};}catch(_0x3d5e77){return {'success':![],'message':'Error\x20parsing\x20COAEP\x20table','error':_0x3d5e77};}}async['toJson'](){const _0x1e6c02=[],_0x315f4f=[],_0x32a7c1='COAEPDT_TO_JSON';try{await this['assertInitialized']();const _0x1a0dd0={'faculty':this['faculty'],'course':this['course'],'sy':this['sy'],'semester':this['semester'],'co':[]};let _0x23c078=null,_0x5a8f3c='',_0x40756d=[null,null];this['table']['forEach']((_0x23c600,_0x326aad)=>{if(_0x326aad===0x0&&!_0x23c600[0x1])_0x315f4f['push']({'error':'Cannot\x20have\x20empty\x20CO\x20Statement\x20in\x20first\x20row.','row':0x0,'column':0x1,'from':_0x32a7c1});_0x23c600[0x1]&&(_0x5a8f3c='',_0x40756d=[null,null]);const _0x3eaf5c=_0x23c600[0x1],_0x12a156=_0x23c600[0x2],_0x1ac04e=_0x23c600[0x3]||_0x5a8f3c,_0xff003=_0x23c600[0x4]||_0x40756d;if(!_0x12a156)_0x315f4f['push']({'error':'Cannot\x20have\x20empty\x20ILO.','row':0x1,'column':0x2,'from':_0x32a7c1});if(!_0x1ac04e)_0x315f4f['push']({'error':'Cannot\x20have\x20empty\x20Assessment\x20Tool.','row':_0x326aad,'column':0x3,'from':_0x32a7c1});if(!_0xff003)_0x315f4f['push']({'error':'Cannot\x20have\x20empty\x20Performance\x20Target.','row':_0x326aad,'column':0x4,'from':_0x32a7c1});if(_0x23c600[0x1]){const {cognitive_level:_0x2228e8,taxonomy_level:_0x555a46,verb:_0x35434a}=extractFromObjective(_0x3eaf5c),_0x257c4e={'statement':_0x3eaf5c,'ilo':[],'taxonomy_level':_0x555a46,'cognitive_level':_0x2228e8,'verb':_0x35434a};_0x23c078=_0x257c4e,_0x1a0dd0['co']['push'](_0x257c4e);}const {cognitive_level:_0x1a2baa,taxonomy_level:_0x2fea57,verb:_0x52815a}=extractFromObjective(_0x12a156),[_0x39a2e3,_0x4bf692]=_0xff003,_0x388ddb={'statement':_0x12a156,'assessment_tool':_0x1ac04e,'performance_target':_0x39a2e3,'passing_score':_0x4bf692,'cognitive_level':_0x1a2baa,'taxonomy_level':_0x2fea57,'verb':_0x52815a};_0x23c078['ilo']['push'](_0x388ddb);});if(_0x315f4f['length'])return _0x315f4f['push']({'error':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','from':_0x32a7c1}),{'success':![],'message':'Converted\x20COAEP\x20datatable\x20to\x20JSON,\x20but\x20with\x20errors.','data':{'jsonObj':_0x1a0dd0,'validMsgs':_0x1e6c02,'tableErrors':_0x315f4f}};return _0x1e6c02['push']('Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON.'),{'success':!![],'message':'Successfully\x20converted\x20COAEP\x20datatable\x20to\x20JSON','data':{'jsonObj':_0x1a0dd0,'validMsgs':_0x1e6c02,'tableErrors':_0x315f4f}};}catch(_0x152326){return _0x315f4f['push']({'error':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','from':_0x32a7c1}),{'success':![],'message':'Error\x20converting\x20COAEP\x20datatable\x20to\x20JSON','error':_0x152326,'data':{'jsonObj':null,'tableErrors':_0x315f4f}};}}['validateObjectiveGrammar'](_0x414b5e,_0x4b5cba,_0x3a306c,_0x59e3ed){const {cognitive_level:_0x2a6fad,taxonomy_level:_0x6707d9,verb:_0x4e37b0}=extractFromObjective(_0x414b5e),_0x1893a3=[];if(!_0x2a6fad)_0x1893a3['push']('cognitive_level');if(!_0x6707d9)_0x1893a3['push']('taxonomy_level');if(!_0x4e37b0)_0x1893a3['push']('verb');if(!_0x1893a3['length'])return;_0x59e3ed['push']({'error':'Cannot\x20find\x20fields:\x20'+_0x1893a3['join'](',\x20')+'.','row':_0x4b5cba,'column':_0x3a306c,'from':this['name']['toUpperCase']()+'_OBJ_GRAMMAR'});}}
|
|
57
|
+
|
|
58
|
+
class Client{['BASE_URL'];constructor(_0x4aae15){this['BASE_URL']=_0x4aae15;}['Parser'](){return {'curriculum':async _0x36d85b=>{const _0x1a9288=await uploadCurriculum(this['BASE_URL'],_0x36d85b);return _0x1a9288;},'courseOffering':async _0x266479=>{const _0x495ef9=await uploadCourseOffering(this['BASE_URL'],_0x266479);return _0x495ef9;},'coaep':async(_0x3e995a,_0x128506)=>{const _0x5338f4=await uploadCOAEP(this['BASE_URL'],_0x3e995a,_0x128506);return _0x5338f4;},'enrolledStudent':async _0xd04f77=>{const _0x12cd05=await uploadEnrolledStudent(this['BASE_URL'],_0xd04f77);return _0x12cd05;},'classlist':async(_0x9c81a5,_0x2b7e1e,_0x59e1bd)=>{const _0x3f99e5=await uploadClassList(this['BASE_URL'],_0x9c81a5,_0x2b7e1e,_0x59e1bd);return _0x3f99e5;},'assessmentData':async _0xae6573=>{const _0x471e53=await uploadAssessmentData(this['BASE_URL'],_0xae6573);return _0x471e53;},'deptFaculty':async _0x37a598=>{const _0x469177=await uploadDeptFaculty(this['BASE_URL'],_0x37a598);return _0x469177;},'poaep':async(_0xbad106,_0x5a9a77,_0x120ff3,_0x30be38)=>{const _0x45d33e=await uploadPOAEP(this['BASE_URL'],_0xbad106,_0x5a9a77,_0x120ff3,_0x30be38);return _0x45d33e;},'CoaepDT':CoaepDT};}}
|
|
57
59
|
|
|
58
60
|
export { Client as default };
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|