grades ( $id,  $aID )

Source file: app/functions/hook-function.php

View source


Used by


Source

function grades($id, $aID)
{
    $app = \Liten\Liten::getInstance();
    try {
        $grade = $app->db->query('SELECT * FROM gradebook WHERE stuID = ? AND assignID = ?', [
            $id,
            $aID
        ]);
        $q = $grade->find(function ($data) {
            $array = [];
            foreach ($data as $d) {
                $array[] = $d;
            }
            return $array;
        });
        $array = [];
        foreach ($q as $r) {
            $array[] = $r;
        }
        $select = grading_scale(_h($r['grade']));
        return $app->hook->apply_filter('grades', $select);
    } catch (NotFoundException $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    } catch (ORMException $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    } catch (Exception $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    }
}


User Contributed Notes

You must log in before being able to contribute a note.