Main text last changed ............. Length: (Document started on 1 Oct 2010.) This is a WWW document maintained by Steve Draper, installed at .

Web site logical path: [www.psy.gla.ac.uk] [~steve] [this page]

By Steve Draper,   Department of Psychology,   University of Glasgow.

'; } function prpic2 ($url) { echo ''; } function prpiccell ($picname, $addlink) { global $ctable; echo ''; $url = '../spics/' . $picname; if ($addlink) { prpic2($url); } else { prpic($url); }; if ($ctable[$picname]) { $url = '../cpics/' . $ctable[$picname]; if ($addlink) { prpic2($url); } else { prpic($url); }; } echo '' . "\n"; } function prcell ($str) { echo ''; echo '

'; echo $str . '
' . "\n"; // DIV to wrap the contents, used by onclick // event's stopPropagation() // window.event.cancelBubble = true // handler return false; stops the default action in same handler fn. // Event.observe(element, eventName, handler) } function prcellpic ($str) { prpiccell($str, 0); } function mkcartoons() { // for each pic, add a cartoon global $ctable, $table; $cpicset = array(); $used = array(); foreach ($ctable as $key => $val) { $used[$val] = 1; } // read all cartoon names; into a hash/array exec("/bin/ls ../cpics", &$list); foreach ($list as $pic) { if (preg_match('/\.(gif|jpg|jpeg)/i', $pic) && (! preg_match('/lecturer.gif/i', $pic))) { $cpicset[] = $pic; }} // Rand function over them. Drop if already used. foreach ($table as $val) { $pic = $val[0]; if ($ctable[$pic]) continue; //$cpic = $cpicset[rand(0, 2)]; $cpic = $cpicset[rand(0, count($cpicset)-1)]; for ($i = 1; $i <= 10; $i++) { if ($used[$cpic]) $cpic = $cpicset[rand(0, count($cpicset)-1)]; } if ($used[$cpic]) continue; $ctable[$pic] = $cpic; $used[$cpic] = 1; } } function mktablecore($arr) { // This function does NOT output a whole table. // Must put tags in by hand; may insert extra rows by hand. global $table, $ctable; global $docartoons; if ($docartoons) { mkcartoons(); }; $tablencols = count($arr); // nmb rows in arr; cols in displayed table $tablefields = count($arr[0]); for ($i = 0; $i< $tablefields; $i++) { echo '' . "\n"; if ($i == 0) { foreach ($arr as $row) { prcellpic($row[0]); }; } else { foreach ($arr as $row) { prcell($row[$i]); }; }; echo '' . "\n"; }; // call prelim setting of pic vis. Or do this in java? } function inittables($cartoons) { // 1 or 0 global $table, $ctable, $docartoons; $table = array(); $ctable = array(); $docartoons = ($cartoons ? 1 : 0); } ?>

My level 4 students 2011-12

align="center" onclick="traceclick(this);">

Java error message area: