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


PHP assign::get_return_params方法代码示例

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


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

示例1: grading_popup

 /**
  * Makes the grading interface for the pop up. Robbed from /mod/assign/locallib.php
  * line 1583ish - view_single_grade_page().
  *
  * @param array $params From $_GET
  * @param object $coursemodule The coursemodule object that the user has been authenticated
  * against
  * @param bool $data
  * @throws coding_exception
  * @global $PAGE
  * @global stdClass $CFG
  * @global moodle_database $DB
  * @global $OUTPUT
  * @global stdClass $USER
  * @return string
  */
 public function grading_popup($params, $coursemodule, $data = false)
 {
     global $PAGE, $CFG, $DB;
     $modulecontext = context_module::instance($coursemodule->id);
     $course = $DB->get_record('course', array('id' => $coursemodule->course));
     $coursecontext = context_course::instance($course->id);
     $assign = new assign($modulecontext, $coursemodule, $course);
     /* @var mod_assign_renderer $renderer */
     $renderer = $PAGE->get_renderer('mod_assign');
     $output = '';
     // Include grade form.
     require_once $CFG->dirroot . '/mod/assign/gradeform.php';
     // Need submit permission to submit an assignment.
     require_capability('mod/assign:grade', $modulecontext);
     /* Pinched from private method assign::get_grading_userid_list() */
     $filter = get_user_preferences('assign_filter', '');
     $table = new assign_grading_table($assign, 0, $filter, 0, false);
     $useridlist = $table->get_column_data('userid');
     $userid = $params['userid'];
     $rownum = 0;
     foreach ($useridlist as $key => $useridinlist) {
         if ($useridinlist == $userid) {
             $rownum = $key;
             reset($useridlist);
             // Just in case.
             break;
         }
     }
     $last = false;
     if ($rownum == count($useridlist) - 1) {
         $last = true;
     }
     $user = $DB->get_record('user', array('id' => $userid));
     if ($user) {
         $output .= $renderer->render(new assign_user_summary($user, $course->id, has_capability('moodle/site:viewfullnames', $coursecontext)));
     }
     $submission = $DB->get_record('assign_submission', array('assignment' => $assign->get_instance()->id, 'userid' => $userid));
     // Get the current grade. Pinched from assign::get_user_grade().
     $grade = $DB->get_record('assign_grades', array('assignment' => $assign->get_instance()->id, 'userid' => $userid));
     // Pinched from assign::is_graded().
     $isgraded = !empty($grade) && $grade->grade !== null && $grade->grade >= 0;
     if ($assign->can_view_submission($userid)) {
         $gradelocked = $grade && $grade->locked || $assign->grading_disabled($userid);
         $widget = new assign_submission_status($assign->get_instance()->allowsubmissionsfromdate, $assign->get_instance()->alwaysshowdescription, $submission, $assign->is_any_submission_plugin_enabled(), $gradelocked, $isgraded, $assign->get_instance()->duedate, $assign->get_submission_plugins(), $assign->get_return_action(), $assign->get_return_params(), $assign->get_course_module()->id, assign_submission_status::GRADER_VIEW, false, false);
         $output .= $renderer->render($widget);
     }
     if ($grade) {
         $data = new stdClass();
         if ($grade->grade !== null && $grade->grade >= 0) {
             $data->grade = format_float($grade->grade, 2);
         }
     } else {
         $data = new stdClass();
         $data->grade = '';
     }
     // Now show the grading form.
     $customdata = array('useridlist' => $useridlist, 'rownum' => $rownum, 'last' => $last);
     $mform = new mod_assign_grade_form(block_ajax_marking_form_url($params), array($assign, $data, $customdata), 'post', '', array('class' => 'gradeform'));
     $output .= $renderer->render(new assign_form('gradingform', $mform));
     $assign->add_to_log('view grading form', get_string('viewgradingformforstudent', 'assign', array('id' => $user->id, 'fullname' => fullname($user))));
     return $output;
 }
开发者ID:nadavkav,项目名称:moodle-block_ajax_marking,代码行数:78,代码来源:block_ajax_marking_assign.class.php


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