Merge branch 'MDL-31902-master' of git://github.com/ankitagarwal/moodle
This commit is contained in:
@@ -270,21 +270,6 @@ function lti_grades($basicltiid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Must return an array of user records (all data) who are participants
|
||||
* for a given instance of basiclti. Must include every user involved
|
||||
* in the instance, independient of his role (student, teacher, admin...)
|
||||
* See other modules as example.
|
||||
*
|
||||
* @param int $basicltiid ID of an instance of this module
|
||||
* @return mixed boolean/array of students
|
||||
*
|
||||
* @TODO: implement this moodle function
|
||||
**/
|
||||
function lti_get_participants($basicltiid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns if a scale is being used by one basiclti
|
||||
* it it has support for grading and scales. Commented code should be
|
||||
|
||||
@@ -745,23 +745,6 @@ function quiz_grade_item_delete($quiz) {
|
||||
null, array('deleted' => 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of users who have data in a given quiz
|
||||
*
|
||||
* @todo: deprecated - to be deleted in 2.2
|
||||
*
|
||||
* @param int $quizid the quiz id.
|
||||
* @return array of userids.
|
||||
*/
|
||||
function quiz_get_participants($quizid) {
|
||||
global $CFG, $DB;
|
||||
|
||||
return $DB->get_records_sql('
|
||||
SELECT DISTINCT userid, userid
|
||||
JOIN {quiz_attempts} qa
|
||||
WHERE a.quiz = ?', array($quizid));
|
||||
}
|
||||
|
||||
/**
|
||||
* This standard function will check all instances of this module
|
||||
* and make sure there are up-to-date events created for each of them.
|
||||
|
||||
@@ -267,39 +267,6 @@ function survey_print_recent_activity($course, $viewfullnames, $timestart) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the users with data in one survey
|
||||
* (users with records in survey_analysis and survey_answers, students)
|
||||
*
|
||||
* @todo: deprecated - to be deleted in 2.2
|
||||
*
|
||||
* @param int $surveyid
|
||||
* @return array
|
||||
*/
|
||||
function survey_get_participants($surveyid) {
|
||||
global $DB;
|
||||
|
||||
//Get students from survey_analysis
|
||||
$st_analysis = $DB->get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {user} u, {survey_analysis} a
|
||||
WHERE a.survey = ? AND
|
||||
u.id = a.userid", array($surveyid));
|
||||
//Get students from survey_answers
|
||||
$st_answers = $DB->get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {user} u, {survey_answers} a
|
||||
WHERE a.survey = ? AND
|
||||
u.id = a.userid", array($surveyid));
|
||||
|
||||
//Add st_answers to st_analysis
|
||||
if ($st_answers) {
|
||||
foreach ($st_answers as $st_answer) {
|
||||
$st_analysis[$st_answer->id] = $st_answer;
|
||||
}
|
||||
}
|
||||
//Return st_analysis array (it contains an array of unique users)
|
||||
return ($st_analysis);
|
||||
}
|
||||
|
||||
// SQL FUNCTIONS ////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
|
||||
@@ -235,18 +235,6 @@ function url_user_complete($course, $user, $mod, $url) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the users with data in one url
|
||||
*
|
||||
* @todo: deprecated - to be deleted in 2.2
|
||||
*
|
||||
* @param int $urlid
|
||||
* @return bool false
|
||||
*/
|
||||
function url_get_participants($urlid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a course_module object, this function returns any
|
||||
* "extra" information that may be needed when printing
|
||||
|
||||
@@ -376,21 +376,6 @@ function wiki_grades($wikiid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Must return an array of user records (all data) who are participants
|
||||
* for a given instance of wiki. Must include every user involved
|
||||
* in the instance, independient of his role (student, teacher, admin...)
|
||||
* See other modules as example.
|
||||
*
|
||||
* @todo: deprecated - to be deleted in 2.2
|
||||
*
|
||||
* @param int $wikiid ID of an instance of this module
|
||||
* @return mixed boolean/array of students
|
||||
**/
|
||||
function wiki_get_participants($wikiid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns if a scale is being used by one wiki
|
||||
* it it has support for grading and scales. Commented code should be
|
||||
|
||||
@@ -949,49 +949,6 @@ function workshop_cron() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of user ids who are participanting in this workshop
|
||||
*
|
||||
* Participants are either submission authors or reviewers or both.
|
||||
* Authors of the example submissions and their referential assessments
|
||||
* are not returned as the example submission is considered non-user
|
||||
* data for the purpose of workshop backup.
|
||||
*
|
||||
* @todo: deprecated - to be deleted in 2.2
|
||||
*
|
||||
* @param int $workshopid ID of an instance of this module
|
||||
* @return array of user ids, empty if there are no participants
|
||||
*/
|
||||
function workshop_get_participants($workshopid) {
|
||||
global $DB;
|
||||
|
||||
$sql = "SELECT u.id
|
||||
FROM {workshop} w
|
||||
JOIN {workshop_submissions} s ON s.workshopid = w.id
|
||||
JOIN {user} u ON s.authorid = u.id
|
||||
WHERE w.id = ? AND s.example = 0
|
||||
|
||||
UNION
|
||||
|
||||
SELECT u.id
|
||||
FROM {workshop} w
|
||||
JOIN {workshop_submissions} s ON s.workshopid = w.id
|
||||
JOIN {workshop_assessments} a ON a.submissionid = s.id
|
||||
JOIN {user} u ON a.reviewerid = u.id
|
||||
WHERE w.id = ? AND (s.example = 0 OR a.weight = 0)";
|
||||
|
||||
$users = array();
|
||||
$rs = $DB->get_recordset_sql($sql, array($workshopid, $workshopid));
|
||||
foreach ($rs as $user) {
|
||||
if (empty($users[$user->id])) {
|
||||
$users[$user->id] = $user;
|
||||
}
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is a given scale used by the instance of workshop?
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user