private static function get_files($assignment, $userid, $attemptnumber, $filearea, $filepath = '/') {
        $grade = $assignment->get_user_grade($userid, true, $attemptnumber);
        $itemid = $grade->id;
        $contextid = $assignment->get_context()->id;
        $component = self::COMPONENT;
        $fs = get_file_storage();
        $files = $fs->get_directory_files($contextid, $component, $filearea, $itemid, $filepath);
        return $files;
    }
private static function get_files($assignment, $userid, $attemptnumber, $filearea, $filepath = '/') {
        $grade = $assignment->get_user_grade($userid, true, $attemptnumber);
        $itemid = $grade->id;
        $contextid = $assignment->get_context()->id;
        $component = self::COMPONENT;
        $fs = get_file_storage();
        $files = $fs->get_directory_files($contextid, $component, $filearea, $itemid, $filepath);
        return $files;
    }
private static function get_files ( $ assignment , $ userid , $ attemptnumber , $ filearea , $ filepath = '/' ) { $ grade = $ assignment -> get_user_grade ( $ userid , true , $ attemptnumber ) ; $ itemid = $ grade -> id ; $ contextid = $ assignment -> get_context ( ) -> id ; $ component = self :: COMPONENT ; $ fs = get_file_storage ( ) ; $ files = $ fs -> get_directory_files ( $ contextid , $ component , $ filearea , $ itemid , $ filepath ) ; return $ files ; }
Get All files in a File area
@param int|\assign $assignment Assignment
@param int $userid User ID
@param int $attemptnumber Attempt Number
@param string $filearea File Area
@param string $filepath File Path
@return array
Get All files in a File area