Skip to content
Snippets Groups Projects
Commit 7ec7dc9d authored by Thomas Hackl's avatar Thomas Hackl
Browse files

Resolve "Import einer als ZIP exportierten Courseware beachtet die Sortierung der Seiten nicht"

Closes #3166

Merge request studip/studip!2622
parent 207b3487
No related branches found
No related tags found
No related merge requests found
......@@ -351,6 +351,7 @@ export default {
}
}
};
this.sortChildren(this.loadedZipData.courseware.children);
await this.createCoursewareUnit(unit, { root: true });
const newElementId = this.lastCreateCoursewareUnit.relationships['structural-element'].data.id;
await this.loadStructuralElementById({ id: newElementId });
......@@ -371,6 +372,14 @@ export default {
this.requirements.push({slot: slot, text: text});
}
}
},
sortChildren(children) {
children?.sort((a, b) => {
return a.attributes.position - b.attributes.position;
});
children?.forEach(child => {
this.sortChildren(child.children);
});
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment