当前位置: 首页>>代码示例>>PHP>>正文


PHP assign类代码示例

本文整理汇总了PHP中assign的典型用法代码示例。如果您正苦于以下问题:PHP assign类的具体用法?PHP assign怎么用?PHP assign使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了assign类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initiate

 public function initiate()
 {
     $assign = new assign($this->application);
     if ($assign->host()->dir($this->configuration)) {
         $module = new module();
         $module->loader();
         if (module::request(support\configuration::class)->configuration()) {
             $rewrite = avail::configuration($this->rewrite)->request('rewrite');
             if ($assign->rewrite($rewrite)) {
                 if ($route = $module->route()) {
                     module::request(support\validation::class)->extension('ASV');
                     module::request(support\authorization::class)->extension('ASA');
                     module::request(support\mail::class)->extension('ASM');
                     $ase = $module->environment();
                     if ($ase) {
                         if (isset($ase['database'])) {
                             if ($assign->database(array_merge(avail::$database, $ase['database']))) {
                                 return true;
                             } else {
                                 unset($ase['database']);
                             }
                         }
                         avail::configuration($ase)->merge();
                     }
                     avail::authorization()->subscribe();
                     avail::directory()->set(avail::configuration($this->directory)->request('directory'));
                     new verse();
                     $verso = new verso($route->page);
                     $verso->set();
                     $verso->execute();
                 }
             }
         }
     }
 }
开发者ID:letid,项目名称:framework,代码行数:35,代码来源:request.php

示例2: assignsubmission_comments_comment_permissions

/**
 * Permission control method for submission plugin ---- required method for AJAXmoodle based comment API
 *
 * @param stdClass $options
 * @return array
 */
function assignsubmission_comments_comment_permissions(stdClass $options) {
    global $USER, $CFG, $DB;

    if ($options->commentarea != 'submission_comments' &&
            $options->commentarea != 'submission_comments_upgrade') {
        throw new comment_exception('invalidcommentarea');
    }
    if (!$submission = $DB->get_record('assign_submission', array('id'=>$options->itemid))) {
        throw new comment_exception('invalidcommentitemid');
    }
    $context = $options->context;

    require_once($CFG->dirroot . '/mod/assign/locallib.php');
    $assignment = new assign($context, null, null);

    if ($assignment->get_instance()->id != $submission->assignment) {
        throw new comment_exception('invalidcontext');
    }
    if (!has_capability('mod/assign:grade', $context)) {
        if (!has_capability('mod/assign:submit', $context)) {
            return array('post' => false, 'view' => false);
        } else if ($submission->userid != $USER->id) {
            return array('post' => false, 'view' => false);
        }
    }

    return array('post' => true, 'view' => true);
}
开发者ID:ncsu-delta,项目名称:moodle,代码行数:34,代码来源:lib.php

示例3: __construct

 public function __construct(\mod_mediagallery\collection $collection, array $galleries)
 {
     global $CFG, $DB;
     $this->collection = $collection;
     $this->galleries = $galleries;
     if ($collection->user_can_add_children()) {
         $this->maxreached = false;
     }
     if ($this->isassessable = $collection->is_assessable()) {
         $this->hassubmitted = $collection->has_submitted();
         if ($this->linkedassigncmid = $collection->get_linked_assignid()) {
             require_once $CFG->dirroot . '/mod/assign/locallib.php';
             $context = \context_module::instance($this->linkedassigncmid);
             $cm = get_coursemodule_from_id('assign', $this->linkedassigncmid, 0, false, MUST_EXIST);
             $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
             $assign = new \assign($context, $cm, $course);
             $this->submissionsopen = $assign->submissions_open();
         }
     }
     $this->readonly = $collection->is_read_only();
     $this->tags = $collection->get_tags();
     $mygalleries = $collection->get_my_galleries();
     $this->userorgrouphasgallery = !empty($mygalleries);
     foreach (array('id', 'mode', 'thumbnailsperrow', 'thumbnailsperpage') as $opt) {
         if (isset($collection->{$opt})) {
             $this->{$opt} = $collection->{$opt};
         }
     }
 }
开发者ID:eSrem,项目名称:moodle-mod_mediagallery,代码行数:29,代码来源:renderable.php

