protected static function get_assignment_output($assignmentdata) {
        $assignment = (object) [
            'name' => $assignmentdata->name,
            'intro' => $assignmentdata->intro,
            'assignmenttype' => $assignmentdata->assignmenttype,
            'grade' => $assignmentdata->grade,
            'timemodified' => transform::datetime($assignmentdata->timemodified)
        ];

        if ($assignmentdata->timeavailable != 0) {
            $assignment->timeavailable = transform::datetime($assignmentdata->timeavailable);
        }

        if ($assignmentdata->timedue != 0) {
            $assignment->timedue = transform::datetime($assignmentdata->timedue);
        }

        return $assignment;
    }