本文整理汇总了PHP中get_course_teachers函数的典型用法代码示例。如果您正苦于以下问题:PHP get_course_teachers函数的具体用法?PHP get_course_teachers怎么用?PHP get_course_teachers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_course_teachers函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: feedback_email_teachers_anonym
function feedback_email_teachers_anonym($cm, $feedback, $course)
{
global $CFG;
if ($feedback->email_notification == 0) {
// No need to do anything
return;
}
$teachers = get_course_teachers($course->id);
if ($teachers) {
$strfeedbacks = get_string('modulenameplural', 'feedback');
$strfeedback = get_string('modulename', 'feedback');
$strcompleted = get_string('completed', 'feedback');
foreach ($teachers as $teacher) {
unset($info);
$info->username = get_string('anonymous', 'feedback');
$info->feedback = format_string($feedback->name, true);
$info->url = $CFG->wwwroot . '/mod/feedback/show_entries_anonym.php?id=' . $cm->id;
$postsubject = $strcompleted . ': ' . $info->username . ' -> ' . $feedback->name;
$posttext = feedback_email_teachers_text($info, $course);
$posthtml = $teacher->mailformat == 1 ? feedback_email_teachers_html($info, $course, $cm) : '';
@email_to_user($teacher, $teacher, $postsubject, $posttext, $posthtml);
}
}
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:24,代码来源:lib.php
示例2: add_to_log
add_to_log($course->id, "journal", "update feedback", "report.php?id={$cm->id}", "{$count} users", $cm->id);
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_entry($course, $user, $entrybyuser[$user->id], $teachers, $grades);
unset($users[$user->id]);
}
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:report.php
示例3: 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
示例4: quiz_upgrade
//.........这里部分代码省略.........
}
if ($success && $oldversion < 2005042002) {
$success = $success && table_column('quiz_answers', 'answer', 'answer', 'text', '', '', '', 'not null', '');
}
if ($success && $oldversion < 2005042400) {
// Changes to quiz table
// The bits of the optionflags field will hold various option flags
$success = $success && table_column('quiz', '', 'optionflags', 'integer', '10', 'unsigned', '0', 'not null', 'timeclose');
// The penalty scheme
$success = $success && table_column('quiz', '', 'penaltyscheme', 'integer', '4', 'unsigned', '0', 'not null', 'optionflags');
// The review options are now all stored in the bits of the review field
$success = $success && table_column('quiz', 'review', 'review', 'integer', 10, 'unsigned', 0, 'not null', '');
/// Changes to quiz_attempts table
// The preview flag marks teacher previews
$success = $success && table_column('quiz_attempts', '', 'preview', 'tinyint', '2', 'unsigned', '0', 'not null', 'timemodified');
// The layout is the list of questions with inserted page breaks.
$success = $success && table_column('quiz_attempts', '', 'layout', 'text', '', '', '', 'not null', 'timemodified');
// For old quiz attempts we will set this to the repaginated question list from $quiz->questions
/// The following updates of field values require a loop through all quizzes
// This is because earlier versions of mysql don't allow joins in UPDATE
if ($quizzes = get_records('quiz')) {
// turn reporting off temporarily to avoid one line output per set_field
$olddebug = $db->debug;
$db->debug = false;
echo 'Now updating ' . count($quizzes) . ' quizzes';
foreach ($quizzes as $quiz) {
// repaginate
if ($quiz->questionsperpage) {
$quiz->questions = quiz_repaginate($quiz->questions, $quiz->questionsperpage);
$success = $success && set_field('quiz', 'questions', $quiz->questions, 'id', $quiz->id);
}
$success = $success && set_field('quiz_attempts', 'layout', $quiz->questions, 'quiz', $quiz->id);
// set preview flag
if ($teachers = get_course_teachers($quiz->course)) {
$teacherids = implode(',', array_keys($teachers));
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_attempts SET preview = 1 WHERE userid IN ({$teacherids})");
}
// set review flags in quiz table
$review = QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_RESPONSES + QUIZ_REVIEW_SCORES;
if ($quiz->feedback) {
$review += QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_FEEDBACK;
}
if ($quiz->correctanswers) {
$review += QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_ANSWERS;
}
if ($quiz->review & 1) {
$review += QUIZ_REVIEW_CLOSED;
}
if ($quiz->review & 2) {
$review += QUIZ_REVIEW_OPEN;
}
$success = $success && set_field('quiz', 'review', $review, 'id', $quiz->id);
}
$db->debug = $olddebug;
}
// We can now drop the fields whose data has been moved to the review field
$success = $success && execute_sql(" ALTER TABLE `{$CFG->prefix}quiz` DROP feedback");
$success = $success && execute_sql(" ALTER TABLE `{$CFG->prefix}quiz` DROP correctanswers");
/// Renaming tables
// rename the quiz_question_grades table to quiz_question_instances
$success = $success && modify_database('', 'ALTER TABLE prefix_quiz_question_grades RENAME prefix_quiz_question_instances;');
// rename the quiz_responses table quiz_states
$success = $success && modify_database('', 'ALTER TABLE prefix_quiz_responses RENAME prefix_quiz_states;');
/// add columns to quiz_states table
// The sequence number of the state.
$success = $success && table_column('quiz_states', '', 'seq_number', 'integer', '6', 'unsigned', '0', 'not null', 'originalquestion');
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:67,代码来源:mysql.php
示例5: certificate_email_teachers
function certificate_email_teachers($certificate)
{
global $course, $USER, $CFG;
if ($certificate->emailteachers == 0) {
// No need to do anything
return;
}
$certrecord = certificate_get_issue($course, $USER, $certificate->id);
$student = $certrecord->studentname;
$cm = get_coursemodule_from_instance("certificate", $certificate->id, $course->id);
if (groupmode($course, $cm) == SEPARATEGROUPS) {
// Separate groups are being used
if (!($group = user_group($course->id, $user->id))) {
// Try to find a group
$group->id = 0;
// Not in a group, never mind
}
$teachers = get_group_teachers($course->id, $group->id);
// Works even if not in group
} else {
$teachers = get_course_teachers($course->id);
}
if ($teachers) {
$strcertificates = get_string('modulenameplural', 'certificate');
$strcertificate = get_string('modulename', 'certificate');
$strawarded = get_string('awarded', 'certificate');
foreach ($teachers as $teacher) {
unset($info);
$info->student = $student;
$info->course = format_string($course->fullname, true);
$info->certificate = format_string($certificate->name, true);
$info->url = $CFG->wwwroot . '/mod/certificate/report.php?id=' . $cm->id;
$from = $student;
$postsubject = $strawarded . ': ' . $info->student . ' -> ' . $certificate->name;
$posttext = certificate_email_teachers_text($info);
$posthtml = certificate_email_teachers_html($info);
$posthtml = $teacher->mailformat == 1 ? certificate_email_teachers_html($info) : '';
@email_to_user($teacher, $from, $postsubject, $posttext, $posthtml);
// If it fails, oh well, too bad.
set_field("certificate_issues", "mailed", "1", "certificateid", $certificate->id, "userid", $USER->id);
}
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:43,代码来源:lib.php
示例6: quiz_upgrade
//.........这里部分代码省略.........
if ($success && $oldversion < 2005042002) {
$success = $success && table_column('quiz_answers', 'answer', 'answer', 'text', '', '', '', 'not null', '');
}
if ($success && $oldversion < 2005042400) {
begin_sql();
// Changes to quiz table
// The bits of the optionflags field will hold various option flags
$success = $success && table_column('quiz', '', 'optionflags', 'integer', '10', 'unsigned', '0', 'not null', 'timeclose');
// The penalty scheme
$success = $success && table_column('quiz', '', 'penaltyscheme', 'integer', '4', 'unsigned', '0', 'not null', 'optionflags');
// The review options are now all stored in the bits of the review field
$success = $success && table_column('quiz', 'review', 'review', 'integer', 10, 'unsigned', 0, 'not null', '');
/// Changes to quiz_attempts table
// The preview flag marks teacher previews
$success = $success && table_column('quiz_attempts', '', 'preview', 'tinyint', '2', 'unsigned', '0', 'not null', 'timemodified');
// The layout is the list of questions with inserted page breaks.
$success = $success && table_column('quiz_attempts', '', 'layout', 'text', '', '', '', 'not null', 'timemodified');
// For old quiz attempts we will set this to the repaginated question list from $quiz->questions
/// The following updates of field values require a loop through all quizzes
// This is because earlier versions of mysql don't allow joins in UPDATE
if ($quizzes = get_records('quiz')) {
// turn reporting off temporarily to avoid one line output per set_field
$olddebug = $db->debug;
$db->debug = false;
foreach ($quizzes as $quiz) {
// repaginate
$quiz->questions = $quiz->questionsperpage ? quiz_repaginate($quiz->questions, $quiz->questionsperpage) : $quiz->questions;
if ($quiz->questionsperpage) {
$quiz->questions = quiz_repaginate($quiz->questions, $quiz->questionsperpage);
$success = $success && set_field('quiz', 'questions', $quiz->questions, 'id', $quiz->id);
}
set_field('quiz_attempts', 'layout', $quiz->questions, 'quiz', $quiz->id);
// set preview flag
if ($teachers = get_course_teachers($quiz->course)) {
$teacherids = implode(',', array_keys($teachers));
$success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_attempts SET preview = 1 WHERE userid IN ({$teacherids})");
}
// set review flags in quiz table
$review = QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_RESPONSES + QUIZ_REVIEW_SCORES;
if ($quiz->feedback) {
$review += QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_FEEDBACK;
}
if ($quiz->correctanswers) {
$review += QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_ANSWERS;
}
if ($quiz->review & 1) {
$review += QUIZ_REVIEW_CLOSED;
}
if ($quiz->review & 2) {
$review += QUIZ_REVIEW_OPEN;
}
$success = $success && set_field('quiz', 'review', $review, 'id', $quiz->id);
}
$db->debug = $olddebug;
}
// We can now drop the fields whose data has been moved to the review field
$success = $success && execute_sql(" ALTER TABLE {$CFG->prefix}quiz DROP COLUMN feedback");
$success = $success && execute_sql(" ALTER TABLE {$CFG->prefix}quiz DROP COLUMN correctanswers");
/// Renaming tables
// rename the quiz_question_grades table to quiz_question_instances
$success = $success && modify_database('', 'ALTER TABLE prefix_quiz_question_grades RENAME TO prefix_quiz_question_instances;');
$success = $success && modify_database('', 'ALTER TABLE prefix_quiz_question_grades_id_seq RENAME TO prefix_quiz_question_instances_id_seq;');
$success = $success && modify_database('', 'ALTER TABLE prefix_quiz_question_instances ALTER COLUMN id SET DEFAULT nextval(\'prefix_quiz_question_instances_id_seq\');');
$success = $success && modify_database('', 'DROP INDEX prefix_quiz_question_grades_quiz_idx');
$success = $success && modify_database('', 'DROP INDEX prefix_quiz_question_grades_question_idx;');
$success = $success && modify_database('', 'CREATE INDEX prefix_quiz_question_instances_quiz_idx ON prefix_quiz_question_instances (quiz);');
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:67,代码来源:postgres7.php
示例7: notice
notice(get_string("activityiscurrentlyhidden"));
}
add_to_log($course->id, "mail", "view", "view.php?id={$cm->id}", $mail->id, $cm->id);
/// Printing the heading
$strmails = get_string("modulenameplural", "mail");
$strmail = get_string("modulename", "mail");
$navigation = "<a href=\"index.php?id={$course->id}\">{$strmails}</a> ->";
print_header_simple(format_string($mail->name), "", "{$navigation} " . format_string($mail->name), "", "", true, update_module_button($cm->id, $course->id, $strmail), navmenu($course, $cm));
/// If no search results then get potential students for this course excluding users already in course
if (count($SESSION->selectedto) > 0) {
$existinguserlist = implode(',', $SESSION->selectedto);
} else {
$existinguserlist = "";
}
if (!($students = get_course_students($course->id, "u.firstname ASC, u.lastname ASC, u.username ASC", "", 0, 99999, '', '', NULL, '', 'u.id,u.username,u.firstname,u.lastname', $existinguserlist))) {
$students = array();
}
if (!($teachers = get_course_teachers($course->id, '', $existinguserlist))) {
$teachers = array();
}
$numusers = count($students) + count($teachers);
mail_start_print_table_main($mail, $cm, $course);
print_heading_block("<center>" . get_string("groups", "mail") . "</center>");
echo "<br>";
include 'groups.html';
mail_end_print_table_main($mail);
/// Finish the page
print_footer($course);
?>
开发者ID:henriquecrang,项目名称:e-UNI,代码行数:29,代码来源:groups.php
示例8: add_to_log
add_to_log($course->id, "mail", "view", "view.php?id={$cm->id}", $mail->id, $cm->id);
/// Printing the heading
$strmails = get_string("modulenameplural", "mail");
$strmail = get_string("modulename", "mail");
$navigation = "<a href=\"index.php?id={$course->id}\">{$strmails}</a> ->";
print_header_simple(format_string($mail->name), "", "{$navigation} " . format_string($mail->name), "", "", true, update_module_button($cm->id, $course->id, $strmail), navmenu($course, $cm));
/// Get all existing students, teachers and groups for this course.
if (count($SESSION->selectedto) > 0) {
$existinguserlist = implode(',', $SESSION->selectedto);
} else {
$existinguserlist = "";
}
if (!($students = get_course_students($course->id, "u.lastname ASC, u.firstname ASC, u.username ASC", "", 0, 99999, '', '', NULL, '', 'u.id,u.username,u.firstname,u.lastname', $existinguserlist))) {
$students = array();
}
if (!($teachers = get_course_teachers($course->id, "u.lastname ASC, u.firstname ASC, u.username ASC", $existinguserlist))) {
$teachers = array();
}
$numusers = count($students) + count($teachers);
if (isteacher($cm->course) or isadmin()) {
if (!($groups = get_records("mail_groups", "mailid", $mail->id, "name ASC"))) {
$groups = array();
}
}
/// If no search results then get potential students for this course excluding users already in course
$usehtmleditor = can_use_html_editor();
mail_start_print_table_main($mail, $cm, $course);
print_heading_block("<center>" . get_string("foldercompose", "mail") . "</center>");
echo "<br>";
include 'compose.html';
mail_end_print_table_main($mail);
开发者ID:henriquecrang,项目名称:e-UNI,代码行数:31,代码来源:compose.php
示例9: skype_show
function skype_show($skype, $user, $cm, $what = "form")
{
global $USER;
$which_group = user_group($cm->course, $user->id);
if (!$which_group) {
$g_id = 0;
} else {
foreach ($which_group as $www => $xxx) {
$g_id = $xxx->id;
}
}
if ($skype->participants == '0') {
//0 for students, 1 for tutors of course
if ($g_id == 0) {
$call_users = get_course_users($cm->course);
} else {
$call_users = get_group_users($g_id);
}
} else {
$call_users = get_course_teachers($cm->course);
}
$return = "";
if ($call_users) {
foreach ($call_users as $call_user) {
if ($call_user->skype) {
$skypeid = $call_user->skype;
if ($what == "casts") {
$return .= '
<script type="text/javascript" src="https://feedsskypecasts.skype.com/skypecasts/webservice/get.js?limit=100&user=' . $skypeid . '"></script>
<script language="javascript" type="text/javascript">//<![CDATA[
var cast;
var cntx=0;
for(i in Skypecasts) {
cntx=1;
cast = Skypecasts[i];
document.write("<a target=\\"_blank\\" href=\\""+cast.url_info+"\\"><img src=\\"skypecast_icon.gif\\" border=0 width=\\"76\\" height=\\"76\\" alt=\\""+cast.title+"\\" /></a>");
document.write("<p class=\\"skypecast-title\\"><a target=\\"_blank\\" href=\\""+cast.url_info+"\\">"+cast.title+"</a></p>");
document.write("<p class=\\"skypecast-host\\">' . get_string("moderator", "skype") . ': "+cast.host_name+"</p>");
document.write("<p class=\\"skypecast-date\\">"+cast.start_time_hint+"</p>");
}
if(cntx == 0){
document.write("<p class=\\"skypecast-title\\">There are no Skypecasts for you!</p><br><br><br>");
document.write("<p class=\\"skypecast-title\\"><br><br><br><br><br><br><br><br> </p>");
}
//]]></script>
';
} else {
if ($USER->id != $call_user->id) {
$return .= "\n\t\t\t\t\t\t<option value='{$skypeid}'>" . fullname($call_user, true) . "</option>";
}
}
}
}
} else {
$call_users = get_course_users($cm->course);
if ($call_users) {
foreach ($call_users as $call_user) {
if ($call_user->skype) {
$skypeid = $call_user->skype;
if ($what == "casts") {
$return .= '
<script type="text/javascript" src="https://feedsskypecasts.skype.com/skypecasts/webservice/get.js?limit=100&user=' . $skypeid . '"></script>
<script language="javascript" type="text/javascript">//<![CDATA[
var cast;
var cntx=0;
for(i in Skypecasts) {
cntx=1;
cast = Skypecasts[i];
document.write("<a target=\\"_blank\\" href=\\""+cast.url_info+"\\"><img src=\\"skypecast_icon.gif\\" border=0 width=\\"76\\" height=\\"76\\" alt=\\""+cast.title+"\\" /></a>");
document.write("<p class=\\"skypecast-title\\"><a target=\\"_blank\\" href=\\""+cast.url_info+"\\">"+cast.title+"</a></p>");
document.write("<p class=\\"skypecast-host\\">' . get_string("moderator", "skype") . ': "+cast.host_name+"</p>");
document.write("<p class=\\"skypecast-date\\">"+cast.start_time_hint+"</p>");
}
if(cntx == 0){
document.write("<p class=\\"skypecast-title\\">There are no Skypecasts for you!</p><br><br><br>");
document.write("<p class=\\"skypecast-title\\"><br><br><br><br><br><br><br><br> </p>");
}
//]]></script>
';
} else {
if ($USER->id != $call_user->id) {
$return .= "\n\t\t\t\t\t\t\t\t<option value='{$skypeid}'>" . fullname($call_user, true) . "</option>";
}
}
}
}
}
}
return $return;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:90,代码来源:lib.php
示例10: exercise_print_teacher_table
function exercise_print_teacher_table($course)
{
// print how many assessments each teacher has done in each exercise
if (!($exercises = get_all_instances_in_course("exercise", $course))) {
notice(get_string('thereareno', 'moodle', get_string('modulenameplural', 'exercise')), "../../course/view.php?id={$course->id}");
die;
}
$timenow = time();
$table->head[] = '';
$table->align[] = 'left';
$table->size[] = '*';
$table->head[] = get_string("total");
$table->align[] = "center";
$table->size[] = "*";
foreach ($exercises as $exercise) {
$table->head[] = format_string($exercise->name);
$table->align[] = "center";
$table->size[] = "*";
}
$table->cellpadding = 2;
$table->cellspacing = 0;
if (!($teachers = get_course_teachers($course->id, "u.firstname, u.lastname"))) {
error("No teachers on this course!");
}
for ($j = 0; $j < count($exercises); $j++) {
$grand[$j] = 0;
}
$grandtotal = 0;
foreach ($teachers as $teacher) {
unset($n);
$total = 0;
$j = 0;
foreach ($exercises as $exercise) {
$i = exercise_count_assessments_by_teacher($exercise, $teacher);
$n[] = $i;
$total += $i;
$grand[$j] += $i;
$j++;
}
$grandtotal += $total;
$table->data[] = array_merge(array(fullname($teacher)), array($total), $n);
}
$table->data[] = array_merge(array(get_string("total")), array($grandtotal), $grand);
print_heading(get_string("teacherassessmenttable", "exercise", $course->teacher));
print_table($table);
}
开发者ID:r007,项目名称:PMoodle,代码行数:46,代码来源:locallib.php
示例11: wiki_print_teacher_selection
function wiki_print_teacher_selection($cm, $dfwiki)
{
global $CFG, $COURSE;
// dont print the list of teachers for wiki commune
$cm = get_coursemodule_from_instance('wiki', $dfwiki->id, $COURSE->id);
if (!($cm->groupmode == '0' && $dfwiki->studentmode == '0')) {
if ($dfwiki->listofteachers) {
//Course teachers list
$wikimanager = wiki_manager_get_instance();
$listteachers = get_course_teachers($COURSE->id);
//$wikimanager->get_course_teachers($COURSE->id); //(nadavkav)
//print the teachers list
wiki_print_menu_teachers($listteachers, $cm);
}
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:16,代码来源:lib.php
示例12: display_submissions
/**
* Display all the submissions ready for grading
*/
function display_submissions()
{
global $CFG, $db, $USER;
/* first we check to see if the form has just been submitted
* to request user_preference updates
*/
if (isset($_POST['updatepref'])) {
$perpage = optional_param('perpage', 10, PARAM_INT);
$perpage = $perpage <= 0 ? 10 : $perpage;
set_user_preference('webquestscorm_perpage', $perpage);
set_user_preference('webquestscorm_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
}
/* next we get perpage and quickgrade (allow quick grade) params
* from database
*/
$perpage = get_user_preferences('webquestscorm_perpage', 10);
$quickgrade = get_user_preferences('webquestscorm_quickgrade', 0);
$teacherattempts = true;
/// Temporary measure
$page = optional_param('page', 0, PARAM_INT);
$strsaveallfeedback = get_string('saveallfeedback', 'webquestscorm');
/// Some shortcuts to make the code read better
$tabindex = 1;
//tabindex for quick grading tabbing; Not working for dropdowns yet
add_to_log($this->course->id, 'webquestscorm', 'view submission', 'editsubmissions.php?cmid=' . $this->cm->id . '&element=uploadedTasks&subelement=all', $this->wqid, $this->cm->id);
$strwebquestscorms = get_string('modulenameplural', 'webquestscorm');
$strwebquestscorm = get_string('modulename', 'webquestscorm');
///Position swapped
if ($groupmode = groupmode($this->course, $this->cm)) {
// Groups are being used
$currentgroup = setup_and_print_groups($this->course, $groupmode, 'editsubmissions.php?cmid=' . $this->cm->id . '&element=uploadedTasks&subelement=all');
} else {
$currentgroup = false;
}
/// Get all teachers and students
if ($currentgroup) {
$users = get_group_users($currentgroup);
} else {
//$users = get_users_by_capability($this->context, 'mod/webquestscorm:submit'); // everyone with this capability set to non-prohibit
$users = get_course_students($this->course->id);
}
$tablecolumns = array('picture', 'fullname', 'grade', 'submissioncomment', 'timemodified', 'timemarked', 'status');
$tableheaders = array('', get_string('fullname'), get_string('grade'), get_string('comment', 'webquestscorm'), get_string('lastmodified') . ' (' . $this->course->student . ')', get_string('lastmodified') . ' (' . $this->course->teacher . ')', get_string('status'));
require_once $CFG->libdir . '/tablelib.php';
$table = new flexible_table('mod-webquestscorm-submissions');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/webquestscorm/editsubmissions.php?cmid=' . $this->cm->id . '&element=uploadedTasks&subelement=all&currentgroup=' . $currentgroup);
$table->define_baseurl($CFG->wwwroot . '/mod/webquestscorm/editsubmissions.php?cmid=' . $this->cm->id . '&currentgroup=' . $currentgroup . '&element=uploadedTasks&subelement=all');
$table->sortable(true, 'lastname');
//sorted by lastname by default
$table->collapsible(true);
$table->initialbars(true);
$table->column_suppress('picture');
$table->column_suppress('fullname');
$table->column_class('picture', 'picture');
$table->column_class('fullname', 'fullname');
$table->column_class('grade', 'grade');
$table->column_class('submissioncomment', 'comment');
$table->column_class('timemodified', 'timemodified');
$table->column_class('timemarked', 'timemarked');
$table->column_class('status', 'status');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'attempts');
$table->set_attribute('class', 'submissions');
$table->set_attribute('width', '90%');
$table->set_attribute('align', 'center');
// Start working -- this is necessary as soon as the niceties are over
$table->setup();
/// Check to see if groups are being used in this webquestscorm
if (!$teacherattempts) {
$teachers = get_course_teachers($this->course->id);
if (!empty($teachers)) {
$keys = array_keys($teachers);
}
foreach ($keys as $key) {
unset($users[$key]);
}
}
if (empty($users)) {
print_heading(get_string('noattempts', 'webquestscorm'));
print_footer($this->course);
return true;
}
/// Construct the SQL
if ($where = $table->get_sql_where()) {
$where .= ' AND ';
}
if ($sort = $table->get_sql_sort()) {
$sort = ' ORDER BY ' . $sort;
}
$select = 'SELECT u.id, u.firstname, u.lastname, u.picture,
s.id AS submissionid, s.grade, s.submissioncomment,
s.timemodified, s.timemarked ';
$sql = 'FROM ' . $CFG->prefix . 'user u ' . 'LEFT JOIN ' . $CFG->prefix . 'webquestscorm_submissions s ON u.id = s.userid
AND s.webquestscorm = ' . $this->wqid . ' ' . 'WHERE ' . $where . 'u.id IN (' . implode(',', array_keys($users)) . ') ';
$table->pagesize($perpage, count($users));
//.........这里部分代码省略.........
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:submissions.class.php
示例13: netpublish_get_all_authors
function netpublish_get_all_authors($netpublishid, $courseid)
{
global $CFG;
$netpublishid = clean_param($netpublishid, PARAM_INT);
$courseid = clean_param($courseid, PARAM_INT);
if (empty($netpublishid) or empty($courseid)) {
return NULL;
}
$userids = get_records_sql("SELECT DISTINCT userid, teacherid, authors\n FROM {$CFG->prefix}netpublish_articles\n WHERE publishid = {$netpublishid}");
$usertmp = array();
if (is_array($userids)) {
foreach ($userids as $user) {
array_push($usertmp, $user->userid);
array_push($usertmp, $user->teacherid);
if (!empty($user->authors)) {
$strtoarr = explode(",", $user->authors);
foreach ($strtoarr as $userid) {
array_push($usertmp, $userid);
}
}
}
}
unset($userids);
$usertmp = array_unique($usertmp);
sort($usertmp);
$userids = implode(",", $usertmp);
unset($usertmp);
$userids = addslashes($userids);
if (empty($userids)) {
return NULL;
}
// Exclude teachers from list
$exclude = NULL;
if ($teachers = get_course_teachers($courseid)) {
$count = 1;
foreach ($teachers as $teacher) {
if ($count > 1) {
$exclude .= ',';
}
$exclude .= $teacher->id;
$count++;
}
}
$exclude = !is_null($exclude) ? " AND u.id NOT IN ({$exclude})" : '';
$authors = get_records_sql("SELECT u.id, u.firstname, u.lastname, u.picture\n FROM {$CFG->prefix}user u\n WHERE u.id IN ({$userids}){$exclude}");
return $authors;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:47,代码来源:grades.php
示例14: get_group_teachers
/**
* Returns list of all the teachers who can access a group
*
* @uses $CFG
* @param int $courseid The course in question.
* @param int $groupid The group in question.
* @return object
*/
function get_group_teachers($courseid, $groupid)
{
/// Returns a list of all the teachers who can access a group
if ($teachers = get_course_teachers($courseid)) {
foreach ($teachers as $key => $teacher) {
if ($teacher->editall) {
// These can access anything
continue;
}
if ($teacher->authority > 0 and ismember($groupid, $teacher->id)) {
// Specific group teachers
continue;
}
unset($teachers[$key]);
}
}
return $teachers;
}
开发者ID:veritech,项目名称:pare-project,代码行数:26,代码来源:deprecatedlib.php
示例15: exportUsers
public function exportUsers($courseID = 1, $shortname = null)
{
if ($courseID != 1 and $shortname != null) {
//Verify if course exists
if (!record_exists($this->courses_table, "id", $courseID, "shortname", $shortname)) {
// Return ERROR message
throw new MoodlePluginException("ERROR, course not found...", 1);
}
}
//Get course students and teachers
$teachers = get_course_teachers($courseID);
$students = get_course_students($courseID);
$courseUsers = $teachers + $students;
//Create new DOMDocument
$xml = new DOMDocument("1.0");
$xml->formatOutput = true;
$root = $xml->createElement("users");
foreach ($courseUsers as $courseUser) {
$ele_user = $xml->createElement("user");
$ele_user_description = $xml->createElement("user_description");
$ele_moodle_oriented = $xml->createElement("moodle_oriented");
//Assign role to user
if (in_array($courseUser, $teachers)) {
$role = "teacher";
} else {
$role = "student";
}
$att_role = new DOMAttr("role", $role);
$ele_user->setAttributeNode($att_role);
//Get every information about users
$user = get_record($this->users_table, "id", $courseUser->id);
foreach ($user as $key => $value) {
$child = $xml->createElement($key, $value);
switch ($key) {
case "username":
case "password":
case "firstname":
case "lastname":
case "email":
$ele_user->appendChild($child);
break;
case "id":
case "auth":
case "confirmed":
case "deleted":
case "idnumber":
case "emailstop":
case "firstaccess":
case "lastaccess":
case "lastlogin":
case "currentlogin":
case "lastIP":
case "secret":
case "picture":
case "mailformat":
case "maildigest":
case "maildisplay":
case "htmleditor":
case "autosubscribe":
case "timemodified":
$ele_moodle_oriented->appendChild($child);
break;
case "icq":
case "phone1":
case "phone2":
case "institution":
case "department":
case "address":
case "city":
case "country":
case "lang":
case "timezone":
case "url":
case "description":
case "it_CF":
case "birthdate":
$ele_user_description->appendChild($child);
break;
}
}
$ele_user->appendChild($ele_moodle_oriented);
$ele_user->appendChild($ele_user_description);
$root->appendChild($ele_user);
}
$xml->appendChild($root);
//Return a string containing the XML Document
$xml->save($this->users_xml);
$f = fopen($this->users_xml, r);
$str = fread($f, filesize($this->users_xml));
fclose($f);
return $str;
}
开发者ID:BackupTheBerlios,项目名称:moodlews-svn,代码行数:92,代码来源:moodleplugin.php
示例16: display_submissions
//.........这里部分代码省略.........
require_once $CFG->libdir . '/tablelib.php';
$table = new flexible_table('mod-assignment-submissions');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id . '&currentgroup=' . $currentgroup);
$table->sortable(true, 'lastname');
//sorted by lastname by default
$table->collapsible(true);
$table->initialbars(true);
$table->column_suppress('picture');
$table->column_suppress('fullname');
$table->column_class('picture', 'picture');
$table->column_class('fullname', 'fullname');
$table->column_class('grade', 'grade');
$table->column_class('submissioncomment', 'comment');
$table->column_class('timemodified', 'timemodified');
$table->column_class('timemarked', 'timemarked');
$table->column_class('status', 'status');
$table->column_class('finalgrade', 'finalgrade');
if ($uses_outcomes) {
$table->column_class('outcome', 'outcome');
}
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'attempts');
$table->set_attribute('class', 'submissions');
$table->set_attribute('width', '90%');
//$table->set_attribute('align', 'center');
$table->no_sorting('finalgrade');
$table->no_sorting('outcome');
// Start working -- this is necessary as soon as the niceties are over
$table->setup();
/// Check to see if groups are being used in this assignment
if (!$teacherattempts) {
$teachers = get_course_teachers($course->id);
if (!empty($teachers)) {
$keys = array_keys($teachers);
}
foreach ($keys as $key) {
unset($users[$key]);
}
}
if (empty($users)) {
print_heading(get_string('noattempts', 'assignment'));
return true;
}
/// Construct the SQL
if ($where = $table->get_sql_wh
|
请发表评论