示例4: create_from_submission

 /**
  * Create instance of event.
  *
  * @param \assign $assign
  * @param \stdClass $submission
  * @return submission_viewed
  */
 public static function create_from_submission(\assign $assign, \stdClass $submission)
 {
     $data = array('objectid' => $submission->id, 'relateduserid' => $submission->userid, 'context' => $assign->get_context(), 'other' => array('assignid' => $assign->get_instance()->id));
     /** @var submission_viewed $event */
     $event = self::create($data);
     $event->set_assign($assign);
     $event->add_record_snapshot('assign_submission', $submission);
     return $event;
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:16,代码来源:submission_viewed.php

示例5: create_from_assign

 /**
  * Create instance of event.
  *
  * @param \assign $assign
  * @return batch_set_marker_allocation_viewed
  */
 public static function create_from_assign(\assign $assign)
 {
     $data = array('context' => $assign->get_context(), 'other' => array('assignid' => $assign->get_instance()->id));
     self::$preventcreatecall = false;
     /** @var batch_set_marker_allocation_viewed $event */
     $event = self::create($data);
     self::$preventcreatecall = true;
     $event->set_assign($assign);
     return $event;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:16,代码来源:batch_set_marker_allocation_viewed.php

示例6: __construct

 /**
  * Constructor for this renderable.
  *
  * @param int $userid The user we will open the grading app too.
  * @param int $groupid If groups are enabled this is the current course group.
  * @param assign $assignment The assignment class
  */
 public function __construct($userid, $groupid, $assignment)
 {
     $this->userid = $userid;
     $this->groupid = $groupid;
     $this->assignment = $assignment;
     $this->participants = $assignment->list_participants_with_filter_status_and_group($groupid);
     if (!$this->userid && count($this->participants)) {
         $this->userid = reset($this->participants)->id;
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:17,代码来源:grading_app.php

示例7: set_assign

 /**
  * Set assign instance for this event.
  * @param \assign $assign
  * @throws \coding_exception
  */
 public function set_assign(\assign $assign)
 {
     if ($this->is_triggered()) {
         throw new \coding_exception('set_assign() must be done before triggerring of event');
     }
     if ($assign->get_context()->id != $this->get_context()->id) {
         throw new \coding_exception('Invalid assign isntance supplied!');
     }
     $this->assign = $assign;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:15,代码来源:base.php

示例8: create_from_assign

 /**
  * Create instance of event.
  *
  * @since Moodle 2.7
  *
  * @param \assign $assign
  * @return all_submissions_downloaded
  */
 public static function create_from_assign(\assign $assign)
 {
     $data = array('context' => $assign->get_context(), 'objectid' => $assign->get_instance()->id);
     self::$preventcreatecall = false;
     /** @var submission_graded $event */
     $event = self::create($data);
     self::$preventcreatecall = true;
     $event->set_assign($assign);
     return $event;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:18,代码来源:all_submissions_downloaded.php

示例9: create_from_grade

 /**
  * Create instance of event.
  *
  * @since Moodle 2.7
  *
  * @param \assign $assign
  * @param \stdClass $grade
  * @return submission_graded
  */
 public static function create_from_grade(\assign $assign, \stdClass $grade)
 {
     $data = array('context' => $assign->get_context(), 'objectid' => $grade->id, 'relateduserid' => $grade->userid);
     self::$preventcreatecall = false;
     /** @var submission_graded $event */
     $event = self::create($data);
     self::$preventcreatecall = true;
     $event->set_assign($assign);
     $event->add_record_snapshot('assign_grades', $grade);
     return $event;
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:20,代码来源:submission_graded.php

示例10: create_from_user

 /**
  * Create instance of event.
  *
  * @since Moodle 2.7
  *
  * @param \assign $assign
  * @param \stdClass $user
  * @return submission_locked
  */
 public static function create_from_user(\assign $assign, \stdClass $user)
 {
     $data = array('context' => $assign->get_context(), 'objectid' => $assign->get_instance()->id, 'relateduserid' => $user->id);
     self::$preventcreatecall = false;
     /** @var submission_locked $event */
     $event = self::create($data);
     self::$preventcreatecall = true;
     $event->set_assign($assign);
     $event->add_record_snapshot('user', $user);
     return $event;
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:20,代码来源:submission_locked.php

示例11: create_from_submission

 /**
  * Create instance of event.
  *
  * @since Moodle 2.7
  *
  * @param \assign $assign
  * @param \stdClass $submission
  * @return statement_accepted
  */
 public static function create_from_submission(\assign $assign, \stdClass $submission)
 {
     $data = array('context' => $assign->get_context(), 'objectid' => $submission->id);
     self::$preventcreatecall = false;
     /** @var statement_accepted $event */
     $event = self::create($data);
     self::$preventcreatecall = true;
     $event->set_assign($assign);
     $event->add_record_snapshot('assign_submission', $submission);
     return $event;
 }
开发者ID:pzhu2004,项目名称:moodle,代码行数:20,代码来源:statement_accepted.php

示例12: annotate_plugin_config_files

 /**
  * Annotate files from plugin configuration
  * @param backup_nested_element $assign the backup structure of the activity
  * @param string $subtype the plugin type to handle
  * @return void
  */
 protected function annotate_plugin_config_files(backup_nested_element $assign, $subtype)
 {
     $dummyassign = new assign(null, null, null);
     $plugins = $dummyassign->load_plugins($subtype);
     foreach ($plugins as $plugin) {
         $component = $plugin->get_subtype() . '_' . $plugin->get_type();
         $areas = $plugin->get_config_file_areas();
         foreach ($areas as $area) {
             $assign->annotate_files($component, $area, null);
         }
     }
 }
开发者ID:gabrielrosset,项目名称:moodle,代码行数:18,代码来源:backup_assign_stepslib.php

示例13: create_from_submission

 /**
  * Create instance of event.
  *
  * @since Moodle 2.7
  *
  * @param \assign $assign
  * @param \stdClass $submission
  * @param bool $editable
  * @return assessable_submitted
  */
 public static function create_from_submission(\assign $assign, \stdClass $submission, $editable)
 {
     global $USER;
     $data = array('context' => $assign->get_context(), 'objectid' => $submission->id, 'other' => array('submission_editable' => $editable));
     if (!empty($submission->userid) && $submission->userid != $USER->id) {
         $data['relateduserid'] = $submission->userid;
     }
     /** @var assessable_submitted $event */
     $event = self::create($data);
     $event->set_assign($assign);
     $event->add_record_snapshot('assign_submission', $submission);
     return $event;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:23,代码来源:assessable_submitted.php

示例14: save_dates

 public function save_dates(cm_info $cm, array $dates)
 {
     global $DB, $COURSE;
     $update = new stdClass();
     $update->id = $cm->instance;
     $update->duedate = $dates['duedate'];
     $update->allowsubmissionsfromdate = $dates['allowsubmissionsfromdate'];
     $update->cutoffdate = $dates['cutoffdate'];
     $result = $DB->update_record('assign', $update);
     $module = new assign(context_module::instance($cm->id), null, null);
     // Update the calendar and grades.
     $module->update_calendar($cm->id);
     $module->update_gradebook(false, $cm->id);
 }
开发者ID:merrill-oakland,项目名称:moodle-report_editdates,代码行数:14,代码来源:assigndates.php

示例15: get_file_info

 /**
  * Default implementation of file_get_info for plugins.
  * This is used by the filebrowser to browse a plugins file areas.
  *
  * This implementation should work for most plugins but can be overridden if required.
  * @param file_browser $browser
  * @param string $filearea
  * @param int $itemid
  * @param string $filepath
  * @param string $filename
  * @return file_info_stored
  */
 public function get_file_info($browser, $filearea, $itemid, $filepath, $filename)
 {
     global $CFG, $DB, $USER;
     $urlbase = $CFG->wwwroot . '/pluginfile.php';
     // Permission check on the itemid.
     if ($this->get_subtype() == 'assignsubmission') {
         if ($itemid) {
             $record = $DB->get_record('assign_submission', array('id' => $itemid), 'userid', IGNORE_MISSING);
             if (!$record) {
                 return null;
             }
             if (!$this->assignment->can_view_submission($record->userid)) {
                 return null;
             }
         }
     } else {
         // Not supported for feedback plugins.
         return null;
     }
     $fs = get_file_storage();
     $filepath = is_null($filepath) ? '/' : $filepath;
     $filename = is_null($filename) ? '.' : $filename;
     if (!($storedfile = $fs->get_file($this->assignment->get_context()->id, $this->get_subtype() . '_' . $this->get_type(), $filearea, $itemid, $filepath, $filename))) {
         return null;
     }
     return new file_info_stored($browser, $this->assignment->get_context(), $storedfile, $urlbase, $filearea, $itemid, true, true, false);
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:39,代码来源:assignmentplugin.php


注:本文中的assign类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。