Copy course content - desire2learn

We have set up "master" templates for each of our courses. These templates contain both structure and content of each course.
I want automate the creating of the courses at the commencement of each semester, based on our timetable information.
I have got Valance to the point of creating a course from a template. From what I can see in the documentation it looks like I will have to parse the content of the template and copy individual items across to the unique courses.
Is this correct, or is there a simple way to copy the entire content from the template across to the actual course instance?

Content assigned to a course template does not get copied into a newly created course offering that lists the template as its CourseTemplate. If you want to store content in a course template and then copy it into a new course associated with that template, you can use the course content APIs to inquire about the template's content structure, and replicate it in the newly created course: the Content.ContentObjectData JSON blocks you use to create new content structure are a superset of the Content.ContentObject JSON blocks you see when you ask about the content structure.
Unfortunately, because of the rules around an org unit's file content store, we really don't recommend that you put actual file data into a course template's content store, because there's no easy way to refer to them from child course offerings, or copy them remotely into the child course offering's content space.
If you do store file data in the template's content space and want to put it into child course offerings, you need to fetch it from the LMS to the client and re-upload it into the new course offering.
You may get more leverage out of storing common course data objects in Desire2Learn's Learning Object Repository where what you put into the course template/offering's content structure are links, not files.

The answer seems to be that there is no simple way of bulk copying all the content from a template to a course offering using the Valence API.
I had a go at doing it by traversing the content structure by accessing the TOC object from the template then copying each individual module and topic in the structure.
Unfortunately this is made all the more difficult by the fact that the API doesn't return the id of the module or topic created. So, when it comes to adding the nested content objects, you have to requery the current course modules to find the object you just added.
At that point it has become all too hard and we're going to automate the creation of course offerings from the template, but advise teachers to use the built in Import/Export/Copy Components feature to copy the content from the template into the course offering.

Related

Trying to create basic blog posts in Umbraco

I've been trying for hours now to add blog posts into our site through the Umbraco back office. It feels so unintuitive how everything works and I'm beginning to get very frustrated, here's what I'm trying to do/have done:
I create a document type, "BlogPost", it contains data that can be entered in a content node relating to the blog post, description, title, etc.
I create a document type, "BlogPage", as a document type to be used as a root content node, which will hold all the BlogPost content nodes, that way I can simply loop through them and render each one on our site
I go to create the BlogPost content node, and it assigns it an url of "/", which simply redirects to the home page
What I don't understand is how am I supposed to just get data that was entered in Umbraco for my view? We have an extremely stylized theme for our site, so I can't use things like Articulate, and I shouldn't have to, all I want to do is store a collection of blog posts together, pull that data from Umbraco, and load it into an ASP.NET view, but there is absolutely zero documentation or examples of how to do this online, I would be incredibly grateful if someone could point me in the right direction on how I should go about doing what I'm trying to do.
If I understand correctly you are developing a blog section on an existing website. First thing to do is inderdaad create a new documenttype for the blogpost itself and add a documenttype for the container of blogposts.
Did you create new templates for these documenttypes? You can find some documentation on templates here
Inside the template you'll want to query data from Umbraco. Information about querying data is available here
Next up is adding the newly created templates to the documenttypes and you're ready to create your content.
Make sure that for the content you create the template is set (see Properties tab), here you can also see the url Umbraco created for the content.
Did you start the Umbraco website from scratch or are you developing on an existing website? Because a blogpost should not redirect to / by default, unless it's the root node of your website. This sounds like custom functiality. Maybe a rewrite or error handling module?
Edit: Also some information on how to get started with templating in Umbraco is available here

orchard contenttype get data from 2 different databases

My situation is that i have an external database and i should present the information in an orchard hp. The customer wants also to set new information and both should be shown via projection.
Short with simple example type book:
Books are in an external db.
Books should be set in orchard, in the orchard-db not in the external-db.
The query - projection should get both books-entities and displayed.
Is there a simple orchard-way to implement my problem?
Unfortunately, I did not find any sample for what ... Any suggestions?
Thank you
From what you've described I understand that in short you want to manage some data from an external data source as Orchard content items. This is well possible, it needs the following to happen:
Create a content type for your data.
Periodically pull in changes from the external data source.
Programmatically create content items of your new type from the data pulled in.
Since this is not an everyday scenario I don't know of any tutorials out there for this although there is at least one sample: the External Pages module does pretty much this, by pulling in Markdown pages from a Mercurial repo.

