Permalink
Browse files

quiz item analysis report: MDL-13427 <br> tags in the headers of some…

… columns.
  • Loading branch information...
tjhunt
tjhunt committed Nov 27, 2008
1 parent 772b941 commit 2207d52d32f1cd4fab39deb9cfed1b3bf3a84af2
Showing with 10 additions and 2 deletions.
  1. +10 −2 mod/quiz/report/analysis/report.php
@@ -523,6 +523,10 @@ function Export_Excel(&$questions, $filename) {
get_string('facilitytitle','quiz_analysis'), get_string('stddevtitle','quiz_analysis'),
get_string('dicsindextitle','quiz_analysis'), get_string('disccoefftitle','quiz_analysis'));
+ foreach ($headers as $key => $header) {
+ $headers[$key] = preg_replace('/<br[^>]*>/', ' ', $header);
+ }
+
$col = 0;
foreach ($headers as $item) {
$myxls->write(2,$col,$item,$formatbc);
@@ -578,8 +582,8 @@ function Export_OOo(&$questions, $filename) {
get_string('facilitytitle','quiz_analysis'), get_string('stddevtitle','quiz_analysis'),
get_string('dicsindextitle','quiz_analysis'), get_string('disccoefftitle','quiz_analysis'));
- foreach($headers as $key=>$header){
- $headers[$key] = eregi_replace ("<br?>", " ",$header);
+ foreach ($headers as $key => $header) {
+ $headers[$key] = preg_replace('/<br[^>]*>/', ' ', $header);
}
$data = array();
@@ -604,6 +608,10 @@ function Export_CSV(&$questions, $filename) {
get_string('facilitytitle','quiz_analysis'), get_string('stddevtitle','quiz_analysis'),
get_string('dicsindextitle','quiz_analysis'), get_string('disccoefftitle','quiz_analysis'));
+ foreach ($headers as $key => $header) {
+ $headers[$key] = preg_replace('/<br[^>]*>/', ' ', $header);
+ }
+
$text = implode("\t", $headers)." \n";
$filename .= ".txt";

0 comments on commit 2207d52

Please sign in to comment.