djplaner / moodle-mod_bim

A Moodle activity module the provides support for managing/marking individual student blogs hosted on external services.
http://davidtjones.wordpress.com/research/bam-blog-aggregation-management/
7 stars 2 forks source link

Title of blog posts too long #12

Closed djplaner closed 14 years ago

djplaner commented 14 years ago

This post is an example of the problem

http://kathyfish.wordpress.com/2010/04/22/week-5-%E2%80%93-human-resource-information-systems-de-cieri-h-kramar-r-noe-ra-hollenbeck-jr-gerhart-b-wright-pm-2008-human-resource-information-systems-in-human-resource-m/

The student has given the post a title that is greater than 255 chars. This is the limit Moodle places on a simple char text field. So the insert doesn't work.

Two broad solutions are

  1. Change the field size so it is big
  2. Auto-limit the size of the title

I prefer #2 as #1 requires moving into "large" text fields with which I've had problems on Oracle.

2 could be done just after the feed parsing so that everything BIM ever sees about a post title is the reduced title size. I don't think limiting post titles to 255 chars should cause any problems.

Thoughts?

David.

ghost commented 14 years ago

+1 for 2. so as to distinguish between similarly titled posts, truncate the long title to leave the leading & trailing 120 or so characters and a few ... in the middle

djplaner commented 14 years ago

Alan, not sure how necessary this will be. The user will always have the complete URL and the body of the post to distinguish.

djplaner commented 14 years ago

Okay, this is done.

A simple truncate is being done on the title when the RSS is parsed, before it's inserted into the database. Text is truncated at about 252 characters. Will do it on a space and will insert a "..." to indicate truncation.

There's still an issue around the link to the item. This is much more important to get right as it is used as the unique identifier. Can't really truncate this. Suggests a need to expand/change the database field type.

The "clever" way to do this would be to use some form of URL shortner service. But that's adding more dependencies and more places for failure when external services are down. Will have to think about that seriously.