本文整理汇总了PHP中isteacheredit函数的典型用法代码示例。如果您正苦于以下问题:PHP isteacheredit函数的具体用法?PHP isteacheredit怎么用?PHP isteacheredit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isteacheredit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: groups_get_user_displayname
/**
* Returns the display name of a user - the full name of the user
* prefixed by '#' for editing teachers and '-' for teachers.
* @param int $userid The ID of the user.
* @param int $courseid The ID of the related-course.
* @return string The display name of the user.
*/
function groups_get_user_displayname($userid, $courseid)
{
if ($courseid == false) {
$fullname = false;
} else {
$user = groups_get_user($userid);
$fullname = fullname($user, true);
//TODO: isteacher, isteacheredit.
if (isteacher($courseid, $userid)) {
if (isteacheredit($courseid, $userid)) {
$prefix = '# ';
} else {
$prefix = '- ';
}
$fullname = $prefix . $fullname;
}
}
return $fullname;
}
开发者ID:veritech,项目名称:pare-project,代码行数:26,代码来源:utillib.php
示例2: getRoleForWimbaTools
function getRoleForWimbaTools($courseId, $userId)
{
global $CFG;
global $USER;
$role = "";
if (strstr($CFG->release, "1.7")) {
$context = get_context_instance(CONTEXT_COURSE, $courseId);
}
// the role of the current user is switched
if (isset($USER->studentview) && $USER->studentview == 1 || isset($context) && isset($USER->switchrole) && !empty($USER->switchrole) && $USER->switchrole[$context->id] > 3) {
$role = 'StudentBis';
} else {
if (isstudent($courseId)) {
// Student
$role = 'Student';
} else {
if (isadmin() || isteacher($courseId, $USER->id)) {
// Admin, Teacher
$role = 'Instructor';
}
}
if (strstr($CFG->release, "1.7")) {
// 1.7.* version
if (iscreator()) {
// Course Creator
$role = 'Instructor';
} else {
if (!isteacheredit($courseId)) {
// Non-editing Teacher
$role = 'Student';
}
}
}
}
return $role;
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:36,代码来源:WimbaLib.php
示例3: array
$link1 = "<a class=\"dimmed\" href=\"{$CFG->wwwroot}/course/mod.php?update=" . $metadatalom->coursemodule . "&sesskey=" . $USER->sesskey . "\"><img src=\"" . $CFG->pixpath . "/t/edit.gif\" height=\"11\" width=\"11\" border=\"0\" alt=\"" . $strupdate . "\" /></a> <a class=\"dimmed\" href=\"{$CFG->wwwroot}/course/mod.php?delete=" . $metadatalom->coursemodule . "&sesskey=" . $USER->sesskey . "\"><img src=\"" . $CFG->pixpath . "/t/delete.gif\" height=\"11\" width=\"11\" border=\"0\" alt=\"" . $strdelete . "\" /></a> <a class=\"dimmed\" href=\"{$CFG->wwwroot}/course/mod.php?show=" . $metadatalom->coursemodule . "&sesskey=" . $USER->sesskey . "\"><img src=\"" . $CFG->pixpath . "/t/show.gif\" height=\"11\" width=\"11\" border=\"0\" alt=\"" . $strshow . "\" /></a>";
$link2 = "<a class=\"dimmed\" href=\"{$CFG->wwwroot}/mod/" . $modlo[$metadatalom->resource] . "/view.php?id=" . $metadatalom->resource . "\">" . $namelo[$metadatalom->resource] . " (" . $modlo[$metadatalom->resource] . ")</a>";
$link3 = "<a class=\"dimmed\" href=\"view.php?id={$metadatalom->coursemodule}\"><b>Simple LOM</b></a>";
$link4 = "<a class=\"dimmed\" href=\"view_lom.php?id={$metadatalom->coursemodule}\"><b>Complete LOM</b></a>";
$link5 = "<a class=\"dimmed\" href=\"view_imslrm.php?id={$metadatalom->coursemodule}\"><b>IMS-LRM to LOM</b></a>";
} else {
//Show normal if the mod is visible
$link = "<a href=\"view.php?id={$metadatalom->coursemodule}\">{$metadatalom->name}</a>";
$link1 = "<a href=\"{$CFG->wwwroot}/course/mod.php?update=" . $metadatalom->coursemodule . "&sesskey=" . $USER->sesskey . "\"><img src=\"" . $CFG->pixpath . "/t/edit.gif\" height=\"11\" width=\"11\" border=\"0\" alt=\"" . $strupdate . "\" /></a> <a href=\"{$CFG->wwwroot}/course/mod.php?delete=" . $metadatalom->coursemodule . "&sesskey=" . $USER->sesskey . "\"><img src=\"" . $CFG->pixpath . "/t/delete.gif\" height=\"11\" width=\"11\" border=\"0\" alt=\"" . $strdelete . "\" /></a> <a href=\"{$CFG->wwwroot}/course/mod.php?hide=" . $metadatalom->coursemodule . "&sesskey=" . $USER->sesskey . "\"><img src=\"" . $CFG->pixpath . "/t/hide.gif\" height=\"11\" width=\"11\" border=\"0\" alt=\"" . $strshow . "\" /></a>";
$link2 = "<a href=\"{$CFG->wwwroot}/mod/" . $modlo[$metadatalom->resource] . "/view.php?id=" . $metadatalom->resource . "\">" . $namelo[$metadatalom->resource] . " (" . $modlo[$metadatalom->resource] . ")</a>";
$link3 = "<a href=\"view.php?id={$metadatalom->coursemodule}\"><b>Simple LOM</b></a>";
$link4 = "<a href=\"view_lom.php?id={$metadatalom->coursemodule}\"><b>Complete LOM</b></a>";
$link5 = "<a href=\"view_imslrm.php?id={$metadatalom->coursemodule}\"><b>IMS-LRM to LOM</b></a>";
}
}
if (isteacheredit($course->id) & ($course->format == "weeks" or $course->format == "topics")) {
$table->data[] = array($metadatalom->section, $link, $link2, $link3, $link4, $link5, $link1);
} elseif (!isteacheredit($course->id) & ($course->format == "weeks" or $course->format == "topics")) {
$table->data[] = array($metadatalom->section, $link, $link2, $link3, $link4, $link5);
} elseif (isteacheredit($course->id) & (!$course->format == "weeks" or !$course->format == "topics")) {
$table->data[] = array($link, $link2, $link3, $link4, $link5, $link1);
} elseif (!isteacheredit($course->id) & (!$course->format == "weeks" or !$course->format == "topics")) {
$table->data[] = array($link, $link2, $link3, $link4, $link5);
} else {
$table->data[] = array($link, $link2, $link3, $link4, $link5);
}
}
echo "<br />";
print_table($table);
/// Finish the page
print_footer($course);
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:index.php
示例4: get_string
echo "<p style='color:red;text-align:center;margin:0;font-size:0.8em;font-weight:bold;'>" . get_string('errordb', 'podcast') . "</p>";
}
break;
case 1:
$tab = "add";
echo "<p style='color:red;text-align:center;font-size:0.8em;font-weight:bold;'>" . get_string('badextension', 'podcast');
echo " " . implode(", ", get_podcast_limit_mimetypes()) . "</p>";
break;
case 2:
$tab = "add";
echo "<p style='color:red;text-align:center;font-size:0.8em;font-weight:bold;'>" . get_string('title_empty', 'podcast') . "</p>";
break;
default:
}
}
// Delete Item
$action = optional_param('action', "view", PARAM_ALPHA);
if ($action == "delete" && isteacheredit($course->id)) {
$id_item = optional_param('id_item', 0, PARAM_INT);
if (!delete_records_select("podcast_structure", "id = " . $id_item)) {
error("Could not delete item podcast");
} else {
echo "<p style='color:green;text-align:center;font-size:0.8em;font-weight:bold;'>" . get_string('del_ok', 'podcast') . "</p>";
unset($form);
// XML
if (make_xml_podcast($podcast)) {
echo "<p style='color:green;text-align:center;font-size:0.8em;font-weight:bold;'>" . get_string('xml_ok', 'podcast') . "</p>";
} else {
echo "<p style='color:red;text-align:center;font-size:0.8em;font-weight:bold;'>" . get_string('xml_error', 'podcast') . "</p>";
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:view.php
示例5: create_tree_menu
/**
* Create whole hierarchical Tree
*
* @uses $CFG
* @param array $categories
* @param object &$pnode
* @return void
*/
function create_tree_menu($categories, &$pnode)
{
global $CFG;
$ficon = 'folder.gif';
//Cr: changed name of variable from nicon to ficon to better reflect its content
$feicon = 'folder-expanded.gif';
//Cr: changed name of variable from eicon to feicon to better reflect its content
$cicon = 'course.gif';
$cacticon = 'courseact.gif';
$cinacticon = 'courseinact.gif';
$cmycicon = 'coursemyc.gif';
foreach ($categories as $catid => $catnode) {
if (!$catnode->hascourses) {
continue;
}
$linkcss = '';
$cssclass = 'treeMenuDefault';
$url = $CFG->wwwroot . '/course/category.php?id=' . $catnode->id . '" title="' . htmlspecialchars($catnode->name, ENT_QUOTES) . $linkcss;
//categories have no fullname field
if (!empty($this->selectedcat) && $this->selectedcat == $catnode->id) {
$cssclass = 'treeMenuDefault highlight';
}
$node =& $pnode->addItem(new HTML_TreeNode(array('text' => ' ' . $catnode->name, 'link' => $url, 'icon' => $ficon, 'expandedIcon' => $feicon, 'cssClass' => $cssclass)));
if (!empty($catnode->categories)) {
$this->create_tree_menu($catnode->categories, $node);
}
if (!empty($catnode->courses)) {
foreach ($catnode->courses as $course) {
$linkcss = '';
//Cr: I am not sure here, but I guess that a specific css for links could
// be specified here or below
if (!$this->admin && $this->teacher && isteacheredit($course->id)) {
if ($course->visible) {
$icon = $cmycicon;
} else {
$icon = $cinacticon;
}
} else {
if (!$this->admin && !$this->teacher) {
$icon = $cicon;
} else {
if ($course->visible) {
$icon = $cacticon;
} else {
$linkcss .= '';
//Cr: dito for this particular case I guess, like $cssclass
$icon = $cinacticon;
}
}
}
if ($this->course->id == $course->id) {
$url = '';
$text = $course->shortname;
$cssclass = 'treeMenuBold';
} else {
$url = $CFG->wwwroot . '/course/view.php?id=' . $course->id . '" title="' . htmlspecialchars($course->fullname, ENT_QUOTES) . $linkcss;
$text = $course->shortname;
$cssclass = 'treeMenuDefault';
}
$node->addItem(new HTML_TreeNode(array('text' => $text, 'link' => $url, 'icon' => $icon, 'cssClass' => $cssclass)));
}
}
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:72,代码来源:block_myCourses.php
示例6:
$edit&& (isteacheredit($course->id)) || (($suggestion->opentostudents==1)) &&
(($suggestion->groupid == 0 )|| ($suggestion->groupid == $groupid))
) {
?>
<a href="suggestions.php?suggestionid=<?=$suggestion->id?>&id=<?=$cm->id?>&backbtn=1&edit=1&chapterid=<?=$chapterid?>&pageid=<?php echo $pageid ?>&suggestionnum=<?= $suggestion->suggestionnum?>&groupid=<?php echo $groupid?>"><img src="<?= $CFG->pixpath?>/t/edit.gif" border="0"></a>
<a href="suggestions.php?suggestionid=<?=$suggestion->id?>&id=<?=$cm->id?>&delete=1&edit=1&chapterid=<?=$chapterid?>&pageid=<?php echo $pageid ?>&groupid=<?php echo $groupid?>"><img src="<?= $CFG->pixpath?>/t/delete.gif" border="0"></a>
<? $i++;
}
if(isteacheredit($course->id) & $edit){
if ($suggestion->opentostudents==1) {
echo '<a title="'.get_string('lock','hiperbook').'" href="lock.php?id='.$cm->id.'&suggestionid='.$suggestion->id.'&sesskey='.$USER->sesskey.'&mode=suggestion&lock=1"><img src="'.$CFG->pixpath.'/i/lock.gif" height="11" width="11" border="0" /></a>';
} else{
echo '<a title="'.get_string('unlock','hiperbook').'" href="lock.php?id='.$cm->id.'&suggestionid='.$suggestion->id.'&sesskey='.$USER->sesskey.'&mode=suggestion&lock=0"><img src="'.$CFG->pixpath.'/i/unlock.gif" height="11" width="11" border="0" /></a>';
}
}
?>
<br>
开发者ID:ronniebrito,项目名称:moodle_hiperbook,代码行数:31,代码来源:suggestions.php
示例7: feedback_is_completed
function feedback_is_completed($mod, $userid)
{
return isteacheredit($mod->course) || get_record("feedback_completed", "feedback", $mod->instance, "userid", $userid) ? true : false;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:4,代码来源:modulelib.php
示例8: nanogong_unlock_all_messages
/**
* Unlock messages in the NanoGong database.
**/
function nanogong_unlock_all_messages($nanogong, $groupid)
{
global $CFG, $USER;
if (!isteacheredit($nanogong->course)) {
return false;
}
if (empty($groupid)) {
$students = get_course_students($nanogong->course, "u.lastname, u.firstname");
} else {
$students = get_course_students($nanogong->course, "u.lastname, u.firstname", '', '', '', '', '', $groupid);
}
if (!$students) {
$students = array();
}
foreach ($students as $student) {
$nanogong_messages = get_records_select("nanogong_message", "nanogongid={$nanogong->id} AND userid={$student->id}");
if (!$nanogong_messages) {
$nanogong_messages = array();
}
foreach ($nanogong_messages as $nanogong_message) {
$nanogong_message->locked = 0;
update_record("nanogong_message", $nanogong_message);
}
}
return true;
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:29,代码来源:locallib.php
示例9: required_param
require_once "../../config.php";
require_once "lib.php";
//edited Justin 2008/08/08
$id = required_param('id', PARAM_INT);
// course
//require_variable($id); // course
if (!($course = get_record("course", "id", $id))) {
error("Course ID is incorrect");
}
require_login($course->id);
add_to_log($course->id, "poodllflashcard", "view all", "index.php?id={$course->id}", "");
/// Get all required strings
$strflashcards = get_string("modulenameplural", "poodllflashcard");
$strflashcard = get_string("modulename", "poodllflashcard");
/// Print the header
$streditquestions = isteacheredit($course->id) ? "<form target=\"_parent\" method=\"get\" " . " action=\"{$CFG->wwwroot}/mod/quiz/edit.php\">" . "<input type=\"hidden\" name=\"courseid\" " . " value=\"{$course->id}\" />" . "<input type=\"submit\" " . " value=\"" . get_string("editquestions", "quiz") . "\" /></form>" : "";
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id={$course->id}\">{$course->shortname}</A> ->";
}
print_header("{$course->shortname}: {$strflashcards}", "{$course->fullname}", "{$navigation} {$strflashcards}", "", "", true, $streditquestions, navmenu($course));
/// Get all the appropriate data
if (!($flashcards = get_all_instances_in_course("poodllflashcard", $course))) {
notice("There are no PoodLL Flashcards", "../../course/view.php?id={$course->id}");
die;
}
/// Print the list of instances (your module will probably extend this)
$timenow = time();
$strname = get_string("name");
$strweek = get_string("week");
$strtopic = get_string("topic");
if ($course->format == "weeks") {
开发者ID:laiello,项目名称:poodll,代码行数:31,代码来源:index.php
示例10: hiperbook_edit_button
function hiperbook_edit_button($id, $courseid, $chapterid, $navigationnum, $pagenum, $target_navigation_chapter)
{
global $CFG, $USER;
if (isteacheredit($courseid)) {
if (!empty($USER->editing)) {
$string = get_string("turneditingoff");
$edit = '0';
} else {
$string = get_string("turneditingon");
$edit = '1';
}
return '<form target="' . $CFG->framename . '" method="get" action="' . $CFG->wwwroot . '/mod/hiperbook/view.php">' . '<input type="hidden" name="id" value="' . $id . '" />' . '<input type="hidden" name="chapterid" value="' . $chapterid . '" />' . '<input type="hidden" name="navigationnum" value="' . $navigationnum . '" />' . '<input type="hidden" name="pagenum" value="' . $pagenum . '" />' . '<input type="hidden" name="target_navigation_chapter" value="' . $target_navigation_chapter . '" />' . '<input type="hidden" name="edit" value="' . $edit . '" />' . '<input type="submit" value="' . $string . '" /></form>';
} else {
return '';
}
}
开发者ID:ronniebrito,项目名称:moodle_hiperbook,代码行数:16,代码来源:lib.php
示例11: p
<?php
if (!empty($mod->scale) && $mod->scale != 0 && $isteacher) {
?>
| <a href="grades.php?id=<?php
p($cm->id);
?>
&sesskey=<?php
p($USER->sesskey);
?>
"><?php
print_string("grades");
?>
</a>
<?php
}
if (isteacheredit($course->id) and $canbepublished) {
$stroutpublished = empty($mod->published) ? get_string('outpublish', 'netpublish') : get_string('outunpublish', 'netpublish');
?>
| <a href="outpublish.php?id=<?php
p($cm->id);
?>
&sesskey=<?php
p($USER->sesskey);
?>
"><?php
echo $stroutpublished;
?>
</a> ]
<?php
} else {
echo " ]";
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:editnavi.php
示例12: book_edit_button
function book_edit_button($id, $courseid, $chapterid)
{
global $CFG, $USER;
if (isteacheredit($courseid)) {
if (!empty($USER->editing)) {
$string = get_string("turneditingoff");
$edit = '0';
} else {
$string = get_string("turneditingon");
$edit = '1';
}
return '<form method="get" action="' . $CFG->wwwroot . '/mod/book/view.php"><div>' . '<input type="hidden" name="id" value="' . $id . '" />' . '<input type="hidden" name="chapterid" value="' . $chapterid . '" />' . '<input type="hidden" name="edit" value="' . $edit . '" />' . '<input type="submit" value="' . $string . '" /></div></form>';
} else {
return '';
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:16,代码来源:lib.php
示例13: error
error('Course Module ID is incorrect');
}
if (!($course = get_record('course', 'id', $cm->course))) {
error('Course is misconfigured');
}
if ($course->category) {
require_login($course->id);
}
if (!($book = get_record('hiperbook', 'id', $cm->instance))) {
error('Course module is incorrect');
}
$navchapter = get_record('hiperbook_navigation_chapters', 'id', $target_navigation_chapter);
if (!($chapter = get_record('hiperbook_chapters', 'id', $navchapter->chapterid))) {
error('Chapter is misconfigured');
}
if (!isteacheredit($course->id) & $chapter->opentostudents == 0) {
error('Only editing teachers can edit hiperbooks!', $_SERVER['HTTP_REFERER']);
}
if ($addprev == 0 & $addnext == 0) {
$page = get_record('hiperbook_chapters_pages', 'chapterid', $navchapter->chapterid, 'pagenum', $pagenum);
}
// =========================================================================
// security checks END
// =========================================================================
$usehtmleditor = can_use_html_editor();
if ($delete == 1) {
//echo 'apaga';
// apaga a pagina com pagenum do parametro, subtraindo 1 de pagenum das paginas com pagenum > pagenum apagada
delete_records('hiperbook_chapters_pages', 'chapterid', $chapter->id, 'pagenum', $pagenum);
$err = execute_sql("update " . $CFG->prefix . "hiperbook_chapters_pages set pagenum = (pagenum -1) where chapterid = '{$chapter->id}' and pagenum > '{$pagenum}'");
$npnum = $page->pagenum - 1;
开发者ID:ronniebrito,项目名称:moodle_hiperbook,代码行数:31,代码来源:page.php
示例14: array
$table->align = array("center", "left");
} else {
if ($course->format == "topics") {
$table->head = array($strtopic, $strname);
$table->align = array("center", "left");
} else {
$table->head = array($strname);
$table->align = array("left");
}
}
if (function_exists('groups_get_all_groups')) {
$currentgroup = groups_get_all_groups($course->id);
} else {
$currentgroup = get_current_group($course->id);
}
if ($currentgroup and isteacheredit($course->id)) {
$group = $DB->get_record("groups", array("id" => $currentgroup));
$groupname = " ({$group->name})";
} else {
$groupname = "";
}
$currentsection = "";
foreach ($equellas as $equella) {
$url = new moodle_url('/mod/equella/view.php', array('id' => $equella->coursemodule));
$attr = array();
if (!$equella->visible) {
$attr = array('class' => 'dimmed');
}
$link = html_writer::link($url, $equella->name, $attr);
$printsection = "";
if ($equella->section !== $currentsection) {
开发者ID:CTANZ,项目名称:moodle-mod_equella,代码行数:31,代码来源:index.php
示例15: optional_param
$add = optional_param('add', 0, PARAM_INT);
// View mode
require_login();
if (!($cm = get_record('course_modules', 'id', $id))) {
error('Course Module ID was incorrect');
}
if (!($course = get_record('course', 'id', $cm->course))) {
error('Course is misconfigured');
}
if (!($book = get_record('hiperbook', 'id', $cm->instance))) {
error('Course module is incorrect');
}
if (!($page = get_record('hiperbook_chapters_pages', 'id', $pageid))) {
error('Page incorrect');
}
if (!isteacheredit($course->id) and !$page->opentostudents) {
error('Unable to edit!', $_SERVER['HTTP_REFERER']);
}
$usehtmleditor = can_use_html_editor();
print_header("", null, "", '', '<style type="text/css">@import url(' . $CFG->wwwroot . '/mod/hiperbook/book_theme.css);</style>', true, null, null);
?>
<style type="text/css">
.corpotexto { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #003366; text-align: left; line-height: 15px}
-->
<?php
echo $CFG->default_template_css;
开发者ID:ronniebrito,项目名称:moodle_hiperbook,代码行数:31,代码来源:links.php
示例16: get_list_members
function get_list_members($course, &$nonmembers, &$listgroups)
{
/// First, get everyone into the nonmembers array
if ($students = get_course_students($course->id)) {
foreach ($students as $student) {
$nonmembers[$student->id] = fullname($student, true);
}
unset($students);
}
if ($teachers = get_course_teachers($course->id)) {
foreach ($teachers as $teacher) {
$prefix = '- ';
if (isteacheredit($course->id, $teacher->id)) {
$prefix = '# ';
}
$nonmembers[$teacher->id] = $prefix . fullname($teacher, true);
}
unset($teachers);
}
/// Pull out all the members into little arrays
$groups = get_groups($course->id);
if ($groups) {
foreach ($groups as $group) {
$countusers = 0;
$listmembers[$group->id] = array();
if ($groupusers = get_group_users($group->id)) {
foreach ($groupusers as $groupuser) {
$listmembers[$group->id][$groupuser->id] = $nonmembers[$groupuser->id];
//unset($nonmembers[$groupuser->id]);
$countusers++;
}
natcasesort($listmembers[$group->id]);
}
$listgroups[$group->id] = $group->name . " ({$countusers})";
}
natcasesort($listgroups);
}
natcasesort($nonmembers);
if (empty($selectedgroup)) {
// Choose the first group by default
if (!empty($listgroups) && ($selectedgroup = array_shift(array_keys($listgroups)))) {
$members = $listmembers[$selectedgroup];
}
} else {
$members = $listmembers[$selectedgroup];
}
return $listmembers;
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:48,代码来源:lib.php
示例17: exercise_list_submissions_for_admin
function exercise_list_submissions_for_admin($exercise)
{
// list the teacher sublmissions first
global $CFG, $USER;
if (!($course = get_record("course", "id", $exercise->course))) {
error("Course is misconfigured");
}
if (!($cm = get_coursemodule_from_instance("exercise", $exercise->id, $course->id))) {
error("Course Module ID was incorrect");
}
$groupid = get_current_group($course->id);
exercise_print_assignment_info($exercise);
print_heading_with_help(get_string("administration"), "administration", "exercise");
echo "<p align=\"center\"><b><a href=\"assessments.php?action=teachertable&id={$cm->id}\">" . get_string("teacherassessmenttable", "exercise", $course->teacher) . "</a></b></p>\n";
if (isteacheredit($course->id)) {
// list any teacher submissions
$table->head = array(get_string("title", "exercise"), get_string("submitted", "exercise"), get_string("action", "exercise"));
$table->align = array("left", "left", "left");
$table->size = array("*", "*", "*");
$table->cellpadding = 2;
$table->cellspacing = 0;
if ($submissions = exercise_get_teacher_submissions($exercise)) {
foreach ($submissions as $submission) {
$action = "<a href=\"submissions.php?action=adminamendtitle&id={$cm->id}&sid={$submission->id}\">" . get_string("amendtitle", "exercise") . "</a>";
if (isteacheredit($course->id)) {
$action .= " | <a href=\"submissions.php?action=adminconfirmdelete&id={$cm->id}&sid={$submission->id}\">" . get_string("delete", "exercise") . "</a>";
}
$table->data[] = array(exercise_print_submission_title($exercise, $submission), userdate($submission->timecreated), $action);
}
print_heading(get_string("studentsubmissions", "exercise", $course->teacher), "center");
print_table($table);
}
}
// list student assessments
// Get all the students...
if ($users = get_course_students($course->id, "u.lastname, u.firstname")) {
$timenow = time();
unset($table);
$table->head = array(get_string("name"), get_string("title", "exercise"), get_string("assessed", "exercise"), get_string("action", "exercise"));
$table->align = array("left", "left", "left", "left");
$table->size = array("*", "*", "*", "*");
$table->cellpadding = 2;
$table->cellspacing = 0;
$nassessments = 0;
foreach ($users as $user) {
// check group membership, if necessary
if ($groupid) {
// check user's group
if (!groups_is_member($groupid, $user->id)) {
continue;
// skip this user
}
}
if ($assessments = exercise_get_user_assessments($exercise, $user)) {
$title = '';
foreach ($assessments as $assessment) {
if (!($submission = get_record("exercise_submissions", "id", $assessment->submissionid))) {
error("exercise_list_submissions_for_admin: Submission record not found!");
}
$title .= $submission->title;
// test for allocated assesments which have not been done
if ($assessment->timecreated < $timenow) {
// show only warm or cold assessments
$title .= " {" . number_format($assessment->grade * $exercise->grade / 100.0, 0);
if ($assessment->timegraded) {
$title .= "/" . number_format($assessment->gradinggrade * $exercise->gradinggrade / 100.0, 0);
}
$title .= "} ";
if ($realassessments = exercise_count_user_assessments_done($exercise, $user)) {
$action = "<a href=\"assessments.php?action=adminlistbystudent&id={$cm->id}&userid={$user->id}\">" . get_string("view", "exercise") . "</a>";
} else {
$action = "";
}
$nassessments++;
$table->data[] = array(fullname($user), $title, userdate($assessment->timecreated), $action);
}
}
}
}
if (isset($table->data)) {
if ($groupid) {
if (!groups_group_exists($groupid)) {
//TODO:
error("List unassessed student submissions: group not found");
}
print_heading("{$group->name} " . get_string("studentassessments", "exercise", $course->student) . " [{$nassessments}]");
} else {
print_heading(get_string("studentassessments", "exercise", $course->student) . " [{$nassessments}]");
}
print_table($table);
echo "<p align=\"center\">" . get_string("noteonstudentassessments", "exercise");
echo "<br />{" . get_string("maximumgrade") . ": {$exercise->grade} / " . get_string("maximumgrade") . ": {$exercise->gradinggrade}}</p>\n";
// grading grade analysis
unset($table);
$table->head = array(get_string("count", "exercise"), get_string("mean", "exercise"), get_string("standarddeviation", "exercise"), get_string("maximum", "exercise"), get_string("minimum", "exercise"));
$table->align = array("center", "center", "center", "center", "center");
$table->size = array("*", "*", "*", "*", "*");
$table->cellpadding = 2;
$table->cellspacing = 0;
if ($groupid) {
//.........这里部分代码省略.........
开发者ID:r007,项目名称:PMoodle,代码行数:101,代码来源:locallib.php
示例18: error
if (!($cm = get_record('course_modules', 'id', $id))) {
error('Course Module ID is incorrect');
}
if (!($course = get_record('course', 'id', $cm->course))) {
error('Course is misconfigured');
}
if ($course->category) {
require_login($course->id);
}
if (!($book = get_record('hiperbook', 'id', $cm->instance))) {
error('Course module is incorrect');
}
$groupmode = groupmode($course, $cm);
$navpath = get_record('hiperbook_navigationpath', 'navpathnum', $navigationnum, 'bookid', $book->id);
// permiteeditar capitulo apenas se navpath estiver aberto ou para professores
if (!isteacheredit($course->id) & $navpath->opentostudents != 1) {
error('Only editing teachers can edit books!', $_SERVER['HTTP_REFERER']);
}
$chapter = get_record('hiperbook_chapters', 'id', $chapterid);
//check all variables
unset($id);
unset($chapterid);
if ($chapter) {
if ($chapter->bookid != $book->id) {
//chapter id not in this book!!!!
error('Chapter not part of this book!');
}
// $chapternum = $chapter->chapternum;
}
// =========================================================================
// security checks END
开发者ID:ronniebrito,项目名称:moodle_hiperbook,代码行数:31,代码来源:edit.php
示例19: fn_all_mandatory_completed
function fn_all_mandatory_completed($courseid, &$mods)
{
global $USER;
if (isteacheredit($courseid)) {
return true;
}
foreach ($mods as $mod) {
if ($mod->mandatory && $mod->visible && is_activity_complete($mod, $USER->id) === false) {
return false;
}
}
return true;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:13,代码来源:lib.php
示例20: notify
notify(get_string("feedbackupdated", "journal", "{$count}"), "green");
} else {
add_to_log($course->id, "journal", "view responses", "report.php?id={$cm->id}", "{$journal->id}", $cm->id);
}
/// Print out the journal entries
if ($currentgroup) {
$users = get_group_users($currentgroup);
} else {
$users = get_course_students($course->id);
}
if (!$users) {
print_heading(get_string("nousersyet"));
} else {
$grades = make_grades_menu($journal->assessed);
$teachers = get_course_teachers($course->id);
$allowedtograde = ($groupmode != VISIBLEGROUPS or isteacheredit($course->id) or ismember($currentgroup));
if ($allowedtograde) {
echo '<form action="report.php" method="post">';
}
if ($usersdone = journal_get_users_done($journal)) {
foreach ($usersdone as $user) {
if ($currentgroup) {
if (!ismember($currentgroup, $user->id)) {
/// Yes, it's inefficient, but this module will die
continue;
}
}
journal_print_user_entr
|
请发表评论