I have been struggling with import errors on a large test bank exported from Examview in Blackboard format, importing the .dat, and finally came across this fix. However, it doesn't appear to have made it into the stable versions. I installed Moodle 1.9.12+ (Build: 20110609) on my desktop yesterday and the old code was in format.php. But the fix worked! Thank you, instead of hunting down and deleting errant questions one by one in a database of 10,000 questions they now import successfully. I export from my desktop and into our production server.
I also had problems with the question name in this and other test banks. Using the first 250 characters (or even 500 or more) of a question with large html tables of economic data as a question name, html tags were not closed when the text was truncated causing the view of the question name in categories to be nested and eventually nest itself into oblivion.
I am NOT a cod writer, I took a VB class in 1993. But I tried this in question/format/blackboard/format.php for each question type and it worked.
// put name in question object
$question->name = substr($question->questiontext, 0, 254);
With developer debugging turned on there are no errors reported in import and the display of the questions when building an exam or viewing in the categories is now usable.