Skip to content
Merged

0.7.3 #164

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class WorkspaceFilesService {
}

private async processTestTaker(testTaker: FileUpload): Promise<ValidationData | null> {
const xmlDocument = cheerio.load(testTaker.data, { xmlMode: true, recognizeSelfClosing: true });
const xmlDocument = cheerio.load(testTaker.data, { xml: true });
const bookletTags = xmlDocument('Booklet');
const unitTags = xmlDocument('Unit');

Expand Down Expand Up @@ -281,8 +281,8 @@ export class WorkspaceFilesService {
}

private extractXmlData(
bookletTags: cheerio.Cheerio<cheerio.Element>,
unitTags: cheerio.Cheerio<cheerio.Element>
bookletTags: cheerio.Cheerio<any>,
unitTags: cheerio.Cheerio<any>
): {
uniqueBooklets: Set<string>;
uniqueUnits: Set<string>;
Expand Down Expand Up @@ -434,7 +434,7 @@ export class WorkspaceFilesService {
}

const xmlContent = file.buffer.toString('utf8');
const xmlDocument = cheerio.load(file.buffer.toString('utf8'), { xmlMode: true, recognizeSelfClosing: true });
const xmlDocument = cheerio.load(file.buffer.toString('utf8'), { xml: true });
const firstChild = xmlDocument.root().children().first();
const rootTagName = firstChild ? firstChild.prop('tagName') : null;

Expand Down Expand Up @@ -911,7 +911,7 @@ export class WorkspaceFilesService {
extractCodingSchemeRef(xmlContent: string): string | null {
try {
// Verwende cheerio, um das XML zu parsen
const $ = cheerio.load(xmlContent, { xmlMode: true, recognizeSelfClosing: true });
const $ = cheerio.load(xmlContent, { xml: true });

// Suche nach dem CodingSchemeRef-Tag
const codingSchemeRefTag = $('CodingSchemeRef');
Expand Down
180 changes: 123 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coding-box",
"version": "0.7.2",
"version": "0.7.3",
"author": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen",
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -47,7 +47,7 @@
"adm-zip": "^0.5.9",
"ajv": "^8.17.1",
"ajv-keywords": "^5.1.0",
"cheerio": "^1.0.0-rc.12",
"cheerio": "^1.1.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"fast-csv": "^5.0.1",
Expand Down