Import text format problem.

Import text format problem.

by Adam P -
Number of replies: 0
I recently developed a method of converting courses to Moodle 1.8 from Blackboard 6.3. A problem that i'm having, is that the summary is generated from the first 100 characters of the resource body. This means that if the resource body had some content that starts out like this:

"Here is some content. I hope that someone can help me solve this problem because I am having some difficulty with it. Moodle Forums are very active and helpful."

Then the summary would look like this:

"Here if some content. I hope that someone can help me solve this problem because I am having some diff"

You can see that the most undesirable thing is that the summaries end up being chopped off in the middle of words/sentences. I thought of a few possible solutions:

1: Delete the summary from the resources page or force it to be blank.
2: Extend the length of the summary from 100 chars to something larger.
3: Make the summary by reading until the first end of sentence character (period, exclamation, or question mark).

Idea 1 is something i'd like to use as a last resort.
Idea 2 just makes the string longer, it doesn't fix that it would often be cut off mid-sentence.
Idea 3 might work, but would involve using idea 2 as well to account for sentences greater than 100 characters in length.

Even if any of these would work, I'm unclear on the implementation. If anyone has any advice on how I should approach this, please let me know. Alternatively, if you have any other ideas on how to address this, I would be grateful.


There is also a second problem. The text for all of these files, both body and summary, is preformatted. More specifically, the text is originally very small and often doesn't include line breaks, letting the text run off of the page to the right, rather than wrapping and filling up the table. This can be fixed by going to the resource, clicking "update this resource," selecting all text from the summary/body and changing the text formatting drop-box from preformatted to normal. This gets incredibly tedious when converting large courses and I must find a way to fix it. I wonder if there is a way to force normal formatting or a script that would follow the same process involved in fixing it by hand?


I am a Computer Science student and just finished my junior year, I have experience programming, but not with php. Furthermore, I don't know the file structure of moodle very well. So if anyone makes a reference to some portion of code in moodle, would you please also list the filename containing the code? Thanks in advance.

-Adam


Average of ratings: -