當前位置: 首頁>>代碼示例>>PHP>>正文


PHP workshop_is_student函數代碼示例

本文整理匯總了PHP中workshop_is_student函數的典型用法代碼示例。如果您正苦於以下問題:PHP workshop_is_student函數的具體用法?PHP workshop_is_student怎麽用?PHP workshop_is_student使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了workshop_is_student函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: workshop_count_ungraded_assessments

function workshop_count_ungraded_assessments($workshop)
{
    // function returns the number of ungraded assessments by students
    global $CFG;
    $timenow = time();
    $n = 0;
    // get all the cold assessments that have not been graded
    if ($assessments = get_records_select("workshop_assessments", "workshopid = {$workshop->id} AND\n            (timecreated + {$CFG->maxeditingtime}) < {$timenow} AND timegraded = 0")) {
        foreach ($assessments as $assessment) {
            if (workshop_is_student($workshop, $assessment->userid)) {
                $n++;
            }
        }
    }
    return $n;
}
開發者ID:nagyistoce,項目名稱:moodle-Teach-Pilot,代碼行數:16,代碼來源:lib.php

示例2: set_field

 // ...and the resubmission flag
 set_field("workshop_assessments", "resubmission", 0, "id", $assessment->id);
 // if there's examples or peer assessments clear the counter in the submission so that
 // all assessments for this submission will be regraded
 if ($workshop->ntassessments or $workshop->nsassessments) {
     set_field("workshop_submissions", "nassessments", 0, "id", $submission->id);
     workshop_grade_assessments($workshop);
 } else {
     // it could be self assessment....
     // now see if there's a corresponding assessment so that the gradinggrade can be set
     if (workshop_is_teacher($workshop)) {
         // see if there's are student assessments, if so set their gradinggrade
         if ($assessments = workshop_get_assessments($submission)) {
             foreach ($assessments as $studentassessment) {
                 // skip if it's not a student assessment
                 if (!workshop_is_student($workshop, $studentassessment->userid)) {
                     continue;
                 }
                 $gradinggrade = workshop_compare_assessments($workshop, $assessment, $studentassessment);
                 set_field("workshop_assessments", "timegraded", $timenow, "id", $studentassessment->id);
                 set_field("workshop_assessments", "gradinggrade", $gradinggrade, "id", $studentassessment->id);
             }
         }
     } else {
         //it's a student assessment, see if there's a corresponding teacher's assessment
         if ($assessments = workshop_get_assessments($submission)) {
             foreach ($assessments as $teacherassessment) {
                 if (workshop_is_teacher($workshop, $teacherassessment->userid)) {
                     $gradinggrade = workshop_compare_assessments($workshop, $assessment, $teacherassessment);
                     set_field("workshop_assessments", "timegraded", $timenow, "id", $assessment->id);
                     set_field("workshop_assessments", "gradinggrade", $gradinggrade, "id", $assessment->id);
開發者ID:edwinphillips,項目名稱:moodle-485cb39,代碼行數:31,代碼來源:assessments.php

示例3: require_login

require_login($course->id, false, $cm);
$strworkshops = get_string('modulenameplural', 'workshop');
$strworkshop = get_string('modulename', 'workshop');
$strsubmission = get_string('submission', 'workshop');
$navigation = build_navigation($strsubmission, $cm);
print_header_simple(format_string($workshop->name) . " : {$strsubmission}", "", $navigation, "", "", true);
$timenow = time();
$form = data_submitted("nomatch");
// POST may come from two forms
// don't be picky about not having a title
if (!($title = $form->title)) {
    $title = get_string("notitle", "workshop");
}
// check that this is not a "rapid" second submission, caused by using the back button
// only check if a student, teachers may want to submit a set of workshop examples rapidly
if (workshop_is_student($workshop)) {
    if ($submissions = workshop_get_user_submissions($workshop, $USER)) {
        // returns all submissions, newest on first
        foreach ($submissions as $submission) {
            if ($submission->timecreated > $timenow - $CFG->maxeditingtime) {
                // ignore this new submission
                redirect("view.php?id={$cm->id}");
                print_footer($course);
                exit;
            }
        }
    }
}
// get the current set of submissions
$submissions = workshop_get_user_submissions($workshop, $USER);
// add new submission record
開發者ID:JackCanada,項目名稱:moodle-hacks,代碼行數:31,代碼來源:upload.php

示例4: 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_is_student函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。