0
我已成功地使用core_cohort_add_cohort_members登錄了moodle羣組中的用戶,但是我收到了一條警告,可以幫助我避開此警告。我已經通過core_cohort_add_cohort_members成功登記了一個用戶,但得到了一個警告
這是我得到的警告。 { 「警告」:[]}
這裏是我的代碼
$fname = 'core_cohort_add_cohort_members';
/// Paramètres
$member = new stdClass();
$member->cohorttype[type]='id';
$member->cohorttype[value]=2;
$member->usertype[type]='id';
$member->usertype[value]=8;
$members = array($member);
$par = array('members' => $members);
$rest_format = 'json';
$Serve_Url = 'localhost/moodle' . '/webservice/rest/server.php'. '?wstoken=' . '72f102312fff135cbb4a301d9c7839ae' .'&wsfunction='. $fname;
require_once('curl.inc');
$Rest_format = ($rest_format == 'json') ? '&moodlewsrestformat=' . $rest_format : '';
$curl = new curl;
//if rest format == 'xml', then we do not add the param for backward compatibility with Moodle < 2.2
$rep = $curl->post($Serve_Url.$Rest_format, $par);
dpm($rep);