Saving html to 'manage files'

I have an external editable html file (using blocks of contentEditable="true") linked in the table of contents. Using Valence, could I save the edited contents of that file to the 'Manage Files' section of that course? Started reading through the Valence docs, but thought i'd ask here before wasting too much time there. Thanks, S
I'm not quite sure what exactly your meaning. Currently, the only direct access that you have to course content through the Valence Learning Framework APIs is via the course content module-topic structure. The URL property associated with an uploaded topic file situates it within the "manage files" tree, and you can use this property to fetch the contents of a topic from the structure.
There are no API calls to in-place update the contents of a topic file; to update it, you must fetch it, delete the topic, then re-upload the updated file content to a new topic node. This may leave behind the previous topic file, unlinked from the content structure.
The current course content API design proceeds from the user scenario of roughing out the framework for a new course's content, and not necessarily maintaining or changing that course content over time. Enhancement to the course content APIs to more comfortably accomodate additional use-cases is on the roadmap, but is not currently fully scheduled and fleshed out.

Basic database (MongoDB) performance question

I'm building a web app for bookmark storage with a directory system.
I've already got these collections set up:
Path(s)
---> Directories (embedded documents)
---> Links (embedded documents)
User(s)
So performance wise, should I:
- add the user id to the created path
- embed the whole Paths collection into the specific user
I want to pick option 2, but yeah, I dunno...
EDIT:
I was also thinking about making the whole interface ajaxified. So, that means I'll load the directories and links from a specific path (from the logged in user) through ajax. That way, it's faster and I don't have to touch the user collection. Maybe that changes things?
Like I've said in the comments, 1 huge collection in the whole database seems kinda strange. Right?
Well the main purpose of the mongoDB is to support redundant data.I will recommend second option is better because In your scenario what I feel that if you embed path collection into the specific user then by using only single query you can get all data about user as well as related to path collection as well.
And if you follow first option then you have to fire two separates queries to get all data which will increase your work somewhat.
As mongodb brings data into the RAM so after getting data from one collection you can store it into cursor and from that cursor data you can fetch data from another collection. So if we see performance wise I dont think it will affect a lot.
RE: the edit. If you are going to store everything in a single doc and use embedded docs, then when you make your queries make sure you just select the data you need, otherwise you will load the whole doc including the embedded docs.

Creating custom content sections with umbraco

I'm working on an umbraco website just now and one of the requirements is to have a custom section in the back end that can be used to manage publish smaller micro-sites.
I have been able to create the new section and added some nodes to it. What I can't get to work is publishing them and making them viewable at the correct url.
As an example, say i have created a new section called microsite, inside that there is a folder called myportfolio. this should route to something like www.myumbracosite.com/microsite/myportfolio.
Does anyone know how to get this sort of thing working? Is it even possible to publish content from outsite of the main content section?
Any help would be greatly apprechiated.
Kind Regards
Colin G
From my understanding the custom sections are for linking to custom databases or data somewhere that needs an interface.
That said, you can use UrlRewriting and an existing content page with a macro to do something like that.
If you had a page called microsite, then using UrlRewriting you could make the parameter passed in to microsite.aspx (a content page in Umbraco) be "myportfolio".
With a user control on the microsite template it could display some content from your external database (or wherever your custom section stores it).
Not sure that's what you're looking for...
Why are you trying to create a new section for more content? The current Umbraco content area has all kinds of permissions for both users and members. Are the microsites all in the same install of Umbraco?
Another option is that the custom section could simply be used as a setup wizard for the new sites. You could create new content and users in their normal places and just use the new section to create them. It's not too hard to create content from C#, so it would probably be the same as doing it from a user control.
Could you provide a little more info?

Resources