• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP workshop_get_assessments函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: error

if (!($newsubmission->id = insert_record("workshop_submissions", $newsubmission))) {
    error("Workshop submission: Failure to create new submission record!");
}
// see if this is a resubmission by looking at the previous submissions...
if ($submissions and $workshop->submissionstart > time()) {
    // ...but not teacher submissions
    // find the last submission
    foreach ($submissions as $submission) {
        $lastsubmission = $submission;
        break;
    }
    // find all the possible assessments of this submission
    // ...and if they have been assessed give the assessor a new assessment
    // based on their old assessment, if the assessment has not be made
    // just delete it!
    if ($assessments = workshop_get_assessments($submission, 'ALL')) {
        foreach ($assessments as $assessment) {
            if ($assessment->timecreated < $timenow) {
                // a Cold or Warm assessment...
                if ($assessment->userid != $USER->id) {
                    // only copy other students assessment not the self assessment (if present)
                    // copy it with feedback..
                    $newassessment = workshop_copy_assessment($assessment, $newsubmission, true);
                    // set the resubmission flag so student can be emailed/told about
                    // this assessment
                    set_field("workshop_assessments", "resubmission", 1, "id", $newassessment->id);
                }
            } else {
                // a hot assessment, was not used, just dump it
                delete_records("workshop_assessments", "id", $assessment->id);
            }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:31,代码来源:upload.php


示例2: workshop_submission_grade

function workshop_submission_grade($workshop, $submission)
{
    // returns the current (external) grade of the submission based on the "good" (cold) assessments
    // (needed as it's called by grade)
    $grade = 0;
    if ($assessments = workshop_get_assessments($submission)) {
        $n = 0;
        foreach ($assessments as $assessment) {
            if ($workshop->agreeassessments and !$assessment->timeagreed) {
                // ignore assessments which have not been agreed
                continue;
            }
            if ($assessment->gradinggrade or !$assessment->timegraded) {
                // a good assessment (or one that has not been graded yet)
                if (workshop_is_teacher($workshop, $assessment->userid)) {
                    $timenow = time();
                    if ($timenow > $workshop->releasegrades) {
                        // teacher's grade is available
                        $grade += $workshop->teacherweight * $assessment->grade;
                        $n += $workshop->teacherweight;
                    }
                } else {
                    $grade += $assessment->grade;
                    $n++;
                }
            }
        }
        if ($n) {
            // stop division by zero
            $grade = $grade / $n;
        }
    }
    return number_format($grade * $workshop->grade / 100, 1);
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:34,代码来源:lib.php


示例3: workshop_print_submission_assessments

function workshop_print_submission_assessments($workshop, $submission, $type)
{
    global $USER, $CFG;
    // Returns the teacher or peer grade and a hyperlinked list of grades for this submission
    if (!($cm = get_coursemodule_from_instance("workshop", $workshop->id, $workshop->course))) {
        error("Course Module ID was incorrect");
    }
    $str = '';
    // get the assessments in grade order, highest first
    if ($assessments = workshop_get_assessments($submission, "", "grade DESC")) {
        if ($type == 'teacher' or $type == 'all') {
            // students can see teacher assessments only if the release date has passed
            $timenow = time();
            if (workshop_is_teacher($workshop, $USER->id) or $timenow > $workshop->releasegrades) {
                foreach ($assessments as $assessment) {
                    if (workshop_is_teacher($workshop, $assessment->userid)) {
                        if ($type == 'all') {
                            $str .= workshop_fullname($assessment->userid, $workshop->course) . ': ';
                        }
                        $str .= "<a href=\"viewassessment.php?aid={$assessment->id}\">" . "[" . number_format($assessment->grade * $workshop->grade / 100, 0) . "]</a>";
                        if (workshop_is_teacher($workshop, $USER->id)) {
                            $str .= ' <a title="' . get_string('reassess', 'workshop') . "\" href=\"assess.php?id={$cm->id}&amp;sid={$submission->id}\"><img src=\"{$CFG->pixpath}/t/edit.gif\" " . ' class="iconsmall" alt="' . get_string('reassess', 'workshop') . '" /></a>';
                            $str .= ' <a title="' . get_string('delete', 'workshop') . "\" href=\"assessments.php?action=confirmdelete&amp;wid={$workshop->id}&amp;aid={$assessment->id}\"><img src=\"{$CFG->pixpath}/t/delete.gif\" " . ' class="iconsmall" alt="' . get_string('delete', 'workshop') . '" /></a><br />';
                        }
                    }
                }
            }
        }
        if ($type == 'student' or $type == 'all') {
            foreach ($assessments as $assessment) {
                if (workshop_is_student($workshop, $assessment->userid)) {
                    if ($type == 'all') {
                        $str .= workshop_fullname($assessment->userid, $workshop->course) . ': ';
                    }
                    $str .= "<a href=\"viewassessment.php?aid={$assessment->id}\">";
                    if ($workshop->agreeassessments and !$assessment->timeagreed and workshop_is_student($workshop, $submission->userid)) {
                        // agreement on student work only
                        $str .= "&lt;&lt;" . number_format($assessment->grade * $workshop->grade / 100, 0) . " (" . number_format($assessment->gradinggrade * $workshop->gradinggrade / 100, 0) . ")&gt;&gt;</a> ";
                    } elseif ($assessment->timegraded) {
                        if ($assessment->gradinggrade) {
                            $str .= "{" . number_format($assessment->grade * $workshop->grade / 100, 0);
                            if ($assessment->teachergraded) {
                                $str .= " [" . number_format($assessment->gradinggrade * $workshop->gradinggrade / 100, 0) . "]}</a> ";
                            } else {
                                $str .= " (" . number_format($assessment->gradinggrade * $workshop->gradinggrade / 100, 0) . ")}</a> ";
                            }
                        } else {
                            $str .= "&lt;" . number_format($assessment->grade * $workshop->grade / 100, 0) . " (0)&gt;</a> ";
                        }
                    } else {
                        $str .= "{" . number_format($assessment->grade * $workshop->grade / 100, 0) . "}</a> ";
                    }
                    $str .= '<br />';
                }
            }
        }
    }
    if (!$str) {
        $str = "&nbsp;";
        // be kind to Mozilla browsers!
    }
    return $str;
}
开发者ID:r007,项目名称:PMoodle,代码行数:63,代码来源:locallib.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP workshop_is_student函数代码示例发布时间:2022-05-23
下一篇:
PHP wordwrap函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap