public function fetch_grade_or_default($item, $userid) {
        $grade = grade_grade::fetch(array(
            'itemid' => $item->id, 'userid' => $userid
        ));

        if (!$grade) {
            $default = new stdClass;

            $default->userid = $userid;
            $default->itemid = $item->id;
            $default->feedback = '';

            $grade = new grade_grade($default, false);
        }

        $grade->grade_item = $item;

        return $grade;
    }
public function fetch_grade_or_default($item, $userid) {
        $grade = grade_grade::fetch(array(
            'itemid' => $item->id, 'userid' => $userid
        ));

        if (!$grade) {
            $default = new stdClass;

            $default->userid = $userid;
            $default->itemid = $item->id;
            $default->feedback = '';

            $grade = new grade_grade($default, false);
        }

        $grade->grade_item = $item;

        return $grade;
    }
public function fetch_grade_or_default ( $ item , $ userid ) { $ grade = grade_grade :: fetch ( array ( 'itemid' => $ item -> id , 'userid' => $ userid ) ) ; if ( ! $ grade ) { $ default = new stdClass ; $ default -> userid = $ userid ; $ default -> itemid = $ item -> id ; $ default -> feedback = '' ; $ grade = new grade_grade ( $ default , false ) ; } $ grade -> grade_item = $ item ; return $ grade ; }
Get the grade_grade

@param grade_item $item The grade_item
@param int $userid The user id
@return grade_grade
Get the grade_grade