Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Import/Export course/unit/... #42

Closed
2 tasks
utetrapp opened this issue May 1, 2017 · 6 comments · Fixed by #358, #403 or #800
Closed
2 tasks

Import/Export course/unit/... #42

utetrapp opened this issue May 1, 2017 · 6 comments · Fixed by #358, #403 or #800
Assignees
Labels
enhancement This issue improves geli future This issue will be solved in a another release

Comments

@utetrapp
Copy link
Collaborator

utetrapp commented May 1, 2017

User Story

As a:

teacher

I want:

import parts of a lecture to a new course

so that:

reuse existing stuff in another course or be able to start a new course in a new semester based on an existing course.

Storypoints:

Acceptance criteria:

  • Create a new course based on an existing course, unselect some units, copy all selected units into the just created course.
  • Within an existing course import/copy units from another course.

Additional info:

extends #183

Estimated:

  • 4 x 4hr
@aeimer aeimer added the enhancement This issue improves geli label May 10, 2017
@utetrapp utetrapp added the future This issue will be solved in a another release label Oct 26, 2017
@khase khase self-assigned this Nov 5, 2017
@d89
Copy link
Collaborator

d89 commented Nov 28, 2017

When exporting, this happens (for the shown test course):

image

{"name":"TypeError","message":"Cannot read property 'exportJSON' of null","stack":"TypeError: Cannot read property 'exportJSON' of null\n at Unit_1.Unit.findById.then (/usr/src/app/models/Lecture.js:61:29)\n at <anonymous>\n at process._tickDomainCallback (internal/process/next_tick.js:228:7)"}

When duplicating, this happens:

image

{"name":"InternalServerError","message":"Failed to duplicate course","stack":"Error\n at InternalServerError.HttpError [as constructor] (/usr/src/app/node_modules/routing-controllers/http-error/HttpError.js:27:23)\n at new InternalServerError (/usr/src/app/node_modules/routing-controllers/http-error/InternalServerError.js:20:28)\n at DuplicationController.<anonymous> (/usr/src/app/controllers/DuplicationController.js:39:34)\n at Generator.throw (<anonymous>)\n at rejected (/usr/src/app/controllers/DuplicationController.js:17:65)\n at <anonymous>\n at process._tickDomainCallback (internal/process/next_tick.js:228:7)\nCaused by: Cannot read property 'exportJSON' of null\nTypeError: Cannot read property 'exportJSON' of null\n at Unit_1.Unit.findById.then (/usr/src/app/models/Lecture.js:61:29)\n at <anonymous>\n at process._tickDomainCallback (internal/process/next_tick.js:228:7)"}

@d89 d89 reopened this Nov 28, 2017
@khase
Copy link
Collaborator

khase commented Nov 28, 2017

okay, just figured out the reason for this error. this Course contains some lectures which didn't got deleted cleanly.

Should be the same error for #183

@d89
Copy link
Collaborator

d89 commented Dec 4, 2017

Added criteria in the session on 2017-11-30:

  • Remove enroll key, whitelist and "active" flag in the export

@d89 d89 reopened this Dec 4, 2017
@khase khase added this to the 14.12.2017 milestone Dec 7, 2017
@lkskrt
Copy link
Contributor

lkskrt commented Jan 3, 2018

Closed by #419

@lkskrt lkskrt closed this as completed Jan 3, 2018
@d89
Copy link
Collaborator

d89 commented Jan 21, 2018

When I try to imort the course https://staging.geli.fbi.h-da.de/course/59fa100662fa9c00060bb3d2 (which I previously exported to the following JSON file, I get an error).

Dritter-Kurs-von-David.json.log

{"name":"InternalServerError","message":"Failed to import course","stack":"Error\n at InternalServerError.HttpError [as constructor] (/usr/src/app/node_modules/routing-controllers/http-error/HttpError.js:27:23)\n at new InternalServerError (/usr/src/app/node_modules/routing-controllers/http-error/InternalServerError.js:20:28)\n at Object.<anonymous> (/usr/src/app/models/Course.js:152:30)\n at Generator.throw (<anonymous>)\n at rejected (/usr/src/app/models/Course.js:5:65)\n at <anonymous>\n at process._tickDomainCallback (internal/process/next_tick.js:228:7)\nCaused by: Failed to import lecture\nError\n at InternalServerError.HttpError [as constructor] (/usr/src/app/node_modules/routing-controllers/http-error/HttpError.js:27:23)\n at new InternalServerError (/usr/src/app/node_modules/routing-controllers/http-error/InternalServerError.js:20:28)\n at Object.<anonymous> (/usr/src/app/models/Lecture.js:92:30)\n at Generator.throw (<anonymous>)\n at rejected (/usr/src/app/models/Lecture.js:5:65)\n at <anonymous>\n at process._tickDomainCallback (internal/process/next_tick.js:228:7)\nCaused by: Failed to import unit of type file\nError\n at InternalServerError.HttpError [as constructor] (/usr/src/app/node_modules/routing-controllers/http-error/HttpError.js:27:23)\n at new InternalServerError (/usr/src/app/node_modules/routing-controllers/http-error/InternalServerError.js:20:28)\n at Object.<anonymous> (/usr/src/app/models/units/Unit.js:82:30)\n at Generator.throw (<anonymous>)\n at rejected (/usr/src/app/models/units/Unit.js:5:65)\n at <anonymous>\n at process._tickDomainCallback (internal/process/next_tick.js:228:7)\nCaused by: file validation failed: fileUnitType: Path fileUnitTypeis required.\nValidationError: file validation failed: fileUnitType: PathfileUnitType is required.\n at new ValidationError (/usr/src/app/node_modules/mongoose/lib/error/validation.js:28:11)\n at model.Document.invalidate (/usr/src/app/node_modules/mongoose/lib/document.js:1675:32)\n at /usr/src/app/node_modules/mongoose/lib/document.js:1547:17\n at validate (/usr/src/app/node_modules/mongoose/lib/schematype.js:784:7)\n at /usr/src/app/node_modules/mongoose/lib/schematype.js:829:11\n at Array.forEach (<anonymous>)\n at SchemaString.SchemaType.doValidate (/usr/src/app/node_modules/mongoose/lib/schematype.js:789:19)\n at /usr/src/app/node_modules/mongoose/lib/document.js:1545:9\n at _combinedTickCallback (internal/process/next_tick.js:131:7)\n at process._tickDomainCallback (internal/process/next_tick.js:218:9)"}

@d89 d89 reopened this Jan 21, 2018
@PatrickSkowronek PatrickSkowronek removed this from the 14.12.2017 milestone Apr 9, 2018
@HPunktOchs HPunktOchs self-assigned this May 21, 2018
@HPunktOchs
Copy link
Collaborator

Its the bsontype= "ObjectId" which leads to failures. This contains all Courses which have fileunits and all courses that contain references in the Mediamanager. Also, some Courses have leftover References in the "media" section (on export in the json) but none visible in the GUI.
Also, the concept of just referencing Media files seems a bit problmatic in some aspects. Maybe we shouldnt be able to export media-units for now. Or on Import, we should just create "empty" file units with description and the name as placeholder.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement This issue improves geli future This issue will be solved in a another release
Projects
None yet
7 participants