mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:53:25 +02:00
Fix DS new assignment feature
This commit is contained in:
parent
9ec2cf1ab9
commit
822244ef72
1 changed files with 14 additions and 5 deletions
|
@ -1148,13 +1148,22 @@ QJsonObject DomainServer::jsonObjectForNode(const SharedNodePointer& node) {
|
||||||
return nodeJson;
|
return nodeJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char ASSIGNMENT_SCRIPT_HOST_LOCATION[] = "resources/web/assignment";
|
QDir pathForAssignmentScriptsDirectory() {
|
||||||
|
static const QString SCRIPTS_DIRECTORY_NAME = "/scripts/";
|
||||||
|
|
||||||
|
QDir directory(ServerPathUtils::getDataDirectory() + SCRIPTS_DIRECTORY_NAME);
|
||||||
|
if (!directory.exists()) {
|
||||||
|
directory.mkpath(".");
|
||||||
|
qInfo() << "Created path to " << directory.path();
|
||||||
|
}
|
||||||
|
|
||||||
|
return directory;
|
||||||
|
}
|
||||||
|
|
||||||
QString pathForAssignmentScript(const QUuid& assignmentUUID) {
|
QString pathForAssignmentScript(const QUuid& assignmentUUID) {
|
||||||
QString newPath { ServerPathUtils::getDataDirectory() + "/" + QString(ASSIGNMENT_SCRIPT_HOST_LOCATION) };
|
QDir directory = pathForAssignmentScriptsDirectory();
|
||||||
newPath += "/scripts/";
|
|
||||||
// append the UUID for this script as the new filename, remove the curly braces
|
// append the UUID for this script as the new filename, remove the curly braces
|
||||||
newPath += uuidStringWithoutCurlyBraces(assignmentUUID);
|
return directory.absoluteFilePath(uuidStringWithoutCurlyBraces(assignmentUUID));
|
||||||
return newPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString URI_OAUTH = "/oauth";
|
const QString URI_OAUTH = "/oauth";
|
||||||
|
|
Loading…
Reference in a new issue