function filtercapture($str, &$res) { global $newdir, $imgcnt, $imasroot, $addmathabs, $mathimgurl, $filedir, $linktype; $str = forcefiltermath($str); $str = forcefiltergraph($str); $graphfiles = getgraphfilenames($str); foreach ($graphfiles as $f) { copy("../filter/graph/imgs/{$f}", $newdir . '/' . $filedir . $f); $resitem = '<resource href="' . $filedir . $f . '" identifier="RESwebcontentImage' . $imgcnt . '" type="webcontent">' . "\n"; $resitem .= ' <file href="' . $filedir . $f . '" />' . "\n"; $resitem .= '</resource>'; $res[] = $resitem; $imgcnt++; } if ($linktype == 'canvas') { $str = str_replace($imasroot . '/filter/graph/imgs/', '$IMS_CC_FILEBASE$/', $str); } else { $str = str_replace($imasroot . '/filter/graph/imgs/', '', $str); } if ($addmathabs) { $str = str_replace($mathimgurl, 'http://' . $_SERVER['HTTP_HOST'] . $mathimgurl, $str); } return $str; }
$useeditor = "message"; require "../header.php"; if ($_GET['sendtype'] == 'msg') { echo '<h2>New Message</h2>'; $to = "{$lastname}, {$firstname}"; } else { if ($_GET['sendtype'] == 'email') { echo '<h2>New Email</h2>'; $to = "{$lastname}, {$firstname} ({$email})"; } } if (isset($_GET['quoteq'])) { require "../assessment/displayq2.php"; $parts = explode('-', $_GET['quoteq']); $message = displayq($parts[0], $parts[1], $parts[2], false, false, 0, true); $message = printfilter(forcefiltergraph($message)); $message = preg_replace('/(`[^`]*`)/', "<span class=\"AM\">\$1</span>", $message); $message = '<p> </p><br/><hr/>' . $message; $courseid = $cid; if (isset($parts[3])) { //sending to instructor $query = "SELECT name FROM imas_assessments WHERE id='" . intval($parts[3]) . "'"; $result = mysql_query($query) or die("Query failed : {$query} " . mysql_error()); $title = 'Question about #' . ($parts[0] + 1) . ' in ' . str_replace('"', '"', mysql_result($result, 0, 0)); if ($_GET['to'] == 'instr') { unset($_GET['to']); $msgset = 1; //force instructor only list } } else { $title = '';
function getgraphfilename($str) { $str = forcefiltergraph($str); preg_match('/(\\w+\\.png)/', $str, $matches); return $matches[1]; }