@citolab/qti-backend-firebase 0.0.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/LICENSE.md +674 -0
- package/dist/api/app-specific/base/application-specific-base.d.ts +45 -0
- package/dist/api/app-specific/base/application-specific-base.d.ts.map +1 -0
- package/dist/api/app-specific/base/application-specific-base.js +503 -0
- package/dist/api/app-specific/base/application-specific-base.js.map +1 -0
- package/dist/api/app-specific/base/cheerio-helper.d.ts +5 -0
- package/dist/api/app-specific/base/cheerio-helper.d.ts.map +1 -0
- package/dist/api/app-specific/base/cheerio-helper.js +16 -0
- package/dist/api/app-specific/base/cheerio-helper.js.map +1 -0
- package/dist/api/app-specific/baseImplementation.d.ts +6 -0
- package/dist/api/app-specific/baseImplementation.d.ts.map +1 -0
- package/dist/api/app-specific/baseImplementation.js +11 -0
- package/dist/api/app-specific/baseImplementation.js.map +1 -0
- package/dist/api/app-specific/index.d.ts +4 -0
- package/dist/api/app-specific/index.d.ts.map +1 -0
- package/dist/api/app-specific/index.js +4 -0
- package/dist/api/app-specific/index.js.map +1 -0
- package/dist/api/app-specific/interface/IApplicationSpecific.d.ts +31 -0
- package/dist/api/app-specific/interface/IApplicationSpecific.d.ts.map +1 -0
- package/dist/api/app-specific/interface/IApplicationSpecific.js +2 -0
- package/dist/api/app-specific/interface/IApplicationSpecific.js.map +1 -0
- package/dist/api/app-specific/specific.d.ts +1 -0
- package/dist/api/app-specific/specific.d.ts.map +1 -0
- package/dist/api/app-specific/specific.js +31 -0
- package/dist/api/app-specific/specific.js.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +15 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/qti-data.d.ts +4 -0
- package/dist/api/qti-data.d.ts.map +1 -0
- package/dist/api/qti-data.js +622 -0
- package/dist/api/qti-data.js.map +1 -0
- package/dist/api/qti-resources.d.ts +4 -0
- package/dist/api/qti-resources.d.ts.map +1 -0
- package/dist/api/qti-resources.js +348 -0
- package/dist/api/qti-resources.js.map +1 -0
- package/dist/api/qti-teacher.d.ts +6 -0
- package/dist/api/qti-teacher.d.ts.map +1 -0
- package/dist/api/qti-teacher.js +807 -0
- package/dist/api/qti-teacher.js.map +1 -0
- package/dist/api/qti-tools.d.ts +3 -0
- package/dist/api/qti-tools.d.ts.map +1 -0
- package/dist/api/qti-tools.js +450 -0
- package/dist/api/qti-tools.js.map +1 -0
- package/dist/console.d.ts +2 -0
- package/dist/console.d.ts.map +1 -0
- package/dist/console.js +30 -0
- package/dist/console.js.map +1 -0
- package/dist/express-test.d.ts +2 -0
- package/dist/express-test.d.ts.map +1 -0
- package/dist/express-test.js +19 -0
- package/dist/express-test.js.map +1 -0
- package/dist/helpers/ci-bootstap.d.ts +4 -0
- package/dist/helpers/ci-bootstap.d.ts.map +1 -0
- package/dist/helpers/ci-bootstap.js +96 -0
- package/dist/helpers/ci-bootstap.js.map +1 -0
- package/dist/helpers/database.d.ts +110 -0
- package/dist/helpers/database.d.ts.map +1 -0
- package/dist/helpers/database.js +151 -0
- package/dist/helpers/database.js.map +1 -0
- package/dist/helpers/db.d.ts +3 -0
- package/dist/helpers/db.d.ts.map +1 -0
- package/dist/helpers/db.js +10 -0
- package/dist/helpers/db.js.map +1 -0
- package/dist/helpers/endpoint-helpers.d.ts +33 -0
- package/dist/helpers/endpoint-helpers.d.ts.map +1 -0
- package/dist/helpers/endpoint-helpers.js +149 -0
- package/dist/helpers/endpoint-helpers.js.map +1 -0
- package/dist/helpers/firebase.d.ts +7 -0
- package/dist/helpers/firebase.d.ts.map +1 -0
- package/dist/helpers/firebase.js +15 -0
- package/dist/helpers/firebase.js.map +1 -0
- package/dist/helpers/index.d.ts +11 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +11 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/local-helpers.d.ts +2 -0
- package/dist/helpers/local-helpers.d.ts.map +1 -0
- package/dist/helpers/local-helpers.js +11 -0
- package/dist/helpers/local-helpers.js.map +1 -0
- package/dist/helpers/logic.d.ts +73 -0
- package/dist/helpers/logic.d.ts.map +1 -0
- package/dist/helpers/logic.js +759 -0
- package/dist/helpers/logic.js.map +1 -0
- package/dist/helpers/package-upload.d.ts +16 -0
- package/dist/helpers/package-upload.d.ts.map +1 -0
- package/dist/helpers/package-upload.js +160 -0
- package/dist/helpers/package-upload.js.map +1 -0
- package/dist/helpers/package.d.ts +32 -0
- package/dist/helpers/package.d.ts.map +1 -0
- package/dist/helpers/package.js +373 -0
- package/dist/helpers/package.js.map +1 -0
- package/dist/helpers/request-headers.d.ts +27 -0
- package/dist/helpers/request-headers.d.ts.map +1 -0
- package/dist/helpers/request-headers.js +144 -0
- package/dist/helpers/request-headers.js.map +1 -0
- package/dist/helpers/storage.d.ts +10 -0
- package/dist/helpers/storage.d.ts.map +1 -0
- package/dist/helpers/storage.js +132 -0
- package/dist/helpers/storage.js.map +1 -0
- package/dist/helpers/utils.d.ts +42 -0
- package/dist/helpers/utils.d.ts.map +1 -0
- package/dist/helpers/utils.js +228 -0
- package/dist/helpers/utils.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +14 -0
- package/dist/main.js.map +1 -0
- package/package.json +101 -0
- package/readme.md +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseImplementation.js","sourceRoot":"","sources":["../../../src/api/app-specific/baseImplementation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB;IAC7D,EAAE,GAAG,MAAM,CAAC;IAEZ,YAAY,EAAW;QACrB,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,EAAE,CAAC;YACP,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/app-specific/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/app-specific/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SessionInfoTeacher, StudentAppSessionInfo, ExtendedTestContext, AssessmentInfo, SessionStateType } from "@citolab/qti-api";
|
|
2
|
+
import { ItemContext } from "@citolab/qti-components/exports/item.context.js";
|
|
3
|
+
import { DATABASE } from "../../../helpers/database";
|
|
4
|
+
export interface IApplicationSpecific {
|
|
5
|
+
id: string;
|
|
6
|
+
db: DATABASE;
|
|
7
|
+
packageAsQti: boolean;
|
|
8
|
+
xmlFromDatabase: boolean;
|
|
9
|
+
getCodeByUserId: (userId: string, assessmentId: string) => Promise<string>;
|
|
10
|
+
getInitialSessionState: (assessmentInfo: AssessmentInfo) => SessionStateType;
|
|
11
|
+
createSessionInfoForStudent: (config: {
|
|
12
|
+
userId: string;
|
|
13
|
+
assessmentId?: string;
|
|
14
|
+
identification?: string;
|
|
15
|
+
metadata?: unknown;
|
|
16
|
+
}) => Promise<StudentAppSessionInfo>;
|
|
17
|
+
getSessionInfoForStudent: (userId: string, assessmentId?: string, identification?: string) => Promise<StudentAppSessionInfo | null>;
|
|
18
|
+
getAssessmentInfo: (assessmentId: string, studentCode?: string) => Promise<AssessmentInfo>;
|
|
19
|
+
convertPackageAndAddToDatabase: (packageLocation: string, assetUrl: string, extraInfo?: {
|
|
20
|
+
assessmentId?: string;
|
|
21
|
+
prefixAssessmentId?: string;
|
|
22
|
+
packageId?: string;
|
|
23
|
+
packageName?: string;
|
|
24
|
+
addToPractice?: boolean;
|
|
25
|
+
}) => Promise<AssessmentInfo[]>;
|
|
26
|
+
updateItemStats(teacherId: string, assessmentId: string, studentId: string, itemContext: ItemContext[], target: "teacher" | "reviewer", batch: FirebaseFirestore.WriteBatch): Promise<void>;
|
|
27
|
+
updateStudentStats(code: string, assessmentId: string, teacherId: string, testContext: ExtendedTestContext, batch: FirebaseFirestore.WriteBatch): Promise<void>;
|
|
28
|
+
testContextToTeacher: (code: string, assessmentId: string, testContext: ExtendedTestContext, batch: FirebaseFirestore.WriteBatch) => Promise<void>;
|
|
29
|
+
updatePlannedSession: (teacherId: string, code: string, updatedSession: SessionInfoTeacher, batch: FirebaseFirestore.WriteBatch) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=IApplicationSpecific.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IApplicationSpecific.d.ts","sourceRoot":"","sources":["../../../../src/api/app-specific/interface/IApplicationSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,QAAQ,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IAEzB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3E,sBAAsB,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,gBAAgB,CAAC;IAE7E,2BAA2B,EAAE,CAAC,MAAM,EAAE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MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,mBAAmB,EAChC,KAAK,EAAE,iBAAiB,CAAC,UAAU,KAChC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB,oBAAoB,EAAE,CACpB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,kBAAkB,EAClC,KAAK,EAAE,iBAAiB,CAAC,UAAU,KAChC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IApplicationSpecific.js","sourceRoot":"","sources":["../../../../src/api/app-specific/interface/IApplicationSpecific.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=specific.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specific.d.ts","sourceRoot":"","sources":["../../../src/api/app-specific/specific.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { BaseImplementation } from "./baseImplementation";
|
|
3
|
+
// import { IApplicationSpecific } from "./interface/IApplicationSpecific";
|
|
4
|
+
// // Registry for application-specific implementations
|
|
5
|
+
// const implementationRegistry = new Map<string, IApplicationSpecific>();
|
|
6
|
+
// /**
|
|
7
|
+
// * Allows consumers to register their custom implementations.
|
|
8
|
+
// * @param applicationId - The unique identifier for the application.
|
|
9
|
+
// * @param implementation - The implementation logic for the application.
|
|
10
|
+
// */
|
|
11
|
+
// export const registerImplementation = (
|
|
12
|
+
// applicationId: string,
|
|
13
|
+
// implementation: IApplicationSpecific
|
|
14
|
+
// ): void => {
|
|
15
|
+
// implementationRegistry.set(applicationId, implementation);
|
|
16
|
+
// };
|
|
17
|
+
// /**
|
|
18
|
+
// * Retrieves the specific implementation for the given application ID.
|
|
19
|
+
// * @param applicationId - The unique identifier for the application.
|
|
20
|
+
// * @returns The application-specific implementation.
|
|
21
|
+
// */
|
|
22
|
+
// export const getSpecificImplementation = (
|
|
23
|
+
// applicationId: string
|
|
24
|
+
// ): IApplicationSpecific => {
|
|
25
|
+
// const implementation = implementationRegistry.get(applicationId);
|
|
26
|
+
// if (implementation) {
|
|
27
|
+
// return implementation;
|
|
28
|
+
// }
|
|
29
|
+
// return new BaseImplementation(applicationId); // Default implementation
|
|
30
|
+
// };
|
|
31
|
+
//# sourceMappingURL=specific.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specific.js","sourceRoot":"","sources":["../../../src/api/app-specific/specific.ts"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,2EAA2E;AAE3E,uDAAuD;AACvD,0EAA0E;AAE1E,MAAM;AACN,gEAAgE;AAChE,uEAAuE;AACvE,2EAA2E;AAC3E,MAAM;AACN,0CAA0C;AAC1C,2BAA2B;AAC3B,yCAAyC;AACzC,eAAe;AACf,+DAA+D;AAC/D,KAAK;AAEL,MAAM;AACN,yEAAyE;AACzE,uEAAuE;AACvE,uDAAuD;AACvD,MAAM;AACN,6CAA6C;AAC7C,0BAA0B;AAC1B,+BAA+B;AAC/B,sEAAsE;AACtE,0BAA0B;AAC1B,6BAA6B;AAC7B,MAAM;AACN,4EAA4E;AAC5E,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,GAAG,6CAAY,CAAC;AAStB,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import cors from 'cors';
|
|
2
|
+
import express from 'express';
|
|
3
|
+
import { addQtiDataEndpoints } from './qti-data';
|
|
4
|
+
import { addQtiResourcesEndpoint } from './qti-resources';
|
|
5
|
+
import { addQtiTeacherEndpoints } from './qti-teacher';
|
|
6
|
+
// EXAMPLE EXPRESS SERVER SETUP
|
|
7
|
+
const app = express();
|
|
8
|
+
app.use(cors({ origin: true }));
|
|
9
|
+
app.use(express.json());
|
|
10
|
+
// qti endpoints
|
|
11
|
+
addQtiResourcesEndpoint(app);
|
|
12
|
+
addQtiDataEndpoints(app);
|
|
13
|
+
addQtiTeacherEndpoints(app);
|
|
14
|
+
export default app;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,+BAA+B;AAE/B,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAChC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExB,gBAAgB;AAChB,uBAAuB,CAAC,GAAG,CAAC,CAAC;AAC7B,mBAAmB,CAAC,GAAG,CAAC,CAAC;AACzB,sBAAsB,CAAC,GAAG,CAAC,CAAC;AAE5B,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qti-data.d.ts","sourceRoot":"","sources":["../../src/api/qti-data.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAY,MAAM,SAAS,CAAC;AAiB5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGtD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,EACZ,sBAAsB,GAAE,oBAA+C,QA4wBxE"}
|