示例#1
0
writeHtmlSelected($timefilter, 2);
echo ">last 2 hours</option>";
echo "<option value=4 ";
writeHtmlSelected($timefilter, 4);
echo ">last 4 hours</option>";
echo "<option value=24 ";
writeHtmlSelected($timefilter, 24);
echo ">last day</option>";
echo "<option value=168 ";
writeHtmlSelected($timefilter, 168);
echo ">last week</option>";
echo "<option value=720 ";
writeHtmlSelected($timefilter, 720);
echo ">last month</option>";
echo "<option value=8760 ";
writeHtmlSelected($timefilter, 8760);
echo ">last year</option>";
echo "</select>";
echo " Last name: <input type=text id=\"lnfilter\" value=\"{$lnfilter}\" />";
echo "<input type=button value=\"Filter by name\" onclick=\"chglnfilter()\" />";
echo "</div>";
$gbt = gbinstrdisp();
echo "</form>";
echo "</div>";
require "../footer.php";
//echo "Meanings:  IP-In Progress, OT-overtime, PT-practice test, EC-extra credit, NC-no credit<br/><sup>*</sup> Has feedback, <sub>d</sub> Dropped score\n";
echo "Meanings:   NC-no credit";
/*if ($isteacher) {
	echo "<div class=cp>";
	echo "<a href=\"addgrades.php?cid=$cid&gbitem=new&grades=all\">Add Offline Grade</a><br/>";
	echo "<a href=\"gradebook.php?stu=$stu&cid=$cid&export=true\">Export Gradebook</a><br/>";
示例#2
0
		<span class="formright">
		<select id="linktype" name="linktype" onchange="linktypeupdate(this)">
			<option value="text" <?php 
    writeHtmlSelected($type, 'text');
    ?>
>Page of text</option>
			<option value="web" <?php 
    writeHtmlSelected($type, 'web');
    ?>
>Web link</option>
			<option value="file" <?php 
    writeHtmlSelected($type, 'file');
    ?>
>File</option>
			<option value="tool" <?php 
    writeHtmlSelected($type, 'tool');
    ?>
>External Tool</option>
		</select>
		</span><br class="form"/>
		
		<div id="textinput" <?php 
    if ($type != 'text') {
        echo 'style="display:none;"';
    }
    ?>
 >
			Text<BR>
			<div class=editor>
				<textarea cols=80 rows=20 id=text name=text style="width: 100%"><?php 
    echo htmlentities($line['text']);
示例#3
0
    ?>
			</span><br class=form>
			
			<span class=form>Show answer entry tips?</span>
			<span class=formright>
				<select name="showtips">
					<option value="0" <?php 
    writeHtmlSelected($line['showtips'], 0);
    ?>
>No</option>
					<option value="1" <?php 
    writeHtmlSelected($line['showtips'], 1);
    ?>
>Yes, after question</option>
					<option value="2" <?php 
    writeHtmlSelected($line['showtips'], 2);
    ?>
>Yes, under answerbox</option>
				</select>
			</span><br class=form>
			
			<span class=form>Allow use of LatePasses?: </span>
			<span class=formright>
				<?php 
    writeHtmlSelect("allowlate", $page_allowlateSelect['val'], $page_allowlateSelect['label'], $line['allowlate'] % 10);
    ?>
				<label><input type="checkbox" name="latepassafterdue" <?php 
    writeHtmlChecked($line['allowlate'] > 10, true);
    ?>
> Allow LatePasses after due date, within 1 LatePass period</label>
			</span><BR class=form> 
示例#4
0
function gbinstrdisp()
{
    global $hidenc, $showpics, $isteacher, $istutor, $cid, $gbmode, $stu, $availshow, $catfilter, $secfilter, $totonleft, $imasroot, $isdiag, $tutorsection, $avgontop, $hidelocked, $colorize, $urlmode, $overridecollapse, $includeduedate, $lastlogin;
    $curdir = rtrim(dirname(__FILE__), '/\\');
    if ($availshow == 4) {
        $availshow = 1;
        $hidepast = true;
    }
    $gbt = gbtable();
    if ($avgontop) {
        $avgrow = array_pop($gbt);
        array_splice($gbt, 1, 0, array($avgrow));
    }
    //print_r($gbt);
    //echo "<script type=\"text/javascript\" src=\"$imasroot/javascript/tablesorter.js\"></script>\n"; in placeinhead
    echo "<div id=\"tbl-container\">";
    echo '<div id="bigcontmyTable"><div id="tblcontmyTable">';
    echo '<table class="gb" id="myTable"><thead><tr>';
    $sortarr = array();
    for ($i = 0; $i < count($gbt[0][0]); $i++) {
        //biographical headers
        if ($i == 1) {
            echo '<th><div>&nbsp;</div></th>';
            $sortarr[] = 'false';
        }
        //for pics
        if ($i == 1 && $gbt[0][0][1] != 'ID') {
            continue;
        }
        if ($gbt[0][0][$i] == 'Section' || $gbt[0][0][$i] == 'Code' || $gbt[0][0][$i] == 'Last Login') {
            echo '<th class="nocolorize"><div>';
        } else {
            echo '<th><div>';
        }
        echo $gbt[0][0][$i];
        if (($gbt[0][0][$i] == 'Section' || $isdiag && $i == 4) && (!$istutor || $tutorsection == '')) {
            echo "<br/><select id=\"secfiltersel\" onchange=\"chgsecfilter()\"><option value=\"-1\" ";
            if ($secfilter == -1) {
                echo 'selected=1';
            }
            echo '>', _('All'), '</option>';
            $query = "SELECT DISTINCT section FROM imas_students WHERE courseid='{$cid}' ORDER BY section";
            $result = mysql_query($query) or die("Query failed : " . mysql_error());
            while ($row = mysql_fetch_row($result)) {
                if ($row[0] == '') {
                    continue;
                }
                echo "<option value=\"{$row[0]}\" ";
                if ($row[0] == $secfilter) {
                    echo 'selected=1';
                }
                echo ">{$row[0]}</option>";
            }
            echo "</select>";
        } else {
            if ($gbt[0][0][$i] == 'Name') {
                echo '<br/><span class="small">N=' . (count($gbt) - 2) . '</span><br/>';
                echo "<select id=\"toggle5\" onchange=\"chgtoggle()\">";
                echo "<option value=0 ";
                writeHtmlSelected($hidelocked, 0);
                echo ">", _('Show Locked'), "</option>";
                echo "<option value=2 ";
                writeHtmlSelected($hidelocked, 2);
                echo ">", _('Hide Locked'), "</option>";
                echo "</select>";
            }
        }
        echo '</div></th>';
        if ($gbt[0][0][$i] == 'Last Login') {
            $sortarr[] = "'D'";
        } else {
            if ($i != 1) {
                $sortarr[] = "'S'";
            }
        }
    }
    $n = 0;
    //get collapsed gb cat info
    if (count($gbt[0][2]) > 1) {
        $collapsegbcat = array();
        for ($i = 0; $i < count($gbt[0][2]); $i++) {
            if (isset($overridecollapse[$gbt[0][2][$i][10]])) {
                $collapsegbcat[$gbt[0][2][$i][1]] = $overridecollapse[$gbt[0][2][$i][10]];
            } else {
                $collapsegbcat[$gbt[0][2][$i][1]] = $gbt[0][2][$i][12];
            }
        }
    }
    if ($totonleft && !$hidepast) {
        //total totals
        if ($catfilter < 0) {
            if (isset($gbt[0][3][0])) {
                //using points based
                echo '<th><div><span class="cattothdr">', _('Total'), '<br/>' . $gbt[0][3][$availshow] . '&nbsp;', _('pts'), '</span></div></th>';
                echo '<th><div>%</div></th>';
                $n += 2;
            } else {
                echo '<th><div><span class="cattothdr">', _('Weighted Total %'), '</span></div></th>';
                $n++;
            }
        }
        if (count($gbt[0][2]) > 1 || $catfilter != -1) {
            //want to show cat headers?
            for ($i = 0; $i < count($gbt[0][2]); $i++) {
                //category headers
                if (($availshow < 2 || $availshow == 3) && $gbt[0][2][$i][2] > 1) {
                    continue;
                } else {
                    if ($availshow == 2 && $gbt[0][2][$i][2] == 3) {
                        continue;
                    }
                }
                echo '<th class="cat' . $gbt[0][2][$i][1] . '"><div><span class="cattothdr">';
                if ($availshow < 3) {
                    echo $gbt[0][2][$i][0] . '<br/>';
                    if (isset($gbt[0][3][0])) {
                        //using points based
                        echo $gbt[0][2][$i][3 + $availshow] . '&nbsp;', _('pts');
                    } else {
                        echo $gbt[0][2][$i][11] . '%';
                    }
                } else {
                    if ($availshow == 3) {
                        //past and attempted
                        echo $gbt[0][2][$i][0];
                        if (isset($gbt[0][2][$i][11])) {
                            echo '<br/>' . $gbt[0][2][$i][11] . '%';
                        }
                    }
                }
                if ($collapsegbcat[$gbt[0][2][$i][1]] == 0) {
                    echo "<br/><a class=small href=\"gradebook.php?cid={$cid}&amp;cat={$gbt[0][2][$i][10]}&amp;catcollapse=2\">", _('[Collapse]'), "</a>";
                } else {
                    echo "<br/><a class=small href=\"gradebook.php?cid={$cid}&amp;cat={$gbt[0][2][$i][10]}&amp;catcollapse=0\">", _('[Expand]'), "</a>";
                }
                echo '</span></div></th>';
                $n++;
            }
        }
    }
    if ($catfilter > -2) {
        for ($i = 0; $i < count($gbt[0][1]); $i++) {
            //assessment headers
            if (!$isteacher && !$istutor && $gbt[0][1][$i][4] == 0) {
                //skip if hidden
                continue;
            }
            if ($hidenc == 1 && $gbt[0][1][$i][4] == 0) {
                //skip NC
                continue;
            } else {
                if ($hidenc == 2 && ($gbt[0][1][$i][4] == 0 || $gbt[0][1][$i][4] == 3)) {
                    //skip all NC
                    continue;
                }
            }
            if ($gbt[0][1][$i][3] > $availshow) {
                continue;
            }
            if ($hidepast && $gbt[0][1][$i][3] == 0) {
                continue;
            }
            if ($collapsegbcat[$gbt[0][1][$i][1]] == 2) {
                continue;
            }
            //name and points
            echo '<th class="cat' . $gbt[0][1][$i][1] . '"><div>' . $gbt[0][1][$i][0] . '<br/>';
            if ($gbt[0][1][$i][4] == 0 || $gbt[0][1][$i][4] == 3) {
                echo $gbt[0][1][$i][2] . '&nbsp;', _('pts'), ' ', _('(Not Counted)');
            } else {
                echo $gbt[0][1][$i][2] . '&nbsp;', _('pts');
                if ($gbt[0][1][$i][4] == 2) {
                    echo ' (EC)';
                }
            }
            if ($gbt[0][1][$i][5] == 1 && $gbt[0][1][$i][6] == 0) {
                echo ' (PT)';
            }
            if ($includeduedate && $gbt[0][1][$i][11] < 2000000000 && $gbt[0][1][$i][11] > 0) {
                echo '<br/><span class="small">' . tzdate('n/j/y&\\n\\b\\s\\p;g:ia', $gbt[0][1][$i][11]) . '</span>';
            }
            //links
            if ($gbt[0][1][$i][6] == 0) {
                //online
                if ($isteacher) {
                    echo "<br/><a class=small href=\"addassessment.php?id={$gbt[0][1][$i][7]}&amp;cid={$cid}&amp;from=gb\">", _('[Settings]'), "</a>";
                    echo "<br/><a class=small href=\"isolateassessgrade.php?cid={$cid}&amp;aid={$gbt[0][1][$i][7]}\">", _('[Isolate]'), "</a>";
                    if ($gbt[0][1][$i][10] == true) {
                        echo "<br/><a class=small href=\"isolateassessbygroup.php?cid={$cid}&amp;aid={$gbt[0][1][$i][7]}\">", _('[By Group]'), "</a>";
                    }
                } else {
                    echo "<br/><a class=small href=\"isolateassessgrade.php?cid={$cid}&amp;aid={$gbt[0][1][$i][7]}\">", _('[Isolate]'), "</a>";
                }
            } else {
                if ($gbt[0][1][$i][6] == 1 && ($isteacher || $istutor && $gbt[0][1][$i][8] == 1)) {
                    //offline
                    if ($isteacher) {
                        echo "<br/><a class=small href=\"addgrades.php?stu={$stu}&amp;cid={$cid}&amp;grades=all&amp;gbitem={$gbt[0][1][$i][7]}\">", _('[Settings]'), "</a>";
                        echo "<br/><a class=small href=\"addgrades.php?stu={$stu}&amp;cid={$cid}&amp;grades=all&amp;gbitem={$gbt[0][1][$i][7]}&amp;isolate=true\">", _('[Isolate]'), "</a>";
                    } else {
                        echo "<br/><a class=small href=\"addgrades.php?stu={$stu}&amp;cid={$cid}&amp;grades=all&amp;gbitem={$gbt[0][1][$i][7]}&amp;isolate=true\">", _('[Scores]'), "</a>";
                    }
                } else {
                    if ($gbt[0][1][$i][6] == 2 && $isteacher) {
                        //discussion
                        echo "<br/><a class=small href=\"addforum.php?id={$gbt[0][1][$i][7]}&amp;cid={$cid}&amp;from=gb\">", _('[Settings]'), "</a>";
                    } else {
                        if ($gbt[0][1][$i][6] == 3 && $isteacher) {
                            //exttool
                            echo "<br/><a class=small href=\"addlinkedtext.php?id={$gbt[0][1][$i][7]}&amp;cid={$cid}&amp;from=gb\">", _('[Settings]'), "</a>";
                            echo "<br/><a class=small href=\"edittoolscores.php?stu={$stu}&amp;cid={$cid}&amp;uid=all&amp;lid={$gbt[0][1][$i][7]}&amp;isolate=true\">", _('[Isolate]'), "</a>";
                        }
                    }
                }
            }
            echo '</div></th>';
            $n++;
        }
    }
    if (!$totonleft && !$hidepast) {
        if (count($gbt[0][2]) > 1 || $catfilter != -1) {
            //want to show cat headers?
            for ($i = 0; $i < count($gbt[0][2]); $i++) {
                //category headers
                if (($availshow < 2 || $availshow == 3) && $gbt[0][2][$i][2] > 1) {
                    continue;
                } else {
                    if ($availshow == 2 && $gbt[0][2][$i][2] == 3) {
                        continue;
                    }
                }
                echo '<th class="cat' . $gbt[0][2][$i][1] . '"><div><span class="cattothdr">';
                if ($availshow < 3) {
                    echo $gbt[0][2][$i][0] . '<br/>';
                    if (isset($gbt[0][3][0])) {
                        //using points based
                        echo $gbt[0][2][$i][3 + $availshow] . '&nbsp;', _('pts');
                    } else {
                        echo $gbt[0][2][$i][11] . '%';
                    }
                } else {
                    if ($availshow == 3) {
                        //past and attempted
                        echo $gbt[0][2][$i][0];
                    }
                }
                if ($collapsegbcat[$gbt[0][2][$i][1]] == 0) {
                    echo "<br/><a class=small href=\"gradebook.php?cid={$cid}&amp;cat={$gbt[0][2][$i][10]}&amp;catcollapse=2\">", _('[Collapse]'), "</a>";
                } else {
                    echo "<br/><a class=small href=\"gradebook.php?cid={$cid}&amp;cat={$gbt[0][2][$i][10]}&amp;catcollapse=0\">", _('[Expand]'), "</a>";
                }
                echo '</span></div></th>';
                $n++;
            }
        }
        //total totals
        if ($catfilter < 0) {
            if (isset($gbt[0][3][0])) {
                //using points based
                echo '<th><div><span class="cattothdr">', _('Total'), '<br/>' . $gbt[0][3][$availshow] . '&nbsp;', _('pts'), '</span></div></th>';
                echo '<th><div>%</div></th>';
                $n += 2;
            } else {
                echo '<th><div><span class="cattothdr">', _('Weighted Total %'), '</span></div></th>';
                $n++;
            }
        }
    }
    echo '</tr></thead><tbody>';
    //create student rows
    if (isset($GLOBALS['CFG']['GEN']['AWSforcoursefiles']) && $GLOBALS['CFG']['GEN']['AWSforcoursefiles'] == true) {
        $userimgbase = $urlmode . "s3.amazonaws.com/{$GLOBALS['AWSbucket']}/cfiles";
    } else {
        $userimgbase = "{$imasroot}/course/files";
    }
    for ($i = 1; $i < count($gbt); $i++) {
        if ($i == 1) {
            $insdiv = "<div>";
            $enddiv = "</div>";
        } else {
            $insdiv = '';
            $enddiv = '';
        }
        if ($i % 2 != 0) {
            echo "<tr class=even onMouseOver=\"highlightrow(this)\" onMouseOut=\"unhighlightrow(this)\">";
        } else {
            echo "<tr class=odd onMouseOver=\"highlightrow(this)\" onMouseOut=\"unhighlightrow(this)\">";
        }
        echo '<td class="locked" scope="row"><div class="trld">';
        if ($gbt[$i][0][0] != "Averages" && $isteacher) {
            echo "<input type=\"checkbox\" name='checked[]' value='{$gbt[$i][4][0]}' />&nbsp;";
        }
        echo "<a href=\"gradebook.php?cid={$cid}&amp;stu={$gbt[$i][4][0]}\">";
        if ($gbt[$i][4][1] > 0) {
            echo '<span class="greystrike">' . $gbt[$i][0][0] . '</span>';
        } else {
            echo $gbt[$i][0][0];
        }
        echo '</a>';
        if ($gbt[$i][4][3] == 1) {
            echo '<sup>*</sup>';
        }
        echo '</div></td>';
        if ($showpics == 1 && $gbt[$i][4][2] == 1) {
            //file_exists("$curdir//files/userimg_sm{$gbt[$i][4][0]}.jpg")) {
            echo "<td>{$insdiv}<div class=\"trld\"><img src=\"{$userimgbase}/userimg_sm{$gbt[$i][4][0]}.jpg\"/></div></td>";
        } else {
            if ($showpics == 2 && $gbt[$i][4][2] == 1) {
                echo "<td>{$insdiv}<div class=\"trld\"><img src=\"{$userimgbase}/userimg_{$gbt[$i][4][0]}.jpg\"/></div></td>";
            } else {
                echo '<td>' . $insdiv . '<div class="trld">&nbsp;</div></td>';
            }
        }
        for ($j = $gbt[0][0][1] == 'ID' ? 1 : 2; $j < count($gbt[0][0]); $j++) {
            echo '<td class="c">' . $insdiv . $gbt[$i][0][$j] . $enddiv . '</td>';
        }
        if ($totonleft && !$hidepast) {
            //total totals
            if ($catfilter < 0) {
                if ($availshow == 3) {
                    if ($gbt[$i][0][0] == 'Averages') {
                        if (isset($gbt[$i][3][8])) {
                            //using points based
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '%' . $enddiv . '</td>';
                        }
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '%' . $enddiv . '</td>';
                    } else {
                        if (isset($gbt[$i][3][8])) {
                            //using points based
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '/' . $gbt[$i][3][7] . $enddiv . '</td>';
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][8] . '%' . $enddiv . '</td>';
                        } else {
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '%' . $enddiv . '</td>';
                        }
                    }
                } else {
                    if (isset($gbt[0][3][0])) {
                        //using points based
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][$availshow] . $enddiv . '</td>';
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][$availshow + 3] . '%' . $enddiv . '</td>';
                    } else {
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][$availshow] . '%' . $enddiv . '</td>';
                    }
                }
            }
            //category totals
            if (count($gbt[0][2]) > 1 || $catfilter != -1) {
                //want to show cat headers?
                for ($j = 0; $j < count($gbt[0][2]); $j++) {
                    //category headers
                    if (($availshow < 2 || $availshow == 3) && $gbt[0][2][$j][2] > 1) {
                        continue;
                    } else {
                        if ($availshow == 2 && $gbt[0][2][$j][2] == 3) {
                            continue;
                        }
                    }
                    if ($catfilter != -1 && $availshow < 3 && $gbt[0][2][$j][$availshow + 3] > 0) {
                        //echo '<td class="c">'.$gbt[$i][2][$j][$availshow].' ('.round(100*$gbt[$i][2][$j][$availshow]/$gbt[0][2][$j][$availshow+3])  .'%)</td>';
                        echo '<td class="c">' . $insdiv;
                        if ($gbt[$i][0][0] == 'Averages' && $availshow != 3) {
                            echo "<span onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][2][$j][6 + $availshow]}')\" onmouseout=\"tipout()\" >";
                        }
                        echo $gbt[$i][2][$j][$availshow] . ' (' . round(100 * $gbt[$i][2][$j][$availshow] / $gbt[0][2][$j][$availshow + 3]) . '%)';
                        if ($gbt[$i][0][0] == 'Averages' && $availshow != 3) {
                            echo '</span>';
                        }
                        echo $enddiv . '</td>';
                    } else {
                        //echo '<td class="c">'.$gbt[$i][2][$j][$availshow].'</td>';
                        echo '<td class="c">' . $insdiv;
                        if ($gbt[$i][0][0] == 'Averages') {
                            echo "<span onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][2][$j][6 + $availshow]}')\" onmouseout=\"tipout()\" >";
                        }
                        if ($availshow == 3) {
                            if ($gbt[$i][0][0] == 'Averages') {
                                echo $gbt[$i][2][$j][3] . '%';
                                //echo '-';
                            } else {
                                echo $gbt[$i][2][$j][3] . '/' . $gbt[$i][2][$j][4];
                            }
                        } else {
                            if (isset($gbt[$i][3][8])) {
                                //using points based
                                echo $gbt[$i][2][$j][$availshow];
                            } else {
                                if ($gbt[0][2][$j][3 + $availshow] > 0) {
                                    echo round(100 * $gbt[$i][2][$j][$availshow] / $gbt[0][2][$j][3 + $availshow], 1) . '%';
                                } else {
                                    echo '0%';
                                }
                            }
                        }
                        if ($gbt[$i][0][0] == 'Averages') {
                            echo '</span>';
                        }
                        echo $enddiv . '</td>';
                    }
                }
            }
        }
        //assessment values
        if ($catfilter > -2) {
            for ($j = 0; $j < count($gbt[0][1]); $j++) {
                if (!$isteacher && !$istutor && $gbt[0][1][$j][4] == 0) {
                    //skip if hidden
                    continue;
                }
                if ($hidenc == 1 && $gbt[0][1][$j][4] == 0) {
                    //skip NC
                    continue;
                } else {
                    if ($hidenc == 2 && ($gbt[0][1][$j][4] == 0 || $gbt[0][1][$j][4] == 3)) {
                        //skip all NC
                        continue;
                    }
                }
                if ($gbt[0][1][$j][3] > $availshow) {
                    continue;
                }
                if ($hidepast && $gbt[0][1][$j][3] == 0) {
                    continue;
                }
                if ($collapsegbcat[$gbt[0][1][$j][1]] == 2) {
                    continue;
                }
                //if online, not average, and either score exists and active, or score doesn't exist and assess is current,
                if ($gbt[0][1][$j][6] == 0 && $gbt[$i][1][$j][4] != 'average' && (isset($gbt[$i][1][$j][3]) && $gbt[$i][1][$j][3] > 9 || !isset($gbt[$i][1][$j][3]) && $gbt[0][1][$j][3] == 1)) {
                    echo '<td class="c isact">' . $insdiv;
                } else {
                    echo '<td class="c">' . $insdiv;
                }
                if (isset($gbt[$i][1][$j][5]) && $gbt[$i][1][$j][5] & 1 << $availshow && !$hidepast) {
                    echo '<span style="font-style:italic">';
                }
                if ($gbt[0][1][$j][6] == 0) {
                    //online
                    if (isset($gbt[$i][1][$j][0])) {
                        if ($istutor && $gbt[$i][1][$j][4] == 'average') {
                        } else {
                            if ($gbt[$i][1][$j][4] == 'average') {
                                echo "<a href=\"gb-itemanalysis.php?stu={$stu}&amp;cid={$cid}&amp;asid={$gbt[$i][1][$j][4]}&amp;aid={$gbt[0][1][$j][7]}\" ";
                                echo "onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][1][$j][9]}')\" onmouseout=\"tipout()\" ";
                                echo ">";
                            } else {
                                echo "<a href=\"gb-viewasid.php?stu={$stu}&amp;cid={$cid}&amp;asid={$gbt[$i][1][$j][4]}&amp;uid={$gbt[$i][4][0]}\">";
                            }
                        }
                        if ($gbt[$i][1][$j][3] > 9) {
                            $gbt[$i][1][$j][3] -= 10;
                        }
                        echo $gbt[$i][1][$j][0];
                        if ($gbt[$i][1][$j][3] == 1) {
                            echo ' (NC)';
                        } else {
                            if ($gbt[$i][1][$j][3] == 2) {
                                echo ' (IP)';
                            } else {
                                if ($gbt[$i][1][$j][3] == 3) {
                                    echo ' (OT)';
                                } else {
                                    if ($gbt[$i][1][$j][3] == 4) {
                                        echo ' (PT)';
                                    }
                                }
                            }
                        }
                        if ($istutor && $gbt[$i][1][$j][4] == 'average') {
                        } else {
                            echo '</a>';
                        }
                        if ($gbt[$i][1][$j][1] == 1) {
                            echo '<sup>*</sup>';
                        }
                    } else {
                        //no score
                        if ($gbt[$i][0][0] == 'Averages') {
                            echo '-';
                        } else {
                            if ($isteacher) {
                                echo "<a href=\"gb-viewasid.php?stu={$stu}&amp;cid={$cid}&amp;asid=new&amp;aid={$gbt[0][1][$j][7]}&amp;uid={$gbt[$i][4][0]}\">-</a>";
                            } else {
                                echo '-';
                            }
                        }
                    }
                    if (isset($gbt[$i][1][$j][6])) {
                        if ($gbt[$i][1][$j][6] > 1) {
                            if ($gbt[$i][1][$j][6] > 2) {
                                echo '<sup>LP (' . ($gbt[$i][1][$j][6] - 1) . ')</sup>';
                            } else {
                                echo '<sup>LP</sup>';
                            }
                        } else {
                            echo '<sup>e</sup>';
                        }
                    }
                } else {
                    if ($gbt[0][1][$j][6] == 1) {
                        //offline
                        if ($isteacher) {
                            if ($gbt[$i][0][0] == 'Averages') {
                                echo "<a href=\"addgrades.php?stu={$stu}&amp;cid={$cid}&amp;grades=all&amp;gbitem={$gbt[0][1][$j][7]}\" ";
                                echo "onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][1][$j][9]}')\" onmouseout=\"tipout()\" ";
                                echo ">";
                            } else {
                                echo "<a href=\"addgrades.php?stu={$stu}&amp;cid={$cid}&amp;grades={$gbt[$i][4][0]}&amp;gbitem={$gbt[0][1][$j][7]}\">";
                            }
                        } else {
                            if ($istutor && $gbt[0][1][$j][8] == 1) {
                                if ($gbt[$i][0][0] == 'Averages') {
                                    echo "<a href=\"addgrades.php?stu={$stu}&amp;cid={$cid}&amp;grades=all&amp;gbitem={$gbt[0][1][$j][7]}\">";
                                } else {
                                    echo "<a href=\"addgrades.php?stu={$stu}&amp;cid={$cid}&amp;grades={$gbt[$i][4][0]}&amp;gbitem={$gbt[0][1][$j][7]}\">";
                                }
                            }
                        }
                        if (isset($gbt[$i][1][$j][0])) {
                            echo $gbt[$i][1][$j][0];
                            if ($gbt[$i][1][$j][3] == 1) {
                                echo ' (NC)';
                            }
                        } else {
                            echo '-';
                        }
                        if ($isteacher || $istutor && $gbt[0][1][$j][8] == 1) {
                            echo '</a>';
                        }
                        if ($gbt[$i][1][$j][1] == 1) {
                            echo '<sup>*</sup>';
                        }
                    } else {
                        if ($gbt[0][1][$j][6] == 2) {
                            //discuss
                            if (isset($gbt[$i][1][$j][0])) {
                                if ($gbt[$i][0][0] != 'Averages') {
                                    echo "<a href=\"viewforumgrade.php?cid={$cid}&amp;stu={$stu}&amp;uid={$gbt[$i][4][0]}&amp;fid={$gbt[0][1][$j][7]}\">";
                                    echo $gbt[$i][1][$j][0];
                                    echo '</a>';
                                } else {
                                    echo "<span onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][1][$j][9]}')\" onmouseout=\"tipout()\"> ";
                                    echo $gbt[$i][1][$j][0];
                                    echo '</span>';
                                }
                                if ($gbt[$i][1][$j][1] == 1) {
                                    echo '<sup>*</sup>';
                                }
                            } else {
                                if ($isteacher && $gbt[$i][0][0] != 'Averages') {
                                    echo "<a href=\"viewforumgrade.php?cid={$cid}&amp;stu={$stu}&amp;uid={$gbt[$i][4][0]}&amp;fid={$gbt[0][1][$j][7]}\">-</a>";
                                } else {
                                    echo '-';
                                }
                            }
                        } else {
                            if ($gbt[0][1][$j][6] == 3) {
                                //exttool
                                if ($isteacher) {
                                    if ($gbt[$i][0][0] == 'Averages') {
                                        echo "<a href=\"edittoolscores.php?stu={$stu}&amp;cid={$cid}&amp;uid=all&amp;lid={$gbt[0][1][$j][7]}\" ";
                                        echo "onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][1][$j][9]}')\" onmouseout=\"tipout()\" ";
                                        echo ">";
                                    } else {
                                        echo "<a href=\"edittoolscores.php?stu={$stu}&amp;cid={$cid}&amp;uid={$gbt[$i][4][0]}&amp;lid={$gbt[0][1][$j][7]}\">";
                                    }
                                } else {
                                    if ($istutor && $gbt[0][1][$j][8] == 1) {
                                        if ($gbt[$i][0][0] == 'Averages') {
                                            echo "<a href=\"edittoolscores.php?stu={$stu}&amp;cid={$cid}&amp;uid=all&amp;lid={$gbt[0][1][$j][7]}\">";
                                        } else {
                                            echo "<a href=\"edittoolscores.php?stu={$stu}&amp;cid={$cid}&amp;uid={$gbt[$i][4][0]}&amp;lid={$gbt[0][1][$j][7]}\">";
                                        }
                                    }
                                }
                                if (isset($gbt[$i][1][$j][0])) {
                                    echo $gbt[$i][1][$j][0];
                                    if ($gbt[$i][1][$j][3] == 1) {
                                        echo ' (NC)';
                                    }
                                } else {
                                    echo '-';
                                }
                                if ($isteacher || $istutor && $gbt[0][1][$j][8] == 1) {
                                    echo '</a>';
                                }
                                if ($gbt[$i][1][$j][1] == 1) {
                                    echo '<sup>*</sup>';
                                }
                            }
                        }
                    }
                }
                if (isset($gbt[$i][1][$j][5]) && $gbt[$i][1][$j][5] & 1 << $availshow && !$hidepast) {
                    echo '<sub>d</sub></span>';
                }
                echo $enddiv . '</td>';
            }
        }
        if (!$totonleft && !$hidepast) {
            //category totals
            if (count($gbt[0][2]) > 1 || $catfilter != -1) {
                //want to show cat headers?
                for ($j = 0; $j < count($gbt[0][2]); $j++) {
                    //category headers
                    if (($availshow < 2 || $availshow == 3) && $gbt[0][2][$j][2] > 1) {
                        continue;
                    } else {
                        if ($availshow == 2 && $gbt[0][2][$j][2] == 3) {
                            continue;
                        }
                    }
                    if ($catfilter != -1 && $availshow < 3 && $gbt[0][2][$j][$availshow + 3] > 0) {
                        //echo '<td class="c">'.$gbt[$i][2][$j][$availshow].' ('.round(100*$gbt[$i][2][$j][$availshow]/$gbt[0][2][$j][$availshow+3])  .'%)</td>';
                        echo '<td class="c">' . $insdiv;
                        if ($gbt[$i][0][0] == 'Averages' && $availshow != 3) {
                            echo "<span onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][2][$j][6 + $availshow]}')\" onmouseout=\"tipout()\" >";
                        }
                        echo $gbt[$i][2][$j][$availshow] . ' (' . round(100 * $gbt[$i][2][$j][$availshow] / $gbt[0][2][$j][$availshow + 3]) . '%)';
                        if ($gbt[$i][0][0] == 'Averages' && $availshow != 3) {
                            echo '</span>';
                        }
                        echo $enddiv . '</td>';
                    } else {
                        //echo '<td class="c">'.$gbt[$i][2][$j][$availshow].'</td>';
                        echo '<td class="c">' . $insdiv;
                        if ($gbt[$i][0][0] == 'Averages' && $availshow < 3) {
                            echo "<span onmouseover=\"tipshow(this,'", _('5-number summary:'), " {$gbt[0][2][$j][6 + $availshow]}')\" onmouseout=\"tipout()\" >";
                        }
                        if ($availshow == 3) {
                            if ($gbt[$i][0][0] == 'Averages') {
                                echo $gbt[$i][2][$j][3] . '%';
                            } else {
                                echo $gbt[$i][2][$j][3] . '/' . $gbt[$i][2][$j][4];
                            }
                        } else {
                            if (isset($gbt[$i][3][8])) {
                                //using points based
                                echo $gbt[$i][2][$j][$availshow];
                            } else {
                                if ($gbt[0][2][$j][3 + $availshow] > 0) {
                                    echo round(100 * $gbt[$i][2][$j][$availshow] / $gbt[0][2][$j][3 + $availshow], 1) . '%';
                                } else {
                                    echo '0%';
                                }
                            }
                        }
                        if ($gbt[$i][0][0] == 'Averages' && $availshow < 3) {
                            echo '</span>';
                        }
                        echo $enddiv . '</td>';
                    }
                }
            }
            //total totals
            if ($catfilter < 0) {
                if ($availshow == 3) {
                    if ($gbt[$i][0][0] == 'Averages') {
                        if (isset($gbt[$i][3][8])) {
                            //using points based
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '%' . $enddiv . '</td>';
                        }
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '%' . $enddiv . '</td>';
                    } else {
                        if (isset($gbt[$i][3][8])) {
                            //using points based
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '/' . $gbt[$i][3][7] . $enddiv . '</td>';
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][8] . '%' . $enddiv . '</td>';
                        } else {
                            echo '<td class="c">' . $insdiv . $gbt[$i][3][6] . '%' . $enddiv . '</td>';
                        }
                    }
                } else {
                    if (isset($gbt[0][3][0])) {
                        //using points based
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][$availshow] . $enddiv . '</td>';
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][$availshow + 3] . '%' . $enddiv . '</td>';
                    } else {
                        echo '<td class="c">' . $insdiv . $gbt[$i][3][$availshow] . '%' . $enddiv . '</td>';
                    }
                }
            }
        }
        echo '</tr>';
    }
    echo "</tbody></table></div></div>";
    if ($n > 1) {
        $sarr = array_merge($sortarr, array_fill(0, $n, "'N'"));
    } else {
        $sarr = array();
    }
    $sarr = implode(",", $sarr);
    if (count($gbt) < 500) {
        if ($avgontop) {
            echo "<script>initSortTable('myTable',Array({$sarr}),true,true,false);</script>\n";
        } else {
            echo "<script>initSortTable('myTable',Array({$sarr}),true,false);</script>\n";
        }
    }
    if ($colorize != '0') {
        echo '<script type="text/javascript">addLoadEvent( function() {updateColors(document.getElementById("colorsel"));} );</script>';
    }
}