original_string: public static function get_workshop_access_information($workshopid) {
          global $USER;
  
          $params = self::validate_parameters(self::get_workshop_access_information_parameters(), array('workshopid' => $workshopid));
  
          list($workshop, $course, $cm, $context) = self::validate_workshop($params['workshopid']);
  
          $result = array();
          // Return all the available capabilities.
          $capabilities = load_capability_def('mod_workshop');
          foreach ($capabilities as $capname => $capdata) {
              // Get fields like cansubmit so it is consistent with the access_information function implemented in other modules.
              $field = 'can' . str_replace('mod/workshop:', '', $capname);
              $result[$field] = has_capability($capname, $context);
          }
  
          // Now, specific features access information.
          $result['creatingsubmissionallowed'] = $workshop->creating_submission_allowed($USER->id);
          $result['modifyingsubmissionallowed'] = $workshop->modifying_submission_allowed($USER->id);
          $result['assessingallowed'] = $workshop->assessing_allowed($USER->id);
          $result['assessingexamplesallowed'] = $workshop->assessing_examples_allowed();
          if (is_null($result['assessingexamplesallowed'])) {
              $result['assessingexamplesallowed'] = false;
          }
          $result['examplesassessedbeforesubmission'] = $workshop->check_examples_assessed_before_submission($USER->id);
          list($result['examplesassessedbeforeassessment'], $code) = $workshop->check_examples_assessed_before_assessment($USER->id);
  
          $result['warnings'] = array();
          return $result;
      }
code: public static function get_workshop_access_information($workshopid) {
          global $USER;
  
          $params = self::validate_parameters(self::get_workshop_access_information_parameters(), array('workshopid' => $workshopid));
  
          list($workshop, $course, $cm, $context) = self::validate_workshop($params['workshopid']);
  
          $result = array();
          // Return all the available capabilities.
          $capabilities = load_capability_def('mod_workshop');
          foreach ($capabilities as $capname => $capdata) {
              // Get fields like cansubmit so it is consistent with the access_information function implemented in other modules.
              $field = 'can' . str_replace('mod/workshop:', '', $capname);
              $result[$field] = has_capability($capname, $context);
          }
  
          // Now, specific features access information.
          $result['creatingsubmissionallowed'] = $workshop->creating_submission_allowed($USER->id);
          $result['modifyingsubmissionallowed'] = $workshop->modifying_submission_allowed($USER->id);
          $result['assessingallowed'] = $workshop->assessing_allowed($USER->id);
          $result['assessingexamplesallowed'] = $workshop->assessing_examples_allowed();
          if (is_null($result['assessingexamplesallowed'])) {
              $result['assessingexamplesallowed'] = false;
          }
          $result['examplesassessedbeforesubmission'] = $workshop->check_examples_assessed_before_submission($USER->id);
          list($result['examplesassessedbeforeassessment'], $code) = $workshop->check_examples_assessed_before_assessment($USER->id);
  
          $result['warnings'] = array();
          return $result;
      }
code_tokens: public static function get_workshop_access_information ( $ workshopid ) { global $ USER ; $ params = self :: validate_parameters ( self :: get_workshop_access_information_parameters ( ) , array ( 'workshopid' => $ workshopid ) ) ; list ( $ workshop , $ course , $ cm , $ context ) = self :: validate_workshop ( $ params [ 'workshopid' ] ) ; $ result = array ( ) ; // Return all the available capabilities. $ capabilities = load_capability_def ( 'mod_workshop' ) ; foreach ( $ capabilities as $ capname => $ capdata ) { // Get fields like cansubmit so it is consistent with the access_information function implemented in other modules. $ field = 'can' . str_replace ( 'mod/workshop:' , '' , $ capname ) ; $ result [ $ field ] = has_capability ( $ capname , $ context ) ; } // Now, specific features access information. $ result [ 'creatingsubmissionallowed' ] = $ workshop -> creating_submission_allowed ( $ USER -> id ) ; $ result [ 'modifyingsubmissionallowed' ] = $ workshop -> modifying_submission_allowed ( $ USER -> id ) ; $ result [ 'assessingallowed' ] = $ workshop -> assessing_allowed ( $ USER -> id ) ; $ result [ 'assessingexamplesallowed' ] = $ workshop -> assessing_examples_allowed ( ) ; if ( is_null ( $ result [ 'assessingexamplesallowed' ] ) ) { $ result [ 'assessingexamplesallowed' ] = false ; } $ result [ 'examplesassessedbeforesubmission' ] = $ workshop -> check_examples_assessed_before_submission ( $ USER -> id ) ; list ( $ result [ 'examplesassessedbeforeassessment' ] , $ code ) = $ workshop -> check_examples_assessed_before_assessment ( $ USER -> id ) ; $ result [ 'warnings' ] = array ( ) ; return $ result ; }
docstring: Return access information for a given workshop.
  
  @param int $workshopid workshop instance id
  @return array of warnings and the access information
  @since Moodle 3.4
  @throws  moodle_exception
docstring_tokens: Return access information for a given workshop .