Ejemplo n.º 1
0
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once dirname(__FILE__) . '/../common.php';
dgr_require('/includes/user.php');
dgr_require('/includes/class.php');
dgr_startup();
if (!isset($_GET['id']) || !isset($_GET['view']) || !isset($_GET['semid']) || !isset($_GET['qid'])) {
    exit;
}
try {
    $user = new DGradeUser();
    $class = new DGradeClass($_GET['id']);
    $user->set_classid($_GET['id']);
} catch (Exception $e) {
    exit;
}
$ht = '';
if ($_GET['view'] == 1) {
    $ht .= '<span id="chooseheader">' . gettext('Students') . '</span><span id="choosesel" style="display:none">1</span><span id="chooseid" style="display:none">0</span><div id="chooselist"><table cellpadding="0" cellspacing="0" width="100%">';
    $i = 0;
    foreach ($class->students as $st) {
        $stinfo = $class->get_student_brief($st);
        $tr = 'choose' . ++$i;
        $ht .= '<tr id="' . $tr . '" onmouseover="make_pointer(this)" onclick="change_selection(' . $i . ',' . $stinfo['id'] . ')">' . '<td style="width:15%" class="choosetd">' . $i . '</td>' . '<td class="choosetd">' . $stinfo['name'] . '</td>' . '<td class="choosetd">' . $stinfo['surname'] . '</td>' . '</tr>';
    }
    $ht .= '</table></div>';
} else {
    if ($_GET['view'] == 2